summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Kuohai <xukuohai@huawei.com>2022-07-21 08:13:19 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2022-07-22 00:21:16 +0200
commit339ed900b3079b6ea21df55f368b1ccba17cd5e6 (patch)
tree2b464231c1b01afa1a4b7de686cd8f1368a2042e
parentaef9d4a34a51f0a50b4cc04c635955b37972fc90 (diff)
downloadlinux-339ed900b3079b6ea21df55f368b1ccba17cd5e6.tar.bz2
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: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") Reported-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Xu Kuohai <xukuohai@huawei.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Link: https://lore.kernel.org/bpf/20220721121319.2999259-1-xukuohai@huaweicloud.com
-rw-r--r--arch/arm64/net/bpf_jit_comp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index dcc572b7d4da..7ca8779ae34f 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -610,8 +610,8 @@ asm (
#if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
" bti j\n" /* dummy_tramp is called via "br x10" */
#endif
-" mov x10, lr\n"
-" mov lr, x9\n"
+" mov x10, x30\n"
+" mov x30, x9\n"
" ret x10\n"
" .size dummy_tramp, .-dummy_tramp\n"
" .popsection\n"