VMX: Report the correct flags in IA32_APICBASE MSR emulation
authorGan Shun Lim <ganshun@gmail.com>
Thu, 22 Dec 2016 02:24:49 +0000 (10:24 +0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 17 Jan 2017 19:16:49 +0000 (14:16 -0500)
This commit reports to the guest that the apics are already in x2apic
mode, and reports the bsp flag only for guest pcore 0.

Change-Id: If04a424cc7a9668e966536e5369aefb1679321e5
Signed-off-by: Gan Shun Lim <ganshun@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/vmm/vmm.c

index 392814c..01bcaf8 100644 (file)
@@ -460,7 +460,11 @@ bool emsr_fake_apicbase(struct emmsr *msr, struct vm_trapframe *vm_tf,
        if (!msr->written) {
                /* TODO: tightly coupled to the addr in vmrunkernel.  We want this func
                 * to return the val that vmrunkernel put into the VMCS. */
-               eax = 0xfee00900;
+               eax = 0xfee00d00;
+               if (vm_tf->tf_guest_pcoreid != 0) {
+                       // Remove BSP bit if not core 0
+                       eax = 0xfee00c00;
+               }
                edx = 0;
        } else {
                edx = msr->edx;