Commit e332938e authored by GONG, Ruiqi's avatar GONG, Ruiqi Committed by Steven Rostedt (Google)

samples: ftrace: Replace bti assembly with hint for older compiler

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: 8c3526fb ("arm64: ftrace: Add direct call trampoline samples support")
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarGONG, Ruiqi <gongruiqi1@huawei.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent c2489bb7
...@@ -105,7 +105,7 @@ asm ( ...@@ -105,7 +105,7 @@ asm (
" .type my_tramp1, @function\n" " .type my_tramp1, @function\n"
" .globl my_tramp1\n" " .globl my_tramp1\n"
" my_tramp1:" " my_tramp1:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #16\n" " sub sp, sp, #16\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" bl my_direct_func1\n" " bl my_direct_func1\n"
...@@ -117,7 +117,7 @@ asm ( ...@@ -117,7 +117,7 @@ asm (
" .type my_tramp2, @function\n" " .type my_tramp2, @function\n"
" .globl my_tramp2\n" " .globl my_tramp2\n"
" my_tramp2:" " my_tramp2:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #16\n" " sub sp, sp, #16\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" bl my_direct_func2\n" " bl my_direct_func2\n"
......
...@@ -112,7 +112,7 @@ asm ( ...@@ -112,7 +112,7 @@ asm (
" .type my_tramp1, @function\n" " .type my_tramp1, @function\n"
" .globl my_tramp1\n" " .globl my_tramp1\n"
" my_tramp1:" " my_tramp1:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #32\n" " sub sp, sp, #32\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" str x0, [sp, #16]\n" " str x0, [sp, #16]\n"
...@@ -127,7 +127,7 @@ asm ( ...@@ -127,7 +127,7 @@ asm (
" .type my_tramp2, @function\n" " .type my_tramp2, @function\n"
" .globl my_tramp2\n" " .globl my_tramp2\n"
" my_tramp2:" " my_tramp2:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #32\n" " sub sp, sp, #32\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" str x0, [sp, #16]\n" " str x0, [sp, #16]\n"
......
...@@ -75,7 +75,7 @@ asm ( ...@@ -75,7 +75,7 @@ asm (
" .type my_tramp, @function\n" " .type my_tramp, @function\n"
" .globl my_tramp\n" " .globl my_tramp\n"
" my_tramp:" " my_tramp:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #32\n" " sub sp, sp, #32\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" str x0, [sp, #16]\n" " str x0, [sp, #16]\n"
......
...@@ -81,7 +81,7 @@ asm ( ...@@ -81,7 +81,7 @@ asm (
" .type my_tramp, @function\n" " .type my_tramp, @function\n"
" .globl my_tramp\n" " .globl my_tramp\n"
" my_tramp:" " my_tramp:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #48\n" " sub sp, sp, #48\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" stp x0, x1, [sp, #16]\n" " stp x0, x1, [sp, #16]\n"
......
...@@ -72,7 +72,7 @@ asm ( ...@@ -72,7 +72,7 @@ asm (
" .type my_tramp, @function\n" " .type my_tramp, @function\n"
" .globl my_tramp\n" " .globl my_tramp\n"
" my_tramp:" " my_tramp:"
" bti c\n" " hint 34\n" // bti c
" sub sp, sp, #32\n" " sub sp, sp, #32\n"
" stp x9, x30, [sp]\n" " stp x9, x30, [sp]\n"
" str x0, [sp, #16]\n" " str x0, [sp, #16]\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment