* [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type
@ 2024-02-02 9:55 Shung-Hsi Yu
2024-02-02 13:18 ` Jiri Olsa
2024-02-02 22:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Shung-Hsi Yu @ 2024-02-02 9:55 UTC (permalink / raw)
To: bpf
Cc: Shung-Hsi Yu, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Mykola Lysenko, Rong Tao
After commit c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize
kallsyms cache") trace_helpers.c now includes libbpf_internal.h, and
thus can no longer use the u32 type (among others) since they are poison
in libbpf_internal.h. Replace u32 with __u32 to fix the following error
when building trace_helpers.c on powerpc:
error: attempt to use poisoned "u32"
Fixes: c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache")
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
Somehow this error only shows up when I'm building on ppc64le, but not
x86_64 and aarch64. But I didn't investigate further.
---
tools/testing/selftests/bpf/trace_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
index 4faa898ff7fc..27fd7ed3e4b0 100644
--- a/tools/testing/selftests/bpf/trace_helpers.c
+++ b/tools/testing/selftests/bpf/trace_helpers.c
@@ -271,7 +271,7 @@ ssize_t get_uprobe_offset(const void *addr)
* addi r2,r2,XXXX
*/
{
- const u32 *insn = (const u32 *)(uintptr_t)addr;
+ const __u32 *insn = (const __u32 *)(uintptr_t)addr;
if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) ||
((*insn & OP_RT_RA_MASK) == LIS_R2)) &&
base-commit: 943b043aeecce9accb6d367af47791c633e95e4d
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type
2024-02-02 9:55 [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type Shung-Hsi Yu
@ 2024-02-02 13:18 ` Jiri Olsa
2024-02-02 22:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2024-02-02 13:18 UTC (permalink / raw)
To: Shung-Hsi Yu
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo,
Mykola Lysenko, Rong Tao
On Fri, Feb 02, 2024 at 05:55:58PM +0800, Shung-Hsi Yu wrote:
> After commit c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize
> kallsyms cache") trace_helpers.c now includes libbpf_internal.h, and
> thus can no longer use the u32 type (among others) since they are poison
> in libbpf_internal.h. Replace u32 with __u32 to fix the following error
> when building trace_helpers.c on powerpc:
>
> error: attempt to use poisoned "u32"
>
> Fixes: c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache")
> Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
> ---
> Somehow this error only shows up when I'm building on ppc64le, but not
> x86_64 and aarch64. But I didn't investigate further.
it's within powerpc ifdef:
#if defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
> ---
> tools/testing/selftests/bpf/trace_helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
> index 4faa898ff7fc..27fd7ed3e4b0 100644
> --- a/tools/testing/selftests/bpf/trace_helpers.c
> +++ b/tools/testing/selftests/bpf/trace_helpers.c
> @@ -271,7 +271,7 @@ ssize_t get_uprobe_offset(const void *addr)
> * addi r2,r2,XXXX
> */
> {
> - const u32 *insn = (const u32 *)(uintptr_t)addr;
> + const __u32 *insn = (const __u32 *)(uintptr_t)addr;
>
> if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) ||
> ((*insn & OP_RT_RA_MASK) == LIS_R2)) &&
>
> base-commit: 943b043aeecce9accb6d367af47791c633e95e4d
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type
2024-02-02 9:55 [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type Shung-Hsi Yu
2024-02-02 13:18 ` Jiri Olsa
@ 2024-02-02 22:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-02 22:30 UTC (permalink / raw)
To: Shung-Hsi Yu
Cc: bpf, ast, daniel, andrii, martin.lau, eddyz87, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
mykolal, rongtao
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Fri, 2 Feb 2024 17:55:58 +0800 you wrote:
> After commit c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize
> kallsyms cache") trace_helpers.c now includes libbpf_internal.h, and
> thus can no longer use the u32 type (among others) since they are poison
> in libbpf_internal.h. Replace u32 with __u32 to fix the following error
> when building trace_helpers.c on powerpc:
>
> error: attempt to use poisoned "u32"
>
> [...]
Here is the summary with links:
- [bpf] selftests/bpf: trace_helpers.c: do not use poisoned type
https://git.kernel.org/bpf/bpf-next/c/a68b50f47bec
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:[~2024-02-02 22:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 9:55 [PATCH bpf] selftests/bpf: trace_helpers.c: do not use poisoned type Shung-Hsi Yu
2024-02-02 13:18 ` Jiri Olsa
2024-02-02 22:30 ` 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