[Patch v2 0/4] Common KVM exit reason test assertions and exit reason sync

From: Vipin Sharma
Date: Fri Feb 03 2023 - 20:46:12 EST


Hi,

This patch seris is extracted from
https://lore.kernel.org/lkml/20221212183720.4062037-1-vipinsh@xxxxxxxxxx/
series.

Specifically, patch 12 is taken out from there and now expanded in to
this series.

This patch series contains following changes:

Patch 1 & 2:
Make a macro to clean up all KVM exit reason test assertion.

There are few places where explicit run->exit_reason are used but they
cannot be replaced with current macro.

I used following command KVM selftests directory and changed each
occurrence:
grep "run->exit_reason" -nir ./

Patch 3:
This is from Sean Christopherson. Adding a macro to generate KVM
exit strings.

Patch 4:
Sync KVM_EXIT_* reasons to sefltests. Many reasons are not present in
selftest code.

v2:
- Improve test assert message.
- Add macro to generate KVM_EXIT_* reason strings.
- Update selftests KVM_EXIT_ reasons to latest version.

v1: https://lore.kernel.org/lkml/20221212183720.4062037-13-vipinsh@xxxxxxxxxx/

Sean Christopherson (1):
KVM: selftests: Add macro to generate KVM exit reason strings

Vipin Sharma (3):
KVM: selftests: Make vCPU exit reason test assertion common
KVM: selftests: Print expected and actual exit reason in KVM exit
reason assert
KVM: selftests: Sync KVM exit reasons in selftests

.../testing/selftests/kvm/aarch64/psci_test.c | 4 +-
.../testing/selftests/kvm/include/test_util.h | 9 +++
tools/testing/selftests/kvm/lib/kvm_util.c | 66 ++++++++++++-------
.../kvm/lib/s390x/diag318_test_handler.c | 3 +-
.../selftests/kvm/s390x/sync_regs_test.c | 15 +----
.../selftests/kvm/set_memory_region_test.c | 6 +-
tools/testing/selftests/kvm/x86_64/amx_test.c | 8 +--
.../kvm/x86_64/cr4_cpuid_sync_test.c | 8 +--
.../testing/selftests/kvm/x86_64/debug_regs.c | 2 +-
.../selftests/kvm/x86_64/flds_emulation.h | 5 +-
.../selftests/kvm/x86_64/hyperv_clock.c | 7 +-
.../selftests/kvm/x86_64/hyperv_evmcs.c | 8 +--
.../selftests/kvm/x86_64/hyperv_features.c | 14 +---
.../testing/selftests/kvm/x86_64/hyperv_ipi.c | 6 +-
.../selftests/kvm/x86_64/hyperv_svm_test.c | 7 +-
.../selftests/kvm/x86_64/hyperv_tlb_flush.c | 14 +---
.../selftests/kvm/x86_64/kvm_clock_test.c | 5 +-
.../selftests/kvm/x86_64/kvm_pv_test.c | 5 +-
.../selftests/kvm/x86_64/monitor_mwait_test.c | 9 +--
.../kvm/x86_64/nested_exceptions_test.c | 5 +-
.../selftests/kvm/x86_64/platform_info_test.c | 14 +---
.../kvm/x86_64/pmu_event_filter_test.c | 6 +-
tools/testing/selftests/kvm/x86_64/smm_test.c | 9 +--
.../testing/selftests/kvm/x86_64/state_test.c | 8 +--
.../selftests/kvm/x86_64/svm_int_ctl_test.c | 8 +--
.../kvm/x86_64/svm_nested_shutdown_test.c | 7 +-
.../kvm/x86_64/svm_nested_soft_inject_test.c | 6 +-
.../selftests/kvm/x86_64/svm_vmcall_test.c | 6 +-
.../selftests/kvm/x86_64/sync_regs_test.c | 25 ++-----
.../kvm/x86_64/triple_fault_event_test.c | 9 +--
.../selftests/kvm/x86_64/tsc_scaling_sync.c | 6 +-
.../kvm/x86_64/ucna_injection_test.c | 22 ++-----
.../selftests/kvm/x86_64/userspace_io_test.c | 6 +-
.../kvm/x86_64/userspace_msr_exit_test.c | 22 ++-----
.../kvm/x86_64/vmx_apic_access_test.c | 11 +---
.../kvm/x86_64/vmx_close_while_nested_test.c | 5 +-
.../selftests/kvm/x86_64/vmx_dirty_log_test.c | 7 +-
.../vmx_exception_with_invalid_guest_state.c | 4 +-
.../x86_64/vmx_invalid_nested_guest_state.c | 4 +-
.../kvm/x86_64/vmx_nested_tsc_scaling_test.c | 6 +-
.../kvm/x86_64/vmx_preemption_timer_test.c | 8 +--
.../kvm/x86_64/vmx_tsc_adjust_test.c | 6 +-
.../selftests/kvm/x86_64/xapic_ipi_test.c | 6 +-
.../selftests/kvm/x86_64/xen_shinfo_test.c | 7 +-
.../selftests/kvm/x86_64/xen_vmcall_test.c | 5 +-
45 files changed, 111 insertions(+), 318 deletions(-)

--
2.39.1.519.gcb327c4b5f-goog