[GIT PULL] KVM: x86: SVM changes for 7.2

From: Sean Christopherson

Date: Thu Jun 11 2026 - 20:51:09 EST


Nested SVM is again the main theme this cycle. I think this is the last of the
changes? Barring one-offs that will inevitably meander in.

Note, there's no new capability or anything to enumerate support for Host-Only
and Guest-Only PMC support, which is sketchy, but I think is fine? Because
AFAICT, there's no way for hardware to communicate support, i.e. software just
has to assume it's there.

The following changes since commit b7fbe9a1bf9ee6c967ef77d366ca58c35fcf1887:

Merge branch 'kvm-apx-prepare' into HEAD (2026-05-13 12:38:31 -0400)

are available in the Git repository at:

https://github.com/kvm-x86/linux.git tags/kvm-x86-svm-7.2

for you to fetch changes up to adeb462cecae964ae4525512e31d54e545539476:

KVM: selftests: Add a test for gPAT handling in L2 (2026-06-03 05:42:35 -0700)

----------------------------------------------------------------
KVM SVN changes for 7.2

- Add support for virtualizing gPAT (KVM previously just used L1's PAT when
running L2).

- Fix goofs where KVM mishandles side effects (e.g. single-step and PMC
updates) when emulating VMRUN.

- Fix a variety of bugs in AVIC's handling of x2APIC MSR interception, most
notably where KVM didn't disable interception of IRR, ISR, and TMR regs.

- Add support for virtualizing Host-Only/Guest-Only bits in the mediated PMU.

----------------------------------------------------------------
Jim Mattson (9):
KVM: x86: Define KVM_X86_QUIRK_NESTED_SVM_SHARED_PAT
KVM: x86: nSVM: Clear VMCB_NPT clean bit when updating hPAT from guest mode
KVM: x86: nSVM: Cache and validate vmcb12 g_pat
KVM: x86: nSVM: Set vmcb02.g_pat correctly for nested NPT
KVM: x86: nSVM: Redirect IA32_PAT accesses to either hPAT or gPAT
KVM: x86: nSVM: Save gPAT to vmcb12.g_pat on VMEXIT
KVM: Documentation: document KVM_{GET,SET}_NESTED_STATE for SVM
KVM: x86: nSVM: Save/restore gPAT with KVM_{GET,SET}_NESTED_STATE
KVM: x86/pmu: Allow Host-Only/Guest-Only bits with nSVM and mediated PMU

Sean Christopherson (3):
KVM: x86: Add dedicated API for getting mask of accelerated x2APIC MSRs
KVM: SVM: Disable x2AVIC RDMSR interception for MSRs KVM actually supports
KVM: SVM: Only disable x2AVIC WRMSR interception for MSRs that are accelerated

Yosry Ahmed (13):
KVM: nSVM: Stop leaking single-stepping on VMRUN into L2
KVM: nSVM: Bail early out of VMRUN emulation if advancing RIP fails
KVM: nSVM: Unify RIP and PMU handling calls when emulating VMRUN
KVM: nSVM: Move VMRUN instruction retirement after entering guest mode
KVM: x86: Move enable_pmu/enable_mediated_pmu to pmu.h and pmu.c
KVM: x86/pmu: Rename reprogram_counters() to clarify usage
KVM: x86/pmu: Do a single atomic OR when reprogramming counters
KVM: x86/pmu: Check mediated PMU counter enablement before event filters
KVM: x86/pmu: Add support for KVM_X86_PMU_OP_OPTIONAL_RET0
KVM: x86/pmu: Disable counters based on Host-Only/Guest-Only bits in SVM
KVM: x86/pmu: Track mediated PMU counters with mode-specific enables
KVM: x86/pmu: Reprogram Host/Guest-Only counters on nested transitions
KVM: selftests: Add a test for gPAT handling in L2

Documentation/virt/kvm/api.rst | 26 +++
arch/x86/include/asm/kvm-x86-pmu-ops.h | 5 +-
arch/x86/include/asm/kvm_host.h | 6 +-
arch/x86/include/asm/perf_event.h | 2 +
arch/x86/include/uapi/asm/kvm.h | 2 +
arch/x86/kvm/lapic.c | 21 ++-
arch/x86/kvm/lapic.h | 2 +-
arch/x86/kvm/pmu.c | 21 ++-
arch/x86/kvm/pmu.h | 44 ++++-
arch/x86/kvm/svm/avic.c | 47 ++---
arch/x86/kvm/svm/nested.c | 107 ++++++++---
arch/x86/kvm/svm/pmu.c | 42 +++++
arch/x86/kvm/svm/svm.c | 40 ++++-
arch/x86/kvm/svm/svm.h | 44 ++++-
arch/x86/kvm/vmx/pmu_intel.c | 2 +-
arch/x86/kvm/vmx/vmx.c | 3 +-
arch/x86/kvm/x86.c | 9 -
arch/x86/kvm/x86.h | 3 -
tools/testing/selftests/kvm/Makefile.kvm | 1 +
.../selftests/kvm/x86/svm_nested_pat_test.c | 196 +++++++++++++++++++++
20 files changed, 525 insertions(+), 98 deletions(-)
create mode 100644 tools/testing/selftests/kvm/x86/svm_nested_pat_test.c