Skip to contentSkip to conversation

kvm: selftests: Add KVM_CAP_MAX_VCPU_ID cap test

PATCH Superseded Zeng Guang 1 participant 1 message Apr 22, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Zeng Guang

author
#0 lore raw

PATCH 1/1 kvm: selftests: Add KVM_CAP_MAX_VCPU_ID cap test

Basic test coverage of KVM_CAP_MAX_VCPU_ID cap.

This capability can be enabled before vCPU creation and only allowed to set once. if assigned vcpu id is beyond KVM_CAP_MAX_VCPU_ID capability, vCPU creation will fail.

---
This patch appends the test case to verify the KVM_CAP_MAX_VCPU_ID cap enabling mechanism introduced in IPI virtualization enabling patch.
https://lore.kernel.org/lkml/[email protected]/

 tools/testing/selftests/kvm/.gitignore        |  1 +
 tools/testing/selftests/kvm/Makefile          |  1 +
 .../kvm/x86_64/max_vcpuid_cap_test.c          | 60 +++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86_64/max_vcpuid_cap_test.c
tools/testing/selftests/kvm/.gitignore +1 -0
index d1e8f5237469..b860dcfee920 100644
@@ -22,6 +22,7 @@
 /x86_64/hyperv_cpuid
 /x86_64/hyperv_features
 /x86_64/hyperv_svm_test
+/x86_64/max_vcpuid_cap_test
 /x86_64/mmio_warning_test
 /x86_64/mmu_role_test
 /x86_64/platform_info_test
tools/testing/selftests/kvm/Makefile +1 -0
index 21c2dbd21a81..e92dc78de4d0 100644
@@ -86,6 +86,7 @@ TEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test
 TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
 TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
 TEST_GEN_PROGS_x86_64 += x86_64/amx_test
+TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
 TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
 TEST_GEN_PROGS_x86_64 += demand_paging_test
 TEST_GEN_PROGS_x86_64 += dirty_log_test
tools/testing/selftests/kvm/x86_64/max_vcpuid_cap_test.c new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.27.0