From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: kkd@meta.com, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Manu Bretelle <chantra@meta.com>, Jiri Olsa <jolsa@kernel.org>,
Juri Lelli <juri.lelli@redhat.com>,
kernel-team@fb.com
Subject: [PATCH bpf v1 2/4] selftests/bpf: Revert "selftests/bpf: Add tests for raw_tp null handling"
Date: Tue, 10 Dec 2024 18:01:54 -0800 [thread overview]
Message-ID: <20241211020156.18966-3-memxor@gmail.com> (raw)
In-Reply-To: <20241211020156.18966-1-memxor@gmail.com>
This patch reverts
commit d798ce3f4cab ("selftests/bpf: Add tests for raw_tp null handling")
since it's parent
commit cb4158ce8ec8 ("bpf: Mark raw_tp arguments with PTR_MAYBE_NULL")
is also being reverted.
Fixes: d798ce3f4cab ("selftests/bpf: Add tests for raw_tp null handling")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
.../bpf/bpf_testmod/bpf_testmod-events.h | 8 -----
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 2 --
.../selftests/bpf/prog_tests/raw_tp_null.c | 25 ---------------
.../testing/selftests/bpf/progs/raw_tp_null.c | 32 -------------------
4 files changed, 67 deletions(-)
delete mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_null.c
delete mode 100644 tools/testing/selftests/bpf/progs/raw_tp_null.c
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h
index aeef86b3da74..6c3b4d4f173a 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod-events.h
@@ -40,14 +40,6 @@ DECLARE_TRACE(bpf_testmod_test_nullable_bare,
TP_ARGS(ctx__nullable)
);
-struct sk_buff;
-
-DECLARE_TRACE(bpf_testmod_test_raw_tp_null,
- TP_PROTO(struct sk_buff *skb),
- TP_ARGS(skb)
-);
-
-
#undef BPF_TESTMOD_DECLARE_TRACE
#ifdef DECLARE_TRACE_WRITABLE
#define BPF_TESTMOD_DECLARE_TRACE(call, proto, args, size) \
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
index cc9dde507aba..c64dd001a4ed 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -413,8 +413,6 @@ bpf_testmod_test_read(struct file *file, struct kobject *kobj,
(void)bpf_testmod_test_arg_ptr_to_struct(&struct_arg1_2);
- (void)trace_bpf_testmod_test_raw_tp_null(NULL);
-
bpf_testmod_test_struct_ops3();
struct_arg3 = kmalloc((sizeof(struct bpf_testmod_struct_arg_3) +
diff --git a/tools/testing/selftests/bpf/prog_tests/raw_tp_null.c b/tools/testing/selftests/bpf/prog_tests/raw_tp_null.c
deleted file mode 100644
index 6fa19449297e..000000000000
--- a/tools/testing/selftests/bpf/prog_tests/raw_tp_null.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
-
-#include <test_progs.h>
-#include "raw_tp_null.skel.h"
-
-void test_raw_tp_null(void)
-{
- struct raw_tp_null *skel;
-
- skel = raw_tp_null__open_and_load();
- if (!ASSERT_OK_PTR(skel, "raw_tp_null__open_and_load"))
- return;
-
- skel->bss->tid = sys_gettid();
-
- if (!ASSERT_OK(raw_tp_null__attach(skel), "raw_tp_null__attach"))
- goto end;
-
- ASSERT_OK(trigger_module_test_read(2), "trigger testmod read");
- ASSERT_EQ(skel->bss->i, 3, "invocations");
-
-end:
- raw_tp_null__destroy(skel);
-}
diff --git a/tools/testing/selftests/bpf/progs/raw_tp_null.c b/tools/testing/selftests/bpf/progs/raw_tp_null.c
deleted file mode 100644
index 457f34c151e3..000000000000
--- a/tools/testing/selftests/bpf/progs/raw_tp_null.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
-
-#include <vmlinux.h>
-#include <bpf/bpf_tracing.h>
-
-char _license[] SEC("license") = "GPL";
-
-int tid;
-int i;
-
-SEC("tp_btf/bpf_testmod_test_raw_tp_null")
-int BPF_PROG(test_raw_tp_null, struct sk_buff *skb)
-{
- struct task_struct *task = bpf_get_current_task_btf();
-
- if (task->pid != tid)
- return 0;
-
- i = i + skb->mark + 1;
- /* The compiler may move the NULL check before this deref, which causes
- * the load to fail as deref of scalar. Prevent that by using a barrier.
- */
- barrier();
- /* If dead code elimination kicks in, the increment below will
- * be removed. For raw_tp programs, we mark input arguments as
- * PTR_MAYBE_NULL, so branch prediction should never kick in.
- */
- if (!skb)
- i += 2;
- return 0;
-}
--
2.43.5
next prev parent reply other threads:[~2024-12-11 2:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 2:01 [PATCH bpf v1 0/4] Explicit raw_tp NULL arguments Kumar Kartikeya Dwivedi
2024-12-11 2:01 ` [PATCH bpf v1 1/4] bpf: Revert "bpf: Mark raw_tp arguments with PTR_MAYBE_NULL" Kumar Kartikeya Dwivedi
2024-12-11 2:01 ` Kumar Kartikeya Dwivedi [this message]
2024-12-11 2:01 ` [PATCH bpf v1 3/4] bpf: Augment raw_tp arguments with PTR_MAYBE_NULL Kumar Kartikeya Dwivedi
2024-12-11 12:24 ` Jiri Olsa
2024-12-11 14:56 ` Jiri Olsa
2024-12-11 15:56 ` Alexei Starovoitov
2024-12-12 11:39 ` kernel test robot
2024-12-11 2:01 ` [PATCH bpf v1 4/4] selftests/bpf: Add autogenerated tests for raw_tp NULL args Kumar Kartikeya Dwivedi
2024-12-11 16:02 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241211020156.18966-3-memxor@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chantra@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=kernel-team@fb.com \
--cc=kkd@meta.com \
--cc=martin.lau@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox