summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/x86/processor.h
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-09-19 15:32:51 -0700
committerSean Christopherson <seanjc@google.com>2025-09-23 08:39:02 -0700
commitdf1f294013da715f32521b3d0a69773e660a1af5 (patch)
tree9e6d98ae2cf805bc05feb200b6e1b6b849595a20 /tools/testing/selftests/kvm/include/x86/processor.h
parentff86b48d4ce3bdd8d2353c166e4c905f92cddd78 (diff)
KVM: selftests: Add ex_str() to print human friendly name of exception vectors
Steal exception_mnemonic() from KVM-Unit-Tests as ex_str() (to keep line lengths reasonable) and use it in assert messages that currently print the raw vector number. Co-developed-by: Chao Gao <chao.gao@intel.com> Signed-off-by: Chao Gao <chao.gao@intel.com> Link: https://lore.kernel.org/r/20250919223258.1604852-45-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/x86/processor.h')
-rw-r--r--tools/testing/selftests/kvm/include/x86/processor.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
index e8bad89fbb7f..fbe875eafca5 100644
--- a/tools/testing/selftests/kvm/include/x86/processor.h
+++ b/tools/testing/selftests/kvm/include/x86/processor.h
@@ -34,6 +34,8 @@ extern uint64_t guest_tsc_khz;
#define NMI_VECTOR 0x02
+const char *ex_str(int vector);
+
#define X86_EFLAGS_FIXED (1u << 1)
#define X86_CR4_VME (1ul << 0)