Play nice with treewrite builds of unsupported architectures, e.g. arm (32-bit), as KVM selftests' Makefile doesn't do anything to ensure the target architecture is actually one KVM selftests supports. Patches 2-3 are opportunistic changes (since the above Makefile change will generate conflicts) to switch to using $(ARCH) instead of the target triple for arch specific directories, e.g. arm64 instead of aarch64, mainly so as not to be different from the rest of the kernel. Compile tested on all architectures. My thinking for applying this is to send a v2 just before (or even during) the 6.12 merge window and bribe Paolo into applying it directly, i.e. make this series deal with any conflicts. Sean Christopherson (3): KVM: selftests: Provide empty 'all' and 'clean' targets for unsupported ARCHs KVM: selftests: Use canonical $(ARCH) paths for KVM selftests directories KVM: selftests: Override ARCH for x86_64 instead of using ARCH_DIR MAINTAINERS | 12 +- tools/testing/selftests/kvm/Makefile | 333 +----------------- tools/testing/selftests/kvm/Makefile.kvm | 315 +++++++++++++++++ .../kvm/{aarch64 => arm64}/aarch32_id_regs.c | 0 .../kvm/{aarch64 => arm64}/arch_timer.c | 0 .../kvm/{aarch64 => arm64}/debug-exceptions.c | 0 .../kvm/{aarch64 => arm64}/get-reg-list.c | 0 .../kvm/{aarch64 => arm64}/hypercalls.c | 0 .../kvm/{aarch64 => arm64}/page_fault_test.c | 0 .../kvm/{aarch64 => arm64}/psci_test.c | 0 .../kvm/{aarch64 => arm64}/set_id_regs.c | 0 .../kvm/{aarch64 => arm64}/smccc_filter.c | 0 .../{aarch64 => arm64}/vcpu_width_config.c | 0 .../kvm/{aarch64 => arm64}/vgic_init.c | 0 .../kvm/{aarch64 => arm64}/vgic_irq.c | 0 .../kvm/{aarch64 => arm64}/vgic_lpi_stress.c | 0 .../{aarch64 => arm64}/vpmu_counter_access.c | 0 .../selftests/kvm/dirty_log_perf_test.c | 2 +- .../include/{aarch64 => arm64}/arch_timer.h | 0 .../kvm/include/{aarch64 => arm64}/delay.h | 0 .../kvm/include/{aarch64 => arm64}/gic.h | 0 .../kvm/include/{aarch64 => arm64}/gic_v3.h | 0 .../include/{aarch64 => arm64}/gic_v3_its.h | 0 .../{aarch64 => arm64}/kvm_util_arch.h | 0 .../include/{aarch64 => arm64}/processor.h | 0 .../kvm/include/{aarch64 => arm64}/spinlock.h | 0 .../kvm/include/{aarch64 => arm64}/ucall.h | 0 .../kvm/include/{aarch64 => arm64}/vgic.h | 0 .../{s390x => s390}/diag318_test_handler.h | 0 .../include/{s390x => s390}/kvm_util_arch.h | 0 .../kvm/include/{s390x => s390}/processor.h | 0 .../kvm/include/{s390x => s390}/ucall.h | 0 .../kvm/include/{x86_64 => x86}/apic.h | 0 .../kvm/include/{x86_64 => x86}/evmcs.h | 0 .../kvm/include/{x86_64 => x86}/hyperv.h | 0 .../include/{x86_64 => x86}/kvm_util_arch.h | 0 .../kvm/include/{x86_64 => x86}/mce.h | 0 .../kvm/include/{x86_64 => x86}/pmu.h | 0 .../kvm/include/{x86_64 => x86}/processor.h | 0 .../kvm/include/{x86_64 => x86}/sev.h | 0 .../kvm/include/{x86_64 => x86}/svm.h | 0 .../kvm/include/{x86_64 => x86}/svm_util.h | 0 .../kvm/include/{x86_64 => x86}/ucall.h | 0 .../kvm/include/{x86_64 => x86}/vmx.h | 0 .../kvm/lib/{aarch64 => arm64}/gic.c | 0 .../kvm/lib/{aarch64 => arm64}/gic_private.h | 0 .../kvm/lib/{aarch64 => arm64}/gic_v3.c | 0 .../kvm/lib/{aarch64 => arm64}/gic_v3_its.c | 0 .../kvm/lib/{aarch64 => arm64}/handlers.S | 0 .../kvm/lib/{aarch64 => arm64}/processor.c | 0 .../kvm/lib/{aarch64 => arm64}/spinlock.c | 0 .../kvm/lib/{aarch64 => arm64}/ucall.c | 0 .../kvm/lib/{aarch64 => arm64}/vgic.c | 0 .../{s390x => s390}/diag318_test_handler.c | 0 .../kvm/lib/{s390x => s390}/processor.c | 0 .../selftests/kvm/lib/{s390x => s390}/ucall.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/apic.c | 0 .../kvm/lib/{x86_64 => x86}/handlers.S | 0 .../kvm/lib/{x86_64 => x86}/hyperv.c | 0 .../kvm/lib/{x86_64 => x86}/memstress.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/pmu.c | 0 .../kvm/lib/{x86_64 => x86}/processor.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/sev.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/svm.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/ucall.c | 0 .../selftests/kvm/lib/{x86_64 => x86}/vmx.c | 0 .../selftests/kvm/{s390x => s390}/cmma_test.c | 0 .../kvm/{s390x => s390}/debug_test.c | 0 .../selftests/kvm/{s390x => s390}/memop.c | 0 .../selftests/kvm/{s390x => s390}/resets.c | 0 .../{s390x => s390}/shared_zeropage_test.c | 0 .../kvm/{s390x => s390}/sync_regs_test.c | 0 .../selftests/kvm/{s390x => s390}/tprot.c | 0 .../selftests/kvm/{x86_64 => x86}/amx_test.c | 0 .../kvm/{x86_64 => x86}/apic_bus_clock_test.c | 0 .../kvm/{x86_64 => x86}/cpuid_test.c | 0 .../kvm/{x86_64 => x86}/cr4_cpuid_sync_test.c | 0 .../kvm/{x86_64 => x86}/debug_regs.c | 0 .../dirty_log_page_splitting_test.c | 0 .../exit_on_emulation_failure_test.c | 0 .../kvm/{x86_64 => x86}/fix_hypercall_test.c | 0 .../kvm/{x86_64 => x86}/flds_emulation.h | 0 .../{x86_64 => x86}/get_msr_index_features.c | 0 .../kvm/{x86_64 => x86}/hwcr_msr_test.c | 0 .../kvm/{x86_64 => x86}/hyperv_clock.c | 0 .../kvm/{x86_64 => x86}/hyperv_cpuid.c | 0 .../kvm/{x86_64 => x86}/hyperv_evmcs.c | 0 .../hyperv_extended_hypercalls.c | 0 .../kvm/{x86_64 => x86}/hyperv_features.c | 0 .../kvm/{x86_64 => x86}/hyperv_ipi.c | 0 .../kvm/{x86_64 => x86}/hyperv_svm_test.c | 0 .../kvm/{x86_64 => x86}/hyperv_tlb_flush.c | 0 .../kvm/{x86_64 => x86}/kvm_clock_test.c | 0 .../kvm/{x86_64 => x86}/kvm_pv_test.c | 0 .../kvm/{x86_64 => x86}/max_vcpuid_cap_test.c | 0 .../kvm/{x86_64 => x86}/monitor_mwait_test.c | 0 .../{x86_64 => x86}/nested_exceptions_test.c | 0 .../kvm/{x86_64 => x86}/nx_huge_pages_test.c | 0 .../kvm/{x86_64 => x86}/nx_huge_pages_test.sh | 0 .../kvm/{x86_64 => x86}/platform_info_test.c | 0 .../kvm/{x86_64 => x86}/pmu_counters_test.c | 0 .../{x86_64 => x86}/pmu_event_filter_test.c | 0 .../private_mem_conversions_test.c | 0 .../private_mem_kvm_exits_test.c | 0 .../{x86_64 => x86}/recalc_apic_map_test.c | 0 .../kvm/{x86_64 => x86}/set_boot_cpu_id.c | 0 .../kvm/{x86_64 => x86}/set_sregs_test.c | 0 .../kvm/{x86_64 => x86}/sev_init2_tests.c | 0 .../kvm/{x86_64 => x86}/sev_migrate_tests.c | 0 .../kvm/{x86_64 => x86}/sev_smoke_test.c | 0 .../smaller_maxphyaddr_emulation_test.c | 0 .../selftests/kvm/{x86_64 => x86}/smm_test.c | 0 .../kvm/{x86_64 => x86}/state_test.c | 0 .../kvm/{x86_64 => x86}/svm_int_ctl_test.c | 0 .../svm_nested_shutdown_test.c | 0 .../svm_nested_soft_inject_test.c | 0 .../kvm/{x86_64 => x86}/svm_vmcall_test.c | 0 .../kvm/{x86_64 => x86}/sync_regs_test.c | 0 .../{x86_64 => x86}/triple_fault_event_test.c | 0 .../kvm/{x86_64 => x86}/tsc_msrs_test.c | 0 .../kvm/{x86_64 => x86}/tsc_scaling_sync.c | 0 .../kvm/{x86_64 => x86}/ucna_injection_test.c | 0 .../kvm/{x86_64 => x86}/userspace_io_test.c | 0 .../{x86_64 => x86}/userspace_msr_exit_test.c | 0 .../{x86_64 => x86}/vmx_apic_access_test.c | 0 .../vmx_close_while_nested_test.c | 0 .../kvm/{x86_64 => x86}/vmx_dirty_log_test.c | 0 .../vmx_exception_with_invalid_guest_state.c | 0 .../vmx_invalid_nested_guest_state.c | 0 .../kvm/{x86_64 => x86}/vmx_msrs_test.c | 0 .../vmx_nested_tsc_scaling_test.c | 0 .../kvm/{x86_64 => x86}/vmx_pmu_caps_test.c | 0 .../vmx_preemption_timer_test.c | 0 .../vmx_set_nested_state_test.c | 0 .../kvm/{x86_64 => x86}/vmx_tsc_adjust_test.c | 0 .../kvm/{x86_64 => x86}/xapic_ipi_test.c | 0 .../kvm/{x86_64 => x86}/xapic_state_test.c | 0 .../kvm/{x86_64 => x86}/xcr0_cpuid_test.c | 0 .../kvm/{x86_64 => x86}/xen_shinfo_test.c | 0 .../kvm/{x86_64 => x86}/xen_vmcall_test.c | 0 .../kvm/{x86_64 => x86}/xss_msr_test.c | 0 141 files changed, 330 insertions(+), 332 deletions(-) create mode 100644 tools/testing/selftests/kvm/Makefile.kvm rename tools/testing/selftests/kvm/{aarch64 => arm64}/aarch32_id_regs.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/arch_timer.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/debug-exceptions.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/get-reg-list.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/hypercalls.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/page_fault_test.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/psci_test.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/set_id_regs.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/smccc_filter.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/vcpu_width_config.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/vgic_init.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/vgic_irq.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/vgic_lpi_stress.c (100%) rename tools/testing/selftests/kvm/{aarch64 => arm64}/vpmu_counter_access.c (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/arch_timer.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/delay.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/gic.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/gic_v3.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/gic_v3_its.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/kvm_util_arch.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/processor.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/spinlock.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/ucall.h (100%) rename tools/testing/selftests/kvm/include/{aarch64 => arm64}/vgic.h (100%) rename tools/testing/selftests/kvm/include/{s390x => s390}/diag318_test_handler.h (100%) rename tools/testing/selftests/kvm/include/{s390x => s390}/kvm_util_arch.h (100%) rename tools/testing/selftests/kvm/include/{s390x => s390}/processor.h (100%) rename tools/testing/selftests/kvm/include/{s390x => s390}/ucall.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/apic.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/evmcs.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/hyperv.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/kvm_util_arch.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/mce.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/pmu.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/processor.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/sev.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/svm.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/svm_util.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/ucall.h (100%) rename tools/testing/selftests/kvm/include/{x86_64 => x86}/vmx.h (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/gic.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/gic_private.h (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/gic_v3.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/gic_v3_its.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/handlers.S (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/processor.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/spinlock.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/ucall.c (100%) rename tools/testing/selftests/kvm/lib/{aarch64 => arm64}/vgic.c (100%) rename tools/testing/selftests/kvm/lib/{s390x => s390}/diag318_test_handler.c (100%) rename tools/testing/selftests/kvm/lib/{s390x => s390}/processor.c (100%) rename tools/testing/selftests/kvm/lib/{s390x => s390}/ucall.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/apic.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/handlers.S (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/hyperv.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/memstress.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/pmu.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/processor.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/sev.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/svm.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/ucall.c (100%) rename tools/testing/selftests/kvm/lib/{x86_64 => x86}/vmx.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/cmma_test.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/debug_test.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/memop.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/resets.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/shared_zeropage_test.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/sync_regs_test.c (100%) rename tools/testing/selftests/kvm/{s390x => s390}/tprot.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/amx_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/apic_bus_clock_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/cpuid_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/cr4_cpuid_sync_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/debug_regs.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/dirty_log_page_splitting_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/exit_on_emulation_failure_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/fix_hypercall_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/flds_emulation.h (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/get_msr_index_features.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hwcr_msr_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_clock.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_cpuid.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_evmcs.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_extended_hypercalls.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_features.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_ipi.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_svm_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/hyperv_tlb_flush.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/kvm_clock_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/kvm_pv_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/max_vcpuid_cap_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/monitor_mwait_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/nested_exceptions_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/nx_huge_pages_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/nx_huge_pages_test.sh (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/platform_info_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/pmu_counters_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/pmu_event_filter_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/private_mem_conversions_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/private_mem_kvm_exits_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/recalc_apic_map_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/set_boot_cpu_id.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/set_sregs_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/sev_init2_tests.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/sev_migrate_tests.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/sev_smoke_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/smaller_maxphyaddr_emulation_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/smm_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/state_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/svm_int_ctl_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/svm_nested_shutdown_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/svm_nested_soft_inject_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/svm_vmcall_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/sync_regs_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/triple_fault_event_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/tsc_msrs_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/tsc_scaling_sync.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/ucna_injection_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/userspace_io_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/userspace_msr_exit_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_apic_access_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_close_while_nested_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_dirty_log_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_exception_with_invalid_guest_state.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_invalid_nested_guest_state.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_msrs_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_nested_tsc_scaling_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_pmu_caps_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_preemption_timer_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_set_nested_state_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/vmx_tsc_adjust_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xapic_ipi_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xapic_state_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xcr0_cpuid_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xen_shinfo_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xen_vmcall_test.c (100%) rename tools/testing/selftests/kvm/{x86_64 => x86}/xss_msr_test.c (100%) base-commit: 15e1c3d65975524c5c792fcd59f7d89f00402261 -- 2.46.0.295.g3b9ea8a38a-goog