KVM: selftests: Overhaul Part II - CPUID
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest42 patches 0 repliesNew
- v142 patches 0 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/42 | KVM: selftests: Set KVM's supported CPUID as vCPU's CPUID during recreatetools/ tools/ tools/ +4 more | +26 | 0 replies | |
| 2/42 | KVM: sefltests: Use CPUID_XSAVE and CPUID_OSXAVE instead of X86_FEATURE_*tools/ tools/ tools/ +1 more | +10 | 0 replies | |
| 3/42 | KVM: selftests: Add framework to query KVM CPUID bitstools/ tools/ tools/ | +128 | 0 replies | |
| 4/42 | KVM: selftests: Use kvm_cpu_has() in the SEV migration testtools/ tools/ | +4 | 0 replies | |
| 5/42 | KVM: selftests: Use kvm_cpu_has() for nested SVM checkstools/ tools/ tools/ +5 more | +6 | 0 replies | |
| 6/42 | KVM: selftests: Use kvm_cpu_has() for nested VMX checkstools/ tools/ tools/ +13 more | +15 | 0 replies | |
| 7/42 | KVM: selftests: Use kvm_cpu_has() to query PDCM in PMU selftesttools/ tools/ | +3 | 0 replies | |
| 8/42 | KVM: selftests: Drop redundant vcpu_set_cpuid() from PMU selftesttools/ | +0 | 0 replies | |
| 9/42 | KVM: selftests: Use kvm_cpu_has() for XSAVES in XSS MSR testtools/ tools/ | +2 | 0 replies | |
| 10/42 | KVM: selftests: Check for _both_ XTILE data and cfg in AMX testtools/ | +2 | 0 replies | |
| 11/42 | KVM: selftests: Use kvm_cpu_has() in AMX testtools/ tools/ | +9 | 0 replies | |
| 12/42 | KVM: selftests: Use kvm_cpu_has() for XSAVE in cr4_cpuid_sync_testtools/ | +1 | 0 replies | |
| 13/42 | KVM: selftests: Remove the obsolete/dead MMU role testtools/ tools/ tools/ +1 more | +0 | 0 replies | |
| 14/42 | KVM: selftests: Use kvm_cpu_has() for KVM's PV steal timetools/ tools/ | +23 | 0 replies | |
| 15/42 | KVM: selftests: Use kvm_cpu_has() for nSVM soft INT injection testtools/ tools/ | +2 | 0 replies | |
| 16/42 | KVM: selftests: Verify that kvm_cpuid2.entries layout is unchanged by KVMtools/ | +23 | 0 replies | |
| 17/42 | KVM: selftests: Split out kvm_cpuid2_size() from allocate_kvm_cpuid2()tools/ tools/ | +30 | 0 replies | |
| 18/42 | KVM: selftests: Cache CPUID in struct kvm_vcputools/ tools/ tools/ +7 more | +68 | 0 replies | |
| 19/42 | KVM: selftests: Don't use a static local in vcpu_get_supported_hv_cpuid()tools/ | +1 | 0 replies | |
| 20/42 | KVM: selftests: Rename and tweak get_cpuid() to get_cpuid_entry()tools/ tools/ tools/ | +9 | 0 replies | |
| 21/42 | KVM: selftests: Use get_cpuid_entry() in kvm_get_supported_cpuid_index()tools/ tools/ | +7 | 0 replies | |
| 22/42 | KVM: selftests: Add helpers to get and modify a vCPU's CPUID entriestools/ tools/ | +48 | 0 replies | |
| 23/42 | KVM: selftests: Use vm->pa_bits to generate reserved PA bitstools/ | +2 | 0 replies | |
| 24/42 | KVM: selftests: Add and use helper to set vCPU's CPUID maxphyaddrtools/ tools/ tools/ | +11 | 0 replies | |
| 25/42 | KVM: selftests: Use vcpu_get_cpuid_entry() in PV features test (sort of)tools/ tools/ tools/ | +13 | 0 replies | |
| 26/42 | KVM: selftests: Use vCPU's CPUID directly in Hyper-V testtools/ tools/ tools/ | +64 | 0 replies | |
| 27/42 | KVM: selftests: Use vcpu_get_cpuid_entry() in CPUID testtools/ | +2 | 0 replies | |
| 28/42 | KVM: selftests: Use vcpu_{set,clear}_cpuid_feature() in nVMX state testtools/ tools/ | +2 | 0 replies | |
| 29/42 | KVM: selftests: Use vcpu_clear_cpuid_feature() to clear x2APICtools/ tools/ | +2 | 0 replies | |
| 30/42 | KVM: selftests: Make get_supported_cpuid() returns "const"tools/ tools/ tools/ +3 more | +36 | 0 replies | |
| 31/42 | KVM: selftests: Set input function/index in raw CPUID helper(s)tools/ tools/ tools/ +1 more | +26 | 0 replies | |
| 32/42 | KVM: selftests: Add this_cpu_has() to query X86_FEATURE_* via cpuid()tools/ tools/ | +13 | 0 replies | |
| 33/42 | KVM: selftests: Use this_cpu_has() in CR4/CPUID sync testtools/ tools/ | +2 | 0 replies | |
| 34/42 | KVM: selftests: Use this_cpu_has() to detect SVM support in L1tools/ tools/ tools/ | +3 | 0 replies | |
| 35/42 | KVM: selftests: Drop unnecessary use of kvm_get_supported_cpuid_index()tools/ tools/ tools/ | +4 | 0 replies | |
| 36/42 | KVM: selftests: Rename kvm_get_supported_cpuid_index() to __..._entry()tools/ | +3 | 0 replies | |
| 37/42 | KVM: selftests: Inline "get max CPUID leaf" helperstools/ tools/ | +9 | 0 replies | |
| 38/42 | KVM: selftests: Check KVM's supported CPUID, not host CPUID, for XFDtools/ tools/ | +3 | 0 replies | |
| 39/42 | KVM: selftests: Skip AMX test if ARCH_REQ_XCOMP_GUEST_PERM isn't supportedtools/ | +1 | 0 replies | |
| 40/42 | KVM: selftests: Clean up requirements for XFD-aware XSAVE featurestools/ tools/ tools/ | +10 | 0 replies | |
| 41/42 | KVM: selftests: Use the common cpuid() helper in cpu_vendor_string_is()tools/ | +2 | 0 replies | |
| 42/42 | KVM: selftests: Drop unused SVM_CPUID_FUNC macrotools/ | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/42] KVM: selftests: Overhaul Part II - CPUID
Rework (x86) KVM selftests' handling of CPUID to track CPUID on a per-vCPU basis, and add X86_FEATURE_* / CPUID support in the style of KVM-Unit-Tests, e.g. add kvm_cpu_has(), vcpu_{clear,set}_cpuid_feature(), this_cpu_has(), etc...
The two main goals are to simplify checking or modifying CPUID-based features, and to eliminate the absolutely awful behavior of modifying the global "cpuid" that is cached by kvm_get_supported_cpuid().
Build tested on all architectures, all tests except AMX run on x86 (SEV INIT_EX wasn't broken, PEBKAC).
v2: Rebased to kvm/queue.
v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (42):
KVM: selftests: Set KVM's supported CPUID as vCPU's CPUID during
recreate
KVM: sefltests: Use CPUID_XSAVE and CPUID_OSXAVE instead of
X86_FEATURE_*
KVM: selftests: Add framework to query KVM CPUID bits
KVM: selftests: Use kvm_cpu_has() in the SEV migration test
KVM: selftests: Use kvm_cpu_has() for nested SVM checks
KVM: selftests: Use kvm_cpu_has() for nested VMX checks
KVM: selftests: Use kvm_cpu_has() to query PDCM in PMU selftest
KVM: selftests: Drop redundant vcpu_set_cpuid() from PMU selftest
KVM: selftests: Use kvm_cpu_has() for XSAVES in XSS MSR test
KVM: selftests: Check for _both_ XTILE data and cfg in AMX test
KVM: selftests: Use kvm_cpu_has() in AMX test
KVM: selftests: Use kvm_cpu_has() for XSAVE in cr4_cpuid_sync_test
KVM: selftests: Remove the obsolete/dead MMU role test
KVM: selftests: Use kvm_cpu_has() for KVM's PV steal time
KVM: selftests: Use kvm_cpu_has() for nSVM soft INT injection test
KVM: selftests: Verify that kvm_cpuid2.entries layout is unchanged by
KVM
KVM: selftests: Split out kvm_cpuid2_size() from allocate_kvm_cpuid2()
KVM: selftests: Cache CPUID in struct kvm_vcpu
KVM: selftests: Don't use a static local in
vcpu_get_supported_hv_cpuid()
KVM: selftests: Rename and tweak get_cpuid() to get_cpuid_entry()
KVM: selftests: Use get_cpuid_entry() in
kvm_get_supported_cpuid_index()
KVM: selftests: Add helpers to get and modify a vCPU's CPUID entries
KVM: selftests: Use vm->pa_bits to generate reserved PA bits
KVM: selftests: Add and use helper to set vCPU's CPUID maxphyaddr
KVM: selftests: Use vcpu_get_cpuid_entry() in PV features test (sort
of)
KVM: selftests: Use vCPU's CPUID directly in Hyper-V test
KVM: selftests: Use vcpu_get_cpuid_entry() in CPUID test
KVM: selftests: Use vcpu_{set,clear}_cpuid_feature() in nVMX state
test
KVM: selftests: Use vcpu_clear_cpuid_feature() to clear x2APIC
KVM: selftests: Make get_supported_cpuid() returns "const"
KVM: selftests: Set input function/index in raw CPUID helper(s)
KVM: selftests: Add this_cpu_has() to query X86_FEATURE_* via cpuid()
KVM: selftests: Use this_cpu_has() in CR4/CPUID sync test
KVM: selftests: Use this_cpu_has() to detect SVM support in L1
KVM: selftests: Drop unnecessary use of
kvm_get_supported_cpuid_index()
KVM: selftests: Rename kvm_get_supported_cpuid_index() to
__..._entry() KVM: selftests: Inline "get max CPUID leaf" helpers
KVM: selftests: Check KVM's supported CPUID, not host CPUID, for XFD
KVM: selftests: Skip AMX test if ARCH_REQ_XCOMP_GUEST_PERM isn't
supported
KVM: selftests: Clean up requirements for XFD-aware XSAVE features
KVM: selftests: Use the common cpuid() helper in
cpu_vendor_string_is()
KVM: selftests: Drop unused SVM_CPUID_FUNC macro
tools/testing/selftests/kvm/.gitignore | 1 - tools/testing/selftests/kvm/Makefile | 1 - .../selftests/kvm/include/kvm_util_base.h | 14 + .../selftests/kvm/include/x86_64/processor.h | 297 +++++++++++++++--- .../selftests/kvm/include/x86_64/svm.h | 2 - .../selftests/kvm/include/x86_64/svm_util.h | 15 - .../selftests/kvm/include/x86_64/vmx.h | 2 - tools/testing/selftests/kvm/lib/kvm_util.c | 17 +- .../selftests/kvm/lib/x86_64/perf_test_util.c | 2 +- .../selftests/kvm/lib/x86_64/processor.c | 289 +++++++---------- tools/testing/selftests/kvm/lib/x86_64/svm.c | 13 - tools/testing/selftests/kvm/lib/x86_64/vmx.c | 12 - tools/testing/selftests/kvm/steal_time.c | 4 +- tools/testing/selftests/kvm/x86_64/amx_test.c | 48 +-- .../testing/selftests/kvm/x86_64/cpuid_test.c | 89 +++--- .../kvm/x86_64/cr4_cpuid_sync_test.c | 21 +- .../kvm/x86_64/emulator_error_test.c | 10 +- .../testing/selftests/kvm/x86_64/evmcs_test.c | 2 +- .../selftests/kvm/x86_64/hyperv_cpuid.c | 14 +- .../selftests/kvm/x86_64/hyperv_features.c | 126 ++++---- .../selftests/kvm/x86_64/hyperv_svm_test.c | 2 +- .../selftests/kvm/x86_64/kvm_pv_test.c | 14 +- .../selftests/kvm/x86_64/mmu_role_test.c | 137 -------- .../kvm/x86_64/pmu_event_filter_test.c | 14 +- .../selftests/kvm/x86_64/set_sregs_test.c | 28 +- .../selftests/kvm/x86_64/sev_migrate_tests.c | 13 +- tools/testing/selftests/kvm/x86_64/smm_test.c | 9 +- .../testing/selftests/kvm/x86_64/state_test.c | 7 +- .../selftests/kvm/x86_64/svm_int_ctl_test.c | 2 +- .../kvm/x86_64/svm_nested_soft_inject_test.c | 10 +- .../selftests/kvm/x86_64/svm_vmcall_test.c | 2 +- .../kvm/x86_64/triple_fault_event_test.c | 2 +- .../kvm/x86_64/vmx_apic_access_test.c | 2 +- .../kvm/x86_64/vmx_close_while_nested_test.c | 2 +- .../selftests/kvm/x86_64/vmx_dirty_log_test.c | 2 +- .../x86_64/vmx_invalid_nested_guest_state.c | 2 +- .../kvm/x86_64/vmx_nested_tsc_scaling_test.c | 2 +- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 14 +- .../kvm/x86_64/vmx_preemption_timer_test.c | 4 +- .../kvm/x86_64/vmx_set_nested_state_test.c | 22 +- .../kvm/x86_64/vmx_tsc_adjust_test.c | 2 +- .../selftests/kvm/x86_64/xapic_state_test.c | 10 +- .../selftests/kvm/x86_64/xss_msr_test.c | 8 +- 43 files changed, 562 insertions(+), 727 deletions(-) delete mode 100644 tools/testing/selftests/kvm/x86_64/mmu_role_test.c
base-commit: 8baacf67c76c560fed954ac972b63e6e59a6fba0
Signature · 1 line
2.36.1.476.g0c4daa206d-goog