summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2023-09-05 14:00:42 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2023-09-05 14:00:42 +0000
commit09b6f85f57dc18e8d9350a4dfcdbbd50b87f6e44 (patch)
tree3d17b6a51526b9b5ca0a813152a5d4f2b758e844 /sys
parent5f2158bfbf862621568bc32d137faf90ac464cdd (diff)
vmm(4): switch the APMI CPUID mask to an include mask
dv points out that there are other bits there that imply the existence of other MSRs, so switching this to an include list is a better idea.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/vmm_machdep.c4
-rw-r--r--sys/arch/amd64/include/vmmvar.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/vmm_machdep.c b/sys/arch/amd64/amd64/vmm_machdep.c
index 6a63b021e20..4e68581d131 100644
--- a/sys/arch/amd64/amd64/vmm_machdep.c
+++ b/sys/arch/amd64/amd64/vmm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm_machdep.c,v 1.6 2023/09/03 09:30:43 mlarkin Exp $ */
+/* $OpenBSD: vmm_machdep.c,v 1.7 2023/09/05 14:00:40 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -6319,7 +6319,7 @@ vmm_handle_cpuid(struct vcpu *vcpu)
*rax = eax;
*rbx = ebx;
*rcx = ecx;
- *rdx = edx & VMM_APMI_EDX_MASK;
+ *rdx = edx & VMM_APMI_EDX_INCLUDE_MASK;
break;
case 0x80000008: /* Phys bits info and topology (AMD) */
*rax = eax;
diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h
index a187c4f1d2d..4b75fa8ac19 100644
--- a/sys/arch/amd64/include/vmmvar.h
+++ b/sys/arch/amd64/include/vmmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmmvar.h,v 1.92 2023/09/03 09:30:43 mlarkin Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.93 2023/09/05 14:00:41 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -559,7 +559,9 @@ struct vm_mprotect_ept_params {
CPUIDEBX_STIBP | CPUIDEBX_IBRS_ALWAYSON | CPUIDEBX_STIBP_ALWAYSON | \
CPUIDEBX_IBRS_PREF | CPUIDEBX_SSBD | CPUIDEBX_VIRT_SSBD | \
CPUIDEBX_SSBD_NOTREQ)
-#define VMM_APMI_EDX_MASK ~(CPUIDEDX_HWPSTATE)
+
+/* This mask is an include list for bits we want to expose */
+#define VMM_APMI_EDX_INCLUDE_MASK (CPUIDEDX_ITSC)
/*
* SEFF flags - copy from host minus: