Re: [GIT PULL] KVM: Early selftests changes for 7.3

From: Paolo Bonzini

Date: Wed Jun 24 2026 - 12:32:15 EST


On Wed, Jun 24, 2026 at 5:56 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> If it's possible to get this into to kvm/next before you disappear on holiday,
> please pull a set of selftest changes that (lightly) touch all x86 tests that
> use nested virtualization in any way.
>
> If it's too late to get this into kvm/next, I'd say just ignore this pull
> request and I'll include them in the normal 7.3 selftests pull requests. I
> don't think there will be any cross-branch conflicts to juggle? But I've had
> these sitting in -next for a few weeks now, and getting them into kvm/next
> "now" would all but guarantee I won't end up having to play weird games with
> selftests patches.
>
> Thanks!

Sure; placed on kvm/queue for now as well, I'm building a kernel to
test the rest.

Paolo

> The following changes since commit ef057cbf825e03b63f6edf5980f96abf3c53089d:
>
> KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level (2026-06-16 00:39:57 +0200)
>
> are available in the Git repository at:
>
> https://github.com/kvm-x86/linux.git tags/kvm-x86-selftests_l2_stacks-7.3
>
> for you to fetch changes up to 70f4701c12e4bb6214f0ec762f928e96ff3dacc3:
>
> KVM: selftests: Add svm_pmu_host_guest_test for Host-Only/Guest-Only bits (2026-06-17 17:56:17 -0700)
>
> ----------------------------------------------------------------
> KVM selftests for 7.3, early edition
>
> - Automatically allocate a full page for L2 guest stacks on x86 instead of
> requiring test-specific L1 guest code to carve out a portion of the L1
> stack for L2 usage, and to ensure the L2 stack also adheres to the x86-64
> calling convention ABI.
>
> - Add a selftest to verify {Guest,Host}-Only behavior in x86's mediated PMU.
>
> ----------------------------------------------------------------
> Jim Mattson (1):
> KVM: selftests: Add svm_pmu_host_guest_test for Host-Only/Guest-Only bits
>
> Sean Christopherson (1):
> KVM: selftests: Add a helper to query enable_mediated_pmu module param
>
> Yosry Ahmed (3):
> KVM: selftests: Refactor allocating guest stack into a helper
> KVM: selftests: Allocate a dedicated guest page for x86 L2 guest stack
> KVM: selftests: Drop L1-provided stacks for L2 guests on x86
>
> tools/testing/selftests/kvm/Makefile.kvm | 1 +
> tools/testing/selftests/kvm/include/x86/pmu.h | 6 +++
> tools/testing/selftests/kvm/include/x86/processor.h | 10 +++++
> tools/testing/selftests/kvm/include/x86/svm_util.h | 5 ++-
> tools/testing/selftests/kvm/include/x86/vmx.h | 4 +-
> tools/testing/selftests/kvm/lib/x86/memstress.c | 19 ++-------
> tools/testing/selftests/kvm/lib/x86/processor.c | 45 +++++++++++----------
> tools/testing/selftests/kvm/lib/x86/svm.c | 6 ++-
> tools/testing/selftests/kvm/lib/x86/vmx.c | 6 ++-
> tools/testing/selftests/kvm/x86/aperfmperf_test.c | 9 +----
> tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c | 5 +--
> tools/testing/selftests/kvm/x86/hyperv_evmcs.c | 6 +--
> tools/testing/selftests/kvm/x86/hyperv_svm_test.c | 6 +--
> tools/testing/selftests/kvm/x86/kvm_buslock_test.c | 9 +----
> tools/testing/selftests/kvm/x86/nested_close_kvm_test.c | 12 +-----
> tools/testing/selftests/kvm/x86/nested_dirty_log_test.c | 8 +---
> tools/testing/selftests/kvm/x86/nested_emulation_test.c | 4 +-
> tools/testing/selftests/kvm/x86/nested_exceptions_test.c | 9 +----
> tools/testing/selftests/kvm/x86/nested_invalid_cr3_test.c | 10 +----
> tools/testing/selftests/kvm/x86/nested_tdp_fault_test.c | 9 +----
> tools/testing/selftests/kvm/x86/nested_tsc_adjust_test.c | 10 +----
> tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c | 10 +----
> tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c | 6 +--
> tools/testing/selftests/kvm/x86/smm_test.c | 8 +---
> tools/testing/selftests/kvm/x86/state_test.c | 11 +-----
> tools/testing/selftests/kvm/x86/svm_int_ctl_test.c | 5 +--
> tools/testing/selftests/kvm/x86/svm_lbr_nested_state.c | 6 +--
> tools/testing/selftests/kvm/x86/svm_nested_clear_efer_svme.c | 7 +---
> tools/testing/selftests/kvm/x86/svm_nested_pat_test.c | 8 +---
> tools/testing/selftests/kvm/x86/svm_nested_shutdown_test.c | 5 +--
> tools/testing/selftests/kvm/x86/svm_nested_soft_inject_test.c | 6 +--
> tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c | 13 ++----
> tools/testing/selftests/kvm/x86/svm_pmu_host_guest_test.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> tools/testing/selftests/kvm/x86/svm_vmcall_test.c | 5 +--
> tools/testing/selftests/kvm/x86/triple_fault_event_test.c | 9 +----
> tools/testing/selftests/kvm/x86/vmx_apic_access_test.c | 5 +--
> tools/testing/selftests/kvm/x86/vmx_apicv_updates_test.c | 4 +-
> tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c | 6 +--
> tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c | 5 +--
> tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c | 5 +--
> 40 files changed, 323 insertions(+), 215 deletions(-)
> create mode 100644 tools/testing/selftests/kvm/x86/svm_pmu_host_guest_test.c
>