]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86/pmu: Disallow emulation in the fastpath if mediated PMCs are active
authorSean Christopherson <seanjc@google.com>
Sat, 6 Dec 2025 00:17:04 +0000 (16:17 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 8 Jan 2026 19:52:12 +0000 (11:52 -0800)
commitf7a65e58d64340c3c0e390ea4e1c4857cd451f1f
tree1941cc4e5d67eaf011b18e05b3b9988585789e89
parent56bb2736975068cc03648718bb8e50a456ce7173
KVM: x86/pmu: Disallow emulation in the fastpath if mediated PMCs are active

Don't handle exits in the fastpath if emulation is required, i.e. if an
instruction needs to be skipped, the mediated PMU is enabled, and one or
more PMCs is counting instructions.  With the mediated PMU, KVM's cache of
PMU state is inconsistent with respect to hardware until KVM exits the
inner run loop (when the mediated PMU is "put").

Reviewed-by: Sandipan Das <sandipan.das@amd.com>
Tested-by: Xudong Hao <xudong.hao@intel.com>
Tested-by: Manali Shukla <manali.shukla@amd.com>
Link: https://patch.msgid.link/20251206001720.468579-29-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/pmu.h
arch/x86/kvm/x86.c