linux/tools/testing/selftests/kvm/x86
David Woodhouse f148dd411d KVM: selftests: sev_init2_tests: Derive SEV availability from KVM
The test asserted that the X86_FEATURE_SEV CPUID bit exactly matches
whether KVM offers KVM_X86_SEV_VM.  That is not an invariant: when all
SEV ASIDs are assigned to SEV-SNP, KVM does not offer the SEV VM type
even though CPUID reports SEV, so the test aborts on an SNP-only host.

Derive SEV availability from KVM_CAP_VM_TYPES (as already done for SEV-ES
and SNP), assert only the one-way implication that a type offered by KVM
is also reported in CPUID, and TEST_REQUIRE() the SEV VM type so the test
skips cleanly when it is unavailable.

Reviewed-by: Tycho Andersen (AMD) <tycho@kernel.org>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-ID: <5d3c345113748f39b7982e365d241abaf3e11086.1784545391.git.dwmw@amazon.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-07-21 12:25:27 +02:00
..
amx_test.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
aperfmperf_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
apic_bus_clock_test.c KVM: selftests: Verify that KVM returns the configured APIC cycle length 2026-05-23 10:07:40 +02:00
cpuid_test.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
cr4_cpuid_sync_test.c
debug_regs.c KVM: selftests: Verify VMX's GUEST_PENDING_DBG_EXCEPTIONS.BS Consistency Check 2026-05-21 14:40:25 -07:00
dirty_log_page_splitting_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
evmcs_smm_controls_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
exit_on_emulation_failure_test.c
fastops_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
feature_msrs_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
fix_hypercall_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
flds_emulation.h KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
hwcr_msr_test.c KVM: selftests: Update hwcr_msr_test for CPUID faulting bit 2026-05-27 11:21:41 -07:00
hyperv_clock.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
hyperv_cpuid.c KVM: selftests: Fix typo in hyperv cpuid test message 2025-09-08 13:03:22 -07:00
hyperv_evmcs.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
hyperv_extended_hypercalls.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
hyperv_features.c KVM: selftests: hyperv_features: test write of 1 to HV_X64_MSR_RESET 2026-05-26 12:30:50 -07:00
hyperv_ipi.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
hyperv_svm_test.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
hyperv_tlb_flush.c KVM: selftests: hyperv_tlb_flush: replace NOP loop with udelay() 2026-05-13 09:54:44 -07:00
kvm_buslock_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
kvm_clock_test.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
kvm_pv_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
max_vcpuid_cap_test.c
monitor_mwait_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
msrs_test.c KVM: selftests: Fix reserved value WRMSR testcase for multi-feature MSRs 2026-03-02 13:18:03 -08:00
nested_close_kvm_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
nested_dirty_log_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
nested_emulation_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
nested_exceptions_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
nested_invalid_cr3_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
nested_set_state_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
nested_tdp_fault_test.c KVM: selftests: Add nested page fault injection test 2026-05-26 14:54:21 -07:00
nested_tsc_adjust_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
nested_tsc_scaling_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
nested_vmsave_vmload_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
nx_huge_pages_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
nx_huge_pages_test.sh
platform_info_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
pmu_counters_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
pmu_event_filter_test.c KVM: selftests: Add regression test for mediated PMU fixed counter filter bug 2026-06-08 09:18:52 -07:00
private_mem_conversions_test.c KVM: selftests: Replace "u64 gpa" with "gpa_t" throughout 2026-04-20 14:54:17 -07:00
private_mem_kvm_exits_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
recalc_apic_map_test.c
set_boot_cpu_id.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
set_sregs_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
sev_dbg_test.c KVM: selftests: Add a test to verify SEV {en,de}crypt debug ioctls 2026-05-13 15:03:16 -07:00
sev_init2_tests.c KVM: selftests: sev_init2_tests: Derive SEV availability from KVM 2026-07-21 12:25:27 +02:00
sev_migrate_tests.c KVM: selftests: Verify SNP VMs are rejected from migration and mirroring 2026-07-10 09:00:21 -07:00
sev_smoke_test.c KVM: selftests: sev_smoke_test: Only run VM types the host offers 2026-07-21 12:25:26 +02:00
smaller_maxphyaddr_emulation_test.c KVM: selftests: Replace "u64 gpa" with "gpa_t" throughout 2026-04-20 14:54:17 -07:00
smm_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
state_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
svm_int_ctl_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
svm_lbr_nested_state.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
svm_nested_clear_efer_svme.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
svm_nested_pat_test.c KVM: selftests: Add a test for gPAT handling in L2 2026-06-03 05:42:35 -07:00
svm_nested_shutdown_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
svm_nested_soft_inject_test.c KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM 2026-04-20 14:54:17 -07:00
svm_nested_vmcb12_gpa.c KVM: selftests: Replace "u64 gpa" with "gpa_t" throughout 2026-04-20 14:54:17 -07:00
svm_vmcall_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
sync_regs_test.c KVM: selftests: sync_regs_test: drop stale TODO comment 2026-05-13 09:54:42 -07:00
triple_fault_event_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
tsc_msrs_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
tsc_scaling_sync.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
ucna_injection_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
userspace_io_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
userspace_msr_exit_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
vmx_apic_access_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
vmx_apicv_updates_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
vmx_exception_with_invalid_guest_state.c KVM: selftests: Verify KVM is loaded when getting a KVM module param 2025-06-20 13:39:10 -07:00
vmx_invalid_nested_guest_state.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
vmx_msrs_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
vmx_nested_la57_state_test.c KVM: selftests: Use gpa_t instead of vm_paddr_t 2026-04-20 14:54:16 -07:00
vmx_pmu_caps_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
vmx_preemption_timer_test.c KVM: selftests: Use gva_t instead of vm_vaddr_t 2026-04-20 14:54:16 -07:00
xapic_ipi_test.c KVM: selftests: Replace "vaddr" with "gva" throughout 2026-04-20 14:54:17 -07:00
xapic_state_test.c KVM: selftests: Use u32 instead of uint32_t 2026-04-20 14:54:16 -07:00
xapic_tpr_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
xcr0_cpuid_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00
xen_shinfo_test.c KVM: selftests: Use u8 instead of uint8_t 2026-04-20 14:54:17 -07:00
xen_vmcall_test.c
xss_msr_test.c KVM: selftests: Use u64 instead of uint64_t 2026-04-20 14:54:16 -07:00