Re: [RFC][PATCH 18/22] x86,kvm: Remove .fixup usage
From: Peter Zijlstra
Date: Fri Nov 05 2021 - 04:01:10 EST
On Thu, Nov 04, 2021 at 07:50:36PM +0100, Paolo Bonzini wrote:
> > + FOP1E(op, dst) _ASM_EXTABLE_TYPE(10b, 10b, EX_TYPE_KVM_FASTOP)
>
> There's a ret right after the 10b label, so I think you can just use this:
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 493511efa3dc..f382c03c5954 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -315,7 +315,7 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
> __FOP_FUNC(#name)
> #define __FOP_RET(name) \
> - "ret \n\t" \
> + "11: ret \n\t" \
> ".size " name ", .-" name "\n\t"
> #define FOP_RET(name) \
> @@ -344,7 +344,7 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
> __FOP_RET(#op "_" #dst)
> #define FOP1EEX(op, dst) \
> - FOP1E(op, dst) _ASM_EXTABLE(10b, kvm_fastop_exception)
> + FOP1E(op, dst) _ASM_EXTABLE_TYPE_REG(10b, 11b, EX_TYPE_ZERO_REG, %esi)
> #define FASTOP1(op) \
> FOP_START(op) \
That's much nicer, thanks!