KVM: selftests: Move KVM_FEP macro into common library header
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:45 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:43 +0000 (15:29 -0800)
Move the KVM_FEP definition, a.k.a. the KVM force emulation prefix, into
processor.h so that it can be used for other tests besides the MSR filter
test.

Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-26-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c

index d211cea188bee57e49ef764f99f9742138f70ef5..6be365ac2a85b4ef7ab8f7f09313d0c20efd6be5 100644 (file)
@@ -23,6 +23,9 @@
 extern bool host_cpu_is_intel;
 extern bool host_cpu_is_amd;
 
+/* Forced emulation prefix, used to invoke the emulator unconditionally. */
+#define KVM_FEP "ud2; .byte 'k', 'v', 'm';"
+
 #define NMI_VECTOR             0x02
 
 #define X86_EFLAGS_FIXED        (1u << 1)
index 9e12dbc47a72f23f4329393658bfca3d13d44006..ab3a8c4f0b864332906f5ef07a3dfe32f9e71f10 100644 (file)
@@ -12,8 +12,6 @@
 #include "kvm_util.h"
 #include "vmx.h"
 
-/* Forced emulation prefix, used to invoke the emulator unconditionally. */
-#define KVM_FEP "ud2; .byte 'k', 'v', 'm';"
 static bool fep_available;
 
 #define MSR_NON_EXISTENT 0x474f4f00