* [PATCH] bpf, arm64: Mark dummy_tramp as global
@ 2022-07-13 17:35 Nathan Chancellor
2022-07-13 19:11 ` Stanislav Fomichev
2022-07-14 15:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-07-13 17:35 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Zi Shen Lim,
Xu Kuohai, Nick Desaulniers, Tom Rix, bpf, linux-arm-kernel,
linux-kernel, llvm, patches, Nathan Chancellor, Sami Tolvanen
When building with clang + CONFIG_CFI_CLANG=y, the following error
occurs at link time:
ld.lld: error: undefined symbol: dummy_tramp
dummy_tramp is declared globally in C but its definition in inline
assembly does not use .global, which prevents clang from properly
resolving the references to it when creating the CFI jump tables.
Mark dummy_tramp as global so that the reference can be properly
resolved.
Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
Link: https://github.com/ClangBuiltLinux/linux/issues/1661
Suggested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
arch/arm64/net/bpf_jit_comp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index fd1cb0d2aaa6..dcc572b7d4da 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -604,6 +604,7 @@ void dummy_tramp(void);
asm (
" .pushsection .text, \"ax\", @progbits\n"
+" .global dummy_tramp\n"
" .type dummy_tramp, %function\n"
"dummy_tramp:"
#if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
base-commit: ace2bee839e08df324cb320763258dfd72e6120e
--
2.37.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bpf, arm64: Mark dummy_tramp as global
2022-07-13 17:35 [PATCH] bpf, arm64: Mark dummy_tramp as global Nathan Chancellor
@ 2022-07-13 19:11 ` Stanislav Fomichev
2022-07-14 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2022-07-13 19:11 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Hao Luo, Jiri Olsa, Zi Shen Lim, Xu Kuohai,
Nick Desaulniers, Tom Rix, bpf, linux-arm-kernel, linux-kernel,
llvm, patches, Sami Tolvanen
On Wed, Jul 13, 2022 at 10:35 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> When building with clang + CONFIG_CFI_CLANG=y, the following error
> occurs at link time:
>
> ld.lld: error: undefined symbol: dummy_tramp
>
> dummy_tramp is declared globally in C but its definition in inline
> assembly does not use .global, which prevents clang from properly
> resolving the references to it when creating the CFI jump tables.
>
> Mark dummy_tramp as global so that the reference can be properly
> resolved.
>
> Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1661
> Suggested-by: Sami Tolvanen <samitolvanen@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
> ---
> arch/arm64/net/bpf_jit_comp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index fd1cb0d2aaa6..dcc572b7d4da 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -604,6 +604,7 @@ void dummy_tramp(void);
>
> asm (
> " .pushsection .text, \"ax\", @progbits\n"
> +" .global dummy_tramp\n"
> " .type dummy_tramp, %function\n"
> "dummy_tramp:"
> #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)
>
> base-commit: ace2bee839e08df324cb320763258dfd72e6120e
> --
> 2.37.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bpf, arm64: Mark dummy_tramp as global
2022-07-13 17:35 [PATCH] bpf, arm64: Mark dummy_tramp as global Nathan Chancellor
2022-07-13 19:11 ` Stanislav Fomichev
@ 2022-07-14 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-14 15:00 UTC (permalink / raw)
To: Nathan Chancellor
Cc: ast, daniel, andrii, martin.lau, song, yhs, john.fastabend,
kpsingh, sdf, haoluo, jolsa, zlim.lnx, xukuohai, ndesaulniers,
trix, bpf, linux-arm-kernel, linux-kernel, llvm, patches,
samitolvanen
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Wed, 13 Jul 2022 10:35:03 -0700 you wrote:
> When building with clang + CONFIG_CFI_CLANG=y, the following error
> occurs at link time:
>
> ld.lld: error: undefined symbol: dummy_tramp
>
> dummy_tramp is declared globally in C but its definition in inline
> assembly does not use .global, which prevents clang from properly
> resolving the references to it when creating the CFI jump tables.
>
> [...]
Here is the summary with links:
- bpf, arm64: Mark dummy_tramp as global
https://git.kernel.org/bpf/bpf-next/c/33f32e5072b6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-14 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13 17:35 [PATCH] bpf, arm64: Mark dummy_tramp as global Nathan Chancellor
2022-07-13 19:11 ` Stanislav Fomichev
2022-07-14 15:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).