Skip to content

Commit

Permalink
samples: ftrace: Replace bti assembly with hint for older compiler
Browse files Browse the repository at this point in the history
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/[email protected]

Cc: Masami Hiramatsu <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Florent Revest <[email protected]>
Fixes: 8c3526f ("arm64: ftrace: Add direct call trampoline samples support")
Acked-by: Mark Rutland <[email protected]>
Signed-off-by: GONG, Ruiqi <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
  • Loading branch information
GONG, Ruiqi authored and rostedt committed Aug 22, 2023
1 parent c2489bb commit e332938
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions samples/ftrace/ftrace-direct-modify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions samples/ftrace/ftrace-direct-multi-modify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion samples/ftrace/ftrace-direct-multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion samples/ftrace/ftrace-direct-too.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion samples/ftrace/ftrace-direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e332938

Please sign in to comment.