KVM instruction emulation has a gnarly hack where the .fixup does a
return, luckily exceptions can easily emulate a return so create a new
extable type to fully do the FASTOP magic.
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
arch/x86/include/asm/extable_fixup_types.h | 1 +
arch/x86/kvm/emulate.c | 14 +++-----------
arch/x86/mm/extable.c | 11 +++++++++++
3 files changed, 15 insertions(+), 11 deletions(-)
--- a/arch/x86/include/asm/extable_fixup_types.h
+++ b/arch/x86/include/asm/extable_fixup_types.h
@@ -40,5 +40,6 @@
#define EX_TYPE_ONE_REG (EX_TYPE_IMM_REG | EX_TYPE_IMM(1))
#define EX_TYPE_FAULT_SGX 18
+#define EX_TYPE_KVM_FASTOP 19
#endif
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -344,7 +344,7 @@ static int fastop(struct x86_emulate_ctx
__FOP_RET(#op "_" #dst)
#define FOP1EEX(op, dst) \
- FOP1E(op, dst) _ASM_EXTABLE(10b, kvm_fastop_exception)
+ FOP1E(op, dst) _ASM_EXTABLE_TYPE(10b, 10b, EX_TYPE_KVM_FASTOP)