diff options
| author | Xiaoyao Li <[email protected]> | 2025-03-04 08:23:14 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2025-03-04 17:19:18 +0000 |
| commit | f9dc8fb3afc968042bdaf4b6e445a9272071c9f3 (patch) | |
| tree | 135edbb6be008b3897ee61de1618e3d3e6c68884 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | KVM: selftests: Fix printf() format goof in SEV smoke test (diff) | |
| download | kernel-f9dc8fb3afc968042bdaf4b6e445a9272071c9f3.tar.gz kernel-f9dc8fb3afc968042bdaf4b6e445a9272071c9f3.zip | |
KVM: x86: Explicitly zero EAX and EBX when PERFMON_V2 isn't supported by KVM
Fix a goof where KVM sets CPUID.0x80000022.EAX to CPUID.0x80000022.EBX
instead of zeroing both when PERFMON_V2 isn't supported by KVM. In
practice, barring a buggy CPU (or vCPU model when running nested) only the
!enable_pmu case is affected, as KVM always supports PERFMON_V2 if it's
available in hardware, i.e. CPUID.0x80000022.EBX will be '0' if PERFMON_V2
is unsupported.
For the !enable_pmu case, the bug is relatively benign as KVM will refuse
to enable PMU capabilities, but a VMM that reflects KVM's supported CPUID
into the guest could inadvertently induce #GPs in the guest due to
advertising support for MSRs that KVM refuses to emulate.
Fixes: 94cdeebd8211 ("KVM: x86/cpuid: Add AMD CPUID ExtPerfMonAndDbg leaf 0x80000022")
Signed-off-by: Xiaoyao Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[sean: massage shortlog and changelog, tag for stable]
Cc: [email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions
