Skip to content

Commit 339ed90

Browse files
Xu Kuohaiborkmann
authored andcommitted
bpf, arm64: Fix compile error in dummy_tramp()
dummy_tramp() uses "lr" to refer to the x30 register, but some assembler does not recognize "lr" and reports a build failure: /tmp/cc52xO0c.s: Assembler messages: /tmp/cc52xO0c.s:8: Error: operand 1 should be an integer register -- `mov lr,x9' /tmp/cc52xO0c.s:7: Error: undefined symbol lr used as an immediate value make[2]: *** [scripts/Makefile.build:250: arch/arm64/net/bpf_jit_comp.o] Error 1 make[1]: *** [scripts/Makefile.build:525: arch/arm64/net] Error 2 So replace "lr" with "x30" to fix it. Fixes: b2ad54e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") Reported-by: Jon Hunter <[email protected]> Signed-off-by: Xu Kuohai <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Tested-by: Jon Hunter <[email protected]> Reviewed-by: Jean-Philippe Brucker <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent aef9d4a commit 339ed90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ asm (
610610
#if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
611611
" bti j\n" /* dummy_tramp is called via "br x10" */
612612
#endif
613-
" mov x10, lr\n"
614-
" mov lr, x9\n"
613+
" mov x10, x30\n"
614+
" mov x30, x9\n"
615615
" ret x10\n"
616616
" .size dummy_tramp, .-dummy_tramp\n"
617617
" .popsection\n"

0 commit comments

Comments
 (0)