Re: [RFC][PATCH 06/22] x86,entry_32: Remove .fixup usage

From: Josh Poimboeuf
Date: Thu Nov 04 2021 - 16:39:41 EST


On Thu, Nov 04, 2021 at 05:47:35PM +0100, Peter Zijlstra wrote:
> +++ b/arch/x86/include/asm/extable_fixup_types.h
> @@ -19,4 +19,6 @@
> #define EX_TYPE_DEFAULT_MCE_SAFE 12
> #define EX_TYPE_FAULT_MCE_SAFE 13
>
> +#define EX_TYPE_POP_SEG 14
> +

This looks funky in the patch (but not in the editor), those other ones
have a tab after '#define'.

> #endif
> --- a/arch/x86/mm/extable.c
> +++ b/arch/x86/mm/extable.c
> @@ -99,6 +99,13 @@ static bool ex_handler_clear_fs(const st
> return ex_handler_default(fixup, regs);
> }
>
> +static bool ex_handler_pop_seg(const struct exception_table_entry *fixup,
> + struct pt_regs *regs)
> +{
> + *((unsigned int *)regs->sp) = 0;
> + return ex_handler_default(fixup, regs);
> +}

Clever. Should be "unsigned long" in case this ever gets used by
64-bit? Also, I'd suggest a short comment.

--
Josh