File 5acdde3f-VT-x-fix-determination-of-EFER-LMA-in-vmcs_dump_vcpu.patch of Package xen.7652
# Commit 82540b66ceb9318aa185f2488cbbbe479694de8f
# Date 2018-04-11 11:06:55 +0100
# Author Andrew Cooper <andrew.cooper3@citrix.com>
# Committer Andrew Cooper <andrew.cooper3@citrix.com>
x86/VT-x: Fix determination of EFER.LMA in vmcs_dump_vcpu()
The LMA setting comes from the entry controls.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
--- sle12sp2.orig/xen/arch/x86/hvm/vmx/vmcs.c 2017-11-20 17:22:22.000000000 +0100
+++ sle12sp2/xen/arch/x86/hvm/vmx/vmcs.c 2018-04-18 14:57:37.000000000 +0200
@@ -1800,7 +1800,10 @@ void vmcs_dump_vcpu(struct vcpu *v)
vmentry_ctl = vmr32(VM_ENTRY_CONTROLS),
vmexit_ctl = vmr32(VM_EXIT_CONTROLS);
cr4 = vmr(GUEST_CR4);
- efer = vmr(GUEST_EFER);
+
+ /* 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);
printk("*** Guest State ***\n");
printk("CR0: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n",