]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Add test to verify KVM_CAP_X86_BUS_LOCK_EXIT
authorNikunj A Dadhania <nikunj@amd.com>
Fri, 2 May 2025 05:03:46 +0000 (05:03 +0000)
committerSean Christopherson <seanjc@google.com>
Mon, 19 May 2025 18:05:19 +0000 (11:05 -0700)
commit72df72e1c6ddfb6e0c2bce174d5879bc095540c8
tree4f4623ef338419873b62a05099543cab09622505
parent89f9edf4c69ddd345b07be414e6a99ace0757ff5
KVM: selftests: Add test to verify KVM_CAP_X86_BUS_LOCK_EXIT

Add a test case to verify x86's bus lock exit functionality, which is now
supported on both Intel and AMD.  Trigger bus lock exits by performing a
split-lock access, i.e. an atomic access that splits two cache lines.

Verify that the correct number of bus lock exits are generated, and that
the counter is incremented correctly and at the appropriate time based on
the underlying architecture.

Generate bus locks in both L1 and L2 (if nested virtualization is enabled),
as SVM's functionality in particular requires non-trivial logic to do the
right thing when running nested VMs.

Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Co-developed-by: Manali Shukla <manali.shukla@amd.com>
Signed-off-by: Manali Shukla <manali.shukla@amd.com>
Link: https://lore.kernel.org/r/20250502050346.14274-6-manali.shukla@amd.com
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/x86/kvm_buslock_test.c [new file with mode: 0644]