[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211104165525.348183644@infradead.org>
Date: Thu, 04 Nov 2021 17:47:43 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
jpoimboe@...hat.com, mark.rutland@....com, dvyukov@...gle.com,
seanjc@...gle.com, pbonzini@...hat.com, mbenes@...e.cz
Subject: [RFC][PATCH 14/22] x86,ftrace: Remove .fixup usage
Create and use EX_TYPE_ONE_REG to load 1 into the %[faulted] register
on exception.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.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)
Powered by blists - more mailing lists