summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2017-04-02 20:21:45 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2017-04-02 20:21:45 +0000
commit4eef80a1f1f9a5039b354a6d0187218b6170932e (patch)
treebf3e8f8705e5bd0c956edeb888e9c98e1190d440
parent51d718f92adbd9cac22c23933d4b1ee2c3ae8b3a (diff)
Filter out RDTSCP, needed to handle solaris guests. We set the VMX control
to enable RDTSCP to 0, so when solaris attempted to use the instruction (since it wasn't filtered out of CPUID information), the CPU issued an #UD exception.
-rw-r--r--sys/arch/amd64/amd64/vmm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index c72beaa3ebe..516e7bf757f 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.131 2017/03/28 21:38:44 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.132 2017/04/02 20:21:44 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -4638,6 +4638,7 @@ vmm_handle_cpuid(struct vcpu *vcpu)
*rbx = 0; /* Reserved */
*rcx = curcpu()->ci_efeature_ecx;
*rdx = curcpu()->ci_feature_eflags;
+ *rdx &= ~CPUID_RDTSCP;
break;
case 0x80000002: /* Brand string */
*rax = curcpu()->ci_brand[0];