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

[Xen-changelog] [xen staging-4.10] x86/VT-x: Fix printing of EFER in vmcs_dump_vcpu()



commit 6e0e45a963aab5e733fb7f81dc29dd1008d7f191
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Jul 4 12:28:49 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 4 12:28:49 2018 +0200

    x86/VT-x: Fix printing of EFER in vmcs_dump_vcpu()
    
    This is essentially a "take 2" of c/s 82540b66ce "x86/VT-x: Fix 
determination
    of EFER.LMA in vmcs_dump_vcpu()" because in hindight, that change was more
    problematic than useful.
    
    The original reason was to fix the logic for determining when not to print 
the
    PDPTE pointers.  However, mutating the efer variable (particularly LME and
    LMA) before printing it interferes with diagnosing vmentry failures.
    
    Instead of modifying efer, change the PDPTE conditional to use
    VM_ENTRY_IA32E_MODE.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    master commit: 35fcb982ea16c40619fee8bba4789a94d824521e
    master date: 2018-06-05 11:55:51 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 1e66bc35df..d4368cc375 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1786,10 +1786,7 @@ void vmcs_dump_vcpu(struct vcpu *v)
     vmentry_ctl = vmr32(VM_ENTRY_CONTROLS),
     vmexit_ctl = vmr32(VM_EXIT_CONTROLS);
     cr4 = vmr(GUEST_CR4);
-
-    /* EFER.LMA is read as zero, and is loaded from vmentry_ctl on entry. */
-    BUILD_BUG_ON(VM_ENTRY_IA32E_MODE << 1 != EFER_LMA);
-    efer = vmr(GUEST_EFER) | ((vmentry_ctl & VM_ENTRY_IA32E_MODE) << 1);
+    efer = vmr(GUEST_EFER);
 
     printk("*** Guest State ***\n");
     printk("CR0: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",
@@ -1799,7 +1796,7 @@ void vmcs_dump_vcpu(struct vcpu *v)
     printk("CR3 = 0x%016lx\n", vmr(GUEST_CR3));
     if ( (v->arch.hvm_vmx.secondary_exec_control &
           SECONDARY_EXEC_ENABLE_EPT) &&
-         (cr4 & X86_CR4_PAE) && !(efer & EFER_LMA) )
+         (cr4 & X86_CR4_PAE) && !(vmentry_ctl & VM_ENTRY_IA32E_MODE) )
     {
         printk("PDPTE0 = 0x%016lx  PDPTE1 = 0x%016lx\n",
                vmr(GUEST_PDPTE(0)), vmr(GUEST_PDPTE(1)));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
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®.