KVM: selftests: Add a forced emulation variation of KVM_ASM_SAFE()
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:47 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:44 +0000 (15:29 -0800)
commitab3b6a7de8df00b380fb66a523c79e3b387aa877
tree2d012ee5f35c86405358056dc99d2084e7d04c44
parentcd34fd8c758e968aae15944b1679c974af719648
KVM: selftests: Add a forced emulation variation of KVM_ASM_SAFE()

Add KVM_ASM_SAFE_FEP() to allow forcing emulation on an instruction that
might fault.  Note, KVM skips RIP past the FEP prefix before injecting an
exception, i.e. the fixup needs to be on the instruction itself.  Do not
check for FEP support, that is firmly the responsibility of whatever code
wants to use KVM_ASM_SAFE_FEP().

Sadly, chaining variadic arguments that contain commas doesn't work, thus
the unfortunate amount of copy+paste.

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