samples: ftrace: Replace bti assembly with hint for older compiler
authorGONG, Ruiqi <gongruiqi1@huawei.com>
Sun, 20 Aug 2023 11:15:09 +0000 (19:15 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 22 Aug 2023 02:03:58 +0000 (22:03 -0400)
When cross-building the arm64 kernel with allmodconfig using GCC 9.4,
the following error occurs on multiple files under samples/ftrace/:

/tmp/ccPC1ODs.s: Assembler messages:
/tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c'

Fix this issue by replacing `bti c` with `hint 34`, which is compatible
for the older compiler.

Link: https://lore.kernel.org/linux-trace-kernel/20230820111509.1470826-1-gongruiqi@huaweicloud.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Florent Revest <revest@chromium.org>
Fixes: 8c3526fb86060cb5 ("arm64: ftrace: Add direct call trampoline samples support")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
samples/ftrace/ftrace-direct-modify.c
samples/ftrace/ftrace-direct-multi-modify.c
samples/ftrace/ftrace-direct-multi.c
samples/ftrace/ftrace-direct-too.c
samples/ftrace/ftrace-direct.c

index e5ed08098ff31dce52442a922e4c4975b66ec6ff..e2a6a69352dfb775ebc7d6954c98943ec2a3097f 100644 (file)
@@ -105,7 +105,7 @@ asm (
 "      .type           my_tramp1, @function\n"
 "      .globl          my_tramp1\n"
 "   my_tramp1:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #16\n"
 "      stp     x9, x30, [sp]\n"
 "      bl      my_direct_func1\n"
@@ -117,7 +117,7 @@ asm (
 "      .type           my_tramp2, @function\n"
 "      .globl          my_tramp2\n"
 "   my_tramp2:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #16\n"
 "      stp     x9, x30, [sp]\n"
 "      bl      my_direct_func2\n"
index 292cff2b3f5d755f21bb80a3f5f52a05a368049b..2e349834d63c386ef54a8d3fecb2df713e7e4f2e 100644 (file)
@@ -112,7 +112,7 @@ asm (
 "      .type           my_tramp1, @function\n"
 "      .globl          my_tramp1\n"
 "   my_tramp1:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #32\n"
 "      stp     x9, x30, [sp]\n"
 "      str     x0, [sp, #16]\n"
@@ -127,7 +127,7 @@ asm (
 "      .type           my_tramp2, @function\n"
 "      .globl          my_tramp2\n"
 "   my_tramp2:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #32\n"
 "      stp     x9, x30, [sp]\n"
 "      str     x0, [sp, #16]\n"
index b4391e08c913e8cbcba96965036f093024861825..9243dbfe4d0c1f72f7e9d55f5d7fb9631482018f 100644 (file)
@@ -75,7 +75,7 @@ asm (
 "      .type           my_tramp, @function\n"
 "      .globl          my_tramp\n"
 "   my_tramp:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #32\n"
 "      stp     x9, x30, [sp]\n"
 "      str     x0, [sp, #16]\n"
index e9804c5307c0c7481f5bf8909b9431ed41efd25f..e39c3563ae4e42845aa8028aafa8fce394ab7759 100644 (file)
@@ -81,7 +81,7 @@ asm (
 "      .type           my_tramp, @function\n"
 "      .globl          my_tramp\n"
 "   my_tramp:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #48\n"
 "      stp     x9, x30, [sp]\n"
 "      stp     x0, x1, [sp, #16]\n"
index 20f4a7caa810ebd0f175cf73ad48bc73f06baa66..32c477da1e9aa3719cd1ac6997d8e774e7d84658 100644 (file)
@@ -72,7 +72,7 @@ asm (
 "      .type           my_tramp, @function\n"
 "      .globl          my_tramp\n"
 "   my_tramp:"
-"      bti     c\n"
+"      hint    34\n" // bti    c
 "      sub     sp, sp, #32\n"
 "      stp     x9, x30, [sp]\n"
 "      str     x0, [sp, #16]\n"