mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
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:
1 parent
0efaebd5ab
commit
8fb539b081
2 files changed
+12
No files matched your search
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in new issue
Block a user