summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2018-03-29 02:25:11 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2018-03-29 02:25:11 +0000
commit653ebf71d5b2370c7604a679c6c83631c2fe2467 (patch)
treef3a0b21c904ab2de45352765be30c7034480d099 /sys
parent32014b7290b4421854a3a293293c8ced143a23c1 (diff)
Remove RDTSCP from the CPUID flags reported to the guest VM. The instruction
was already disabled, but reporting it as available and then failing it caused SmartOS to crash during boot. ok pd@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/vmm.c4
-rw-r--r--sys/arch/amd64/include/vmmvar.h8
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 8570ed6b732..ec8cbd7a188 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.185 2018/03/18 08:58:58 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.186 2018/03/29 02:25:10 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -5943,7 +5943,7 @@ vmm_handle_cpuid(struct vcpu *vcpu)
*rax = curcpu()->ci_efeature_eax;
*rbx = 0; /* Reserved */
*rcx = curcpu()->ci_efeature_ecx;
- *rdx = curcpu()->ci_feature_eflags;
+ *rdx = curcpu()->ci_feature_eflags & VMM_FEAT_EFLAGS_MASK;
break;
case 0x80000002: /* Brand string */
*rax = curcpu()->ci_brand[0];
diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h
index b6fe6ece4a8..920a2e296a0 100644
--- a/sys/arch/amd64/include/vmmvar.h
+++ b/sys/arch/amd64/include/vmmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmmvar.h,v 1.50 2017/11/29 02:46:10 mlarkin Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.51 2018/03/29 02:25:10 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -587,6 +587,12 @@ struct vm_rwregs_params {
SEFF0EBX_AVX512BW | SEFF0EBX_AVX512VL)
#define VMM_SEFF0ECX_MASK ~(SEFF0ECX_AVX512VBMI)
+/*
+ * Extended function flags - copy from host minus:
+ * 0x80000001 EDX:RDTSCP Support
+ */
+#define VMM_FEAT_EFLAGS_MASK ~(CPUID_RDTSCP)
+
#ifdef _KERNEL
#define VMX_FAIL_LAUNCH_UNKNOWN 1