Re: [PATCH v7 00/17] KVM: x86/pmu: Add support for AMD Host-Only/Guest-Only bits

From: Sean Christopherson

Date: Fri May 29 2026 - 18:51:15 EST


On Wed, 27 May 2026 23:46:54 +0000, Yosry Ahmed wrote:
> v7 of Jim and myself's series adding support for AMD's Host-Only and
> Guest-Only performance counter eventsel bits in KVM's mediated PMU
> passthrough implementation. The series keeps growing in size over
> versions. This is Sean's fault (as usual), as he keeps finding subtle
> problems and making excellent suggestions.
>
> These bits allow an nSVM-enabled guest to configure performance counters
> that count only during L1 execution (Host-Only) or only during L2 execution
> (Guest-Only).
>
> [...]

Applied the KVM changes to kvm-x86 svm. Please yell at me if you haven't seen
new versions of the selftests after the 7.2 merge window has opened (assuming
Paolo and I are somewhat on top of things and actually get the KVM x86 pull
requests merged _before_ Linus opens the window).

[01/17] KVM: nSVM: Stop leaking single-stepping on VMRUN into L2
https://github.com/kvm-x86/linux/commit/8862376260c4
[02/17] KVM: nSVM: Bail early out of VMRUN emulation if advancing RIP fails
https://github.com/kvm-x86/linux/commit/42ff88db18a5
[03/17] KVM: nSVM: Unify RIP and PMU handling calls when emulating VMRUN
https://github.com/kvm-x86/linux/commit/0a35c2a051f3
[04/17] KVM: nSVM: Move VMRUN instruction retirement after entering guest mode
https://github.com/kvm-x86/linux/commit/9be579d22651
[05/17] KVM: x86: Move enable_pmu/enable_mediated_pmu to pmu.h and pmu.c
https://github.com/kvm-x86/linux/commit/277eb65b6cc3
[06/17] KVM: x86/pmu: Rename reprogram_counters() to clarify usage
https://github.com/kvm-x86/linux/commit/103cd7deda58
[07/17] KVM: x86/pmu: Do a single atomic OR when reprogramming counters
https://github.com/kvm-x86/linux/commit/e48810e06f45
[08/17] KVM: x86/pmu: Check mediated PMU counter enablement before event filters
https://github.com/kvm-x86/linux/commit/232eadc3110b
[09/17] KVM: x86/pmu: Add support for KVM_X86_PMU_OP_OPTIONAL_RET0
https://github.com/kvm-x86/linux/commit/f98ef41a5af4
[10/17] KVM: x86/pmu: Disable counters based on Host-Only/Guest-Only bits in SVM
https://github.com/kvm-x86/linux/commit/2ed72677a5c1
[11/17] KVM: x86/pmu: Track mediated PMU counters with mode-specific enables
https://github.com/kvm-x86/linux/commit/c0d4c9c54c25
[12/17] KVM: x86/pmu: Reprogram Host/Guest-Only counters on nested transitions
https://github.com/kvm-x86/linux/commit/a02a25a65246
[13/17] KVM: x86/pmu: Allow Host-Only/Guest-Only bits with nSVM and mediated PMU
https://github.com/kvm-x86/linux/commit/f4805dcf2d21

--
https://github.com/kvm-x86/linux/tree/next