lkml.org 
[lkml]   [2021]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 14/22] x86,ftrace: Remove .fixup usage
On Thu, Nov 04, 2021 at 05:47:43PM +0100, Peter Zijlstra wrote:
> Create and use EX_TYPE_ONE_REG to load 1 into the %[faulted] register
> on exception.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> arch/x86/include/asm/extable_fixup_types.h | 1 +
> arch/x86/kernel/ftrace.c | 9 ++-------
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> --- a/arch/x86/include/asm/extable_fixup_types.h
> +++ b/arch/x86/include/asm/extable_fixup_types.h
> @@ -37,5 +37,6 @@
> #define EX_TYPE_EFAULT_REG (EX_TYPE_IMM_REG | EX_TYPE_IMM(-EFAULT))
> #define EX_TYPE_NEG_REG (EX_TYPE_IMM_REG | EX_TYPE_IMM(-1))
> #define EX_TYPE_ZERO_REG (EX_TYPE_IMM_REG | EX_TYPE_IMM(0))
> +#define EX_TYPE_ONE_REG (EX_TYPE_IMM_REG | EX_TYPE_IMM(1))
>
> #endif
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -661,13 +661,8 @@ void prepare_ftrace_return(unsigned long
> " movl $0, %[faulted]\n"
> "3:\n"
>
> - ".section .fixup, \"ax\"\n"
> - "4: movl $1, %[faulted]\n"
> - " jmp 3b\n"
> - ".previous\n"
> -
> - _ASM_EXTABLE(1b, 4b)
> - _ASM_EXTABLE(2b, 4b)
> + _ASM_EXTABLE_TYPE_REG(1b, 3b, EX_TYPE_ONE_REG, %[faulted])
> + _ASM_EXTABLE_TYPE_REG(2b, 3b, EX_TYPE_ONE_REG, %[faulted])
>
> : [old] "=&r" (old), [faulted] "=r" (faulted)
> : [parent] "r" (parent), [return_hooker] "r" (return_hooker)

This fixup code seems to no longer exist in the latest.

--
Josh

\
 
 \ /
  Last update: 2021-11-04 23:36    [W:0.359 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site