vmm: x86: do not advertise support for TSC_ADJUST
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 24 May 2019 21:28:51 +0000 (17:28 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 24 May 2019 21:31:58 +0000 (17:31 -0400)
This is relatively harmless, but Linux tries to touch this MSR early in
boot and we inject a GPF.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/trap.c

index b3e902c..7647360 100644 (file)
@@ -927,6 +927,10 @@ static bool handle_vmexit_cpuid(struct vm_trapframe *tf)
                ebx |= (current->vmm.nr_guest_pcores & 0xff) << 16;
                ebx |= (tf->tf_guest_pcoreid & 0xff) << 24;
                break;
+       case 0x07:
+               /* Do not advertise TSC_ADJUST */
+               ebx &= ~(1 << 1);
+               break;
        case 0x0A:
                eax = 0;
                ebx = 0;