diff --git a/sys/amd64/vmm/vmm_cpuid.c b/sys/amd64/vmm/vmm_cpuid.c --- a/sys/amd64/vmm/vmm_cpuid.c +++ b/sys/amd64/vmm/vmm_cpuid.c @@ -28,7 +28,7 @@ /* * Copyright 2014 Pluribus Networks Inc. * Copyright 2018 Joyent, Inc. - * Copyright 2022 Oxide Computer Company + * Copyright 2024 Oxide Computer Company */ #include @@ -543,7 +543,7 @@ goto default_leaf; /* - * Similar to Intel, generate a ficticious cache + * Similar to Intel, generate a fictitious cache * topology for the guest with L3 shared by the * package, and L1 and L2 local to a core. */ @@ -572,10 +572,15 @@ break; } - logical_cpus = MIN(0xfff, logical_cpus - 1); - regs[0] = (logical_cpus << 14) | (1 << 8) | - (level << 5) | func; - regs[1] = func > 0 ? CACHE_LINE_SIZE - 1 : 0; + if (level == 0) { + regs[0] = 0; + regs[1] = 0; + } else { + logical_cpus = MIN(0xfff, logical_cpus - 1); + regs[0] = (logical_cpus << 14) | (1 << 8) | + (level << 5) | func; + regs[1] = func > 0 ? CACHE_LINE_SIZE - 1 : 0; + } /* * ecx: Number of cache ways for non-fully