x86/VT-x: Fix determination of EFER.LMA in vmcs_dump_vcpu()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 9 Apr 2018 17:56:03 +0000 (18:56 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Apr 2018 10:06:55 +0000 (11:06 +0100)
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>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/vmx/vmcs.c

index 2c5ef36e5e8c7b8e2d52fef60046f42a3bcfdf59..70c2fb74826a8374a6c26502d2199dc54ab3e438 100644 (file)
@@ -1788,7 +1788,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",