[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] Revert "x86/vvmx: correct nested shadow VMCS handling"



commit 9685a28f926527331386e5851d60cb2a757d773d
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Mar 17 09:31:19 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Mar 17 09:31:19 2017 +0100

    Revert "x86/vvmx: correct nested shadow VMCS handling"
    
    This reverts commit dc05c0ceeb8609b6d60f6a117a0192e9160946b8,
    causing a regression.
---
 xen/arch/x86/hvm/vmx/vvmx.c        | 22 ++++------------------
 xen/include/asm-x86/hvm/vmx/vvmx.h |  1 -
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 3017849..09e4250 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1119,19 +1119,10 @@ static bool_t nvmx_vpid_enabled(const struct vcpu *v)
 
 static void nvmx_set_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
 {
-    struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     paddr_t vvmcs_maddr = v->arch.hvm_vmx.vmcs_shadow_maddr;
 
     __vmpclear(vvmcs_maddr);
-    if ( !nvmx->shadow_vmcs )
-    {
-        /*
-         * We must set the shadow VMCS-indicator in order for the next vmentry
-         * to succeed with a newly set up link pointer in vmcs01.
-         * Note: guest can see that this bit was set.
-         */
-        vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
-    }
+    vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
     __vmwrite(VMCS_LINK_POINTER, vvmcs_maddr);
     __vmwrite(VMREAD_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmread_bitmap));
     __vmwrite(VMWRITE_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmwrite_bitmap));
@@ -1139,13 +1130,10 @@ static void nvmx_set_vmcs_pointer(struct vcpu *v, 
struct vmcs_struct *vvmcs)
 
 static void nvmx_clear_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
 {
-    struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     paddr_t vvmcs_maddr = v->arch.hvm_vmx.vmcs_shadow_maddr;
 
     __vmpclear(vvmcs_maddr);
-    if ( !nvmx->shadow_vmcs )
-        vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
-    nvmx->shadow_vmcs = false;
+    vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
     __vmwrite(VMCS_LINK_POINTER, ~0ul);
     __vmwrite(VMREAD_BITMAP, 0);
     __vmwrite(VMWRITE_BITMAP, 0);
@@ -1686,14 +1674,12 @@ int nvmx_handle_vmptrld(struct cpu_user_regs *regs)
         {
             if ( writable )
             {
-                struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
                 struct vmcs_struct *vvmcs = vvmcx;
 
-                nvmx->shadow_vmcs =
-                    vvmcs->vmcs_revision_id & ~VMX_BASIC_REVISION_MASK;
                 if ( ((vvmcs->vmcs_revision_id ^ vmx_basic_msr) &
                                          VMX_BASIC_REVISION_MASK) ||
-                     (!cpu_has_vmx_vmcs_shadowing && nvmx->shadow_vmcs) )
+                     (!cpu_has_vmx_vmcs_shadowing &&
+                      (vvmcs->vmcs_revision_id & ~VMX_BASIC_REVISION_MASK)) )
                 {
                     hvm_unmap_guest_frame(vvmcx, 1);
                     vmfail(regs, VMX_INSN_VMPTRLD_INCORRECT_VMCS_ID);
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h 
b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 9a65218..ca2fb25 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -51,7 +51,6 @@ struct nestedvmx {
     } ept;
     uint32_t guest_vpid;
     struct list_head launched_list;
-    bool shadow_vmcs;
 };
 
 #define vcpu_2_nvmx(v) (vcpu_nestedhvm(v).u.nvmx)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.