Skip to content

Commit

Permalink
KVM: selftests: Move KVM_FEP macro into common library header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sean-jc committed Jan 30, 2024
1 parent 0326cc6 commit 00856e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tools/testing/selftests/kvm/include/x86_64/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00856e1

Please sign in to comment.