Make the cache neighbor fields match the number of VCPUs present
(currently 1)
ok reyk
-/* $OpenBSD: vmm.c,v 1.212 2018/07/11 12:55:01 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.213 2018/07/11 13:19:42 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
break;
case 0x04: /* Deterministic cache info */
if (*rcx == 0) {
- *rax = eax;
+ *rax = eax & VMM_CPUID4_CACHE_TOPOLOGY_MASK;
*rbx = ebx;
*rcx = ecx;
*rdx = edx;
} else {
CPUID_LEAF(*rax, *rcx, eax, ebx, ecx, edx);
- *rax = eax;
+ *rax = eax & VMM_CPUID4_CACHE_TOPOLOGY_MASK;
*rbx = ebx;
*rcx = ecx;
*rdx = edx;
-/* $OpenBSD: vmmvar.h,v 1.54 2018/07/05 05:07:03 mlarkin Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.55 2018/07/11 13:19:42 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
*/
#define VMM_FEAT_EFLAGS_MASK ~(CPUID_RDTSCP)
+/*
+ * CPUID[0x4] deterministic cache info
+ */
+#define VMM_CPUID4_CACHE_TOPOLOGY_MASK 0x3FF
+
#ifdef _KERNEL
#define VMX_FAIL_LAUNCH_UNKNOWN 1