From: Ard Biesheuvel Date: Mon, 24 Jan 2022 09:38:15 +0000 (+0100) Subject: ARM: ftrace: ensure that ADR takes the Thumb bit into account X-Git-Tag: v6.6.17~7945^2~7^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd88b03ff0c84f4bcbe1419b93a4bed429fed3be;p=platform%2Fkernel%2Flinux-rpi.git ARM: ftrace: ensure that ADR takes the Thumb bit into account Using ADR to take the address of 'ftrace_stub' via a local label produces an address that has the Thumb bit cleared, which means the subsequent comparison is guaranteed to fail. Instead, use the badr macro, which forces the Thumb bit to be set. Fixes: a3ba87a61499 ("ARM: 6316/1: ftrace: add Thumb-2 support") Signed-off-by: Ard Biesheuvel Reviewed-by: Nick Desaulniers Reviewed-by: Steven Rostedt (Google) Reviewed-by: Linus Walleij --- diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S index a74289e..f4886fb 100644 --- a/arch/arm/kernel/entry-ftrace.S +++ b/arch/arm/kernel/entry-ftrace.S @@ -40,7 +40,7 @@ mcount_enter ldr r0, =ftrace_trace_function ldr r2, [r0] - adr r0, .Lftrace_stub + badr r0, .Lftrace_stub cmp r0, r2 bne 1f