amd64/vmm: Don't advertise AMD PerfMonV2 or performance counters

vmm does not handle CPUID leaf 0x80000022, so a FreeBSD guest on a
Family 19h or later host panics on "kldload hwpmc", which trusts the
PerfMonV2 bit and writes AMD_PMC_GLOBAL_CTL.

Tested by:	Osvaldo Janeri Filho <[email protected]>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj, kib
Differential Revision:	https://reviews.freebsd.org/D61141
This commit is contained in:
Christos Margiolis committed 2026-11-06 16:57:18 +01:00
1 parent 0efaebd5ab
commit 8fb539b081
2 files changed
+12

No files matched your search

+11
View File
@@ -299,6 +299,17 @@ x86_emulate_cpuid(struct vcpu *vcpu, uint64_t *rax, uint64_t *rbx,
regs[3] = 0; regs[3] = 0;
break; break;
case CPUID_8000_0022:
/*
* AMD uses this leaf to advertise performance
* counters and PerfMonV2. vmm implements neither.
*/
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
regs[3] = 0;
break;
case CPUID_0000_0001: case CPUID_0000_0001:
do_cpuid(1, regs); do_cpuid(1, regs);
+1
View File
@@ -53,6 +53,7 @@
#define CPUID_8000_0008 (0x80000008) #define CPUID_8000_0008 (0x80000008)
#define CPUID_8000_001D (0x8000001D) #define CPUID_8000_001D (0x8000001D)
#define CPUID_8000_001E (0x8000001E) #define CPUID_8000_001E (0x8000001E)
#define CPUID_8000_0022 (0x80000022)
/* /*
* CPUID instruction Fn0000_0001: * CPUID instruction Fn0000_0001: