1. 12 7月, 2011 8 次提交
    • N
      KVM: nVMX: Implement reading and writing of VMX MSRs · b87a51ae
      Nadav Har'El 提交于
      When the guest can use VMX instructions (when the "nested" module option is
      on), it should also be able to read and write VMX MSRs, e.g., to query about
      VMX capabilities. This patch adds this support.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      b87a51ae
    • N
      KVM: nVMX: Introduce vmcs12: a VMCS structure for L1 · a9d30f33
      Nadav Har'El 提交于
      An implementation of VMX needs to define a VMCS structure. This structure
      is kept in guest memory, but is opaque to the guest (who can only read or
      write it with VMX instructions).
      
      This patch starts to define the VMCS structure which our nested VMX
      implementation will present to L1. We call it "vmcs12", as it is the VMCS
      that L1 keeps for its L2 guest. We will add more content to this structure
      in later patches.
      
      This patch also adds the notion (as required by the VMX spec) of L1's "current
      VMCS", and finally includes utility functions for mapping the guest-allocated
      VMCSs in host memory.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      a9d30f33
    • N
      KVM: nVMX: Allow setting the VMXE bit in CR4 · 5e1746d6
      Nadav Har'El 提交于
      This patch allows the guest to enable the VMXE bit in CR4, which is a
      prerequisite to running VMXON.
      
      Whether to allow setting the VMXE bit now depends on the architecture (svm
      or vmx), so its checking has moved to kvm_x86_ops->set_cr4(). This function
      now returns an int: If kvm_x86_ops->set_cr4() returns 1, __kvm_set_cr4()
      will also return 1, and this will cause kvm_set_cr4() will throw a #GP.
      
      Turning on the VMXE bit is allowed only when the nested VMX feature is
      enabled, and turning it off is forbidden after a vmxon.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      5e1746d6
    • N
      KVM: nVMX: Implement VMXON and VMXOFF · ec378aee
      Nadav Har'El 提交于
      This patch allows a guest to use the VMXON and VMXOFF instructions, and
      emulates them accordingly. Basically this amounts to checking some
      prerequisites, and then remembering whether the guest has enabled or disabled
      VMX operation.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      ec378aee
    • N
      KVM: nVMX: Add "nested" module option to kvm_intel · 801d3424
      Nadav Har'El 提交于
      This patch adds to kvm_intel a module option "nested". This option controls
      whether the guest can use VMX instructions, i.e., whether we allow nested
      virtualization. A similar, but separate, option already exists for the
      SVM module.
      
      This option currently defaults to 0, meaning that nested VMX must be
      explicitly enabled by giving nested=1. When nested VMX matures, the default
      should probably be changed to enable nested VMX by default - just like
      nested SVM is currently enabled by default.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      801d3424
    • N
      KVM: VMX: Keep list of loaded VMCSs, instead of vcpus · d462b819
      Nadav Har'El 提交于
      In VMX, before we bring down a CPU we must VMCLEAR all VMCSs loaded on it
      because (at least in theory) the processor might not have written all of its
      content back to memory. Since a patch from June 26, 2008, this is done using
      a per-cpu "vcpus_on_cpu" linked list of vcpus loaded on each CPU.
      
      The problem is that with nested VMX, we no longer have the concept of a
      vcpu being loaded on a cpu: A vcpu has multiple VMCSs (one for L1, a pool for
      L2s), and each of those may be have been last loaded on a different cpu.
      
      So instead of linking the vcpus, we link the VMCSs, using a new structure
      loaded_vmcs. This structure contains the VMCS, and the information pertaining
      to its loading on a specific cpu (namely, the cpu number, and whether it
      was already launched on this cpu once). In nested we will also use the same
      structure to hold L2 VMCSs, and vmx->loaded_vmcs is a pointer to the
      currently active VMCS.
      Signed-off-by: NNadav Har'El <nyh@il.ibm.com>
      Acked-by: NAcked-by: Kevin Tian <kevin.tian@intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d462b819
    • A
      KVM: VMX: always_inline VMREADs · 96304217
      Avi Kivity 提交于
      vmcs_readl() and friends are really short, but gcc thinks they are long because of
      the out-of-line exception handlers.  Mark them always_inline to clear the
      misunderstanding.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      96304217
    • A
      KVM: VMX: Move VMREAD cleanup to exception handler · 5e520e62
      Avi Kivity 提交于
      We clean up a failed VMREAD by clearing the output register.  Do
      it in the exception handler instead of unconditionally.  This is
      worthwhile since there are more than a hundred call sites.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      5e520e62
  2. 20 6月, 2011 1 次提交
  3. 22 5月, 2011 2 次提交
  4. 11 5月, 2011 15 次提交
  5. 18 3月, 2011 12 次提交
  6. 12 1月, 2011 2 次提交