From: Dave Marchevsky <davemarchevsky@fb.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Rik van Riel <riel@surriel.com>,
Ilya Leoshkevich <iii@linux.ibm.com>, Yonghong Song <yhs@fb.com>,
kernel-team@fb.com
Subject: Re: [RFC PATCH bpf-next 5/5] selftests/bpf: get_reg_val test exercising fxsave fetch
Date: Thu, 12 May 2022 13:47:08 -0400 [thread overview]
Message-ID: <5ae1f223-4be4-bd48-e44f-fb4ef52d9a5b@fb.com> (raw)
In-Reply-To: <20220512074321.2090073-6-davemarchevsky@fb.com>
On 5/12/22 3:43 AM, Dave Marchevsky wrote:
> Add a test which calls bpf_get_reg_val with an xmm reg after forcing fpu
> state save. The test program writes to %xmm10, then calls a BPF program
> which forces fpu save and calls bpf_get_reg_val. This guarantees that
> !fpregs_state_valid check will succeed, forcing bpf_get_reg_val to fetch
> %xmm10's value from task's fpu state.
>
> A bpf_testmod_save_fpregs kfunc helper is added to bpf_testmod to enable
> 'force fpu save'. Existing bpf_dummy_ops test infra is extended to
> support calling the kfunc.
>
> unload_bpf_testmod would often fail with -EAGAIN when running the test
> added in this patch, so a single retry w/ 20ms sleep is added.
>
> Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
> ---
> include/linux/bpf.h | 1 +
> kernel/trace/bpf_trace.c | 2 +-
> net/bpf/bpf_dummy_struct_ops.c | 13 ++++++
> .../selftests/bpf/bpf_testmod/bpf_testmod.c | 13 ++++++
> tools/testing/selftests/bpf/prog_tests/usdt.c | 42 +++++++++++++++++++
> .../selftests/bpf/progs/test_urandom_usdt.c | 24 +++++++++++
> tools/testing/selftests/bpf/test_progs.c | 7 ++++
> 7 files changed, 101 insertions(+), 1 deletion(-)
This series wasn't based on latest bpf-next. After rebase, this test
causes kernel panic. Investigating, but patches are still worth a
look.
next prev parent reply other threads:[~2022-05-12 17:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 7:43 [RFC PATCH bpf-next 0/5] bpf: add get_reg_val helper Dave Marchevsky
2022-05-12 7:43 ` [RFC PATCH bpf-next 1/5] x86/fpu: Move context.h to include/asm Dave Marchevsky
2022-05-12 13:56 ` David Vernet
2022-05-14 0:44 ` Alexei Starovoitov
2022-05-12 7:43 ` [RFC PATCH bpf-next 2/5] bpf: add get_reg_val helper Dave Marchevsky
2022-05-12 15:29 ` David Vernet
2022-05-18 8:07 ` Dave Marchevsky
2022-05-14 0:41 ` Alexei Starovoitov
2022-05-18 7:35 ` Dave Marchevsky
2022-05-12 7:43 ` [RFC PATCH bpf-next 3/5] libbpf: usdt lib wiring of xmm reads Dave Marchevsky
2022-05-14 0:43 ` Alexei Starovoitov
2022-05-16 23:26 ` Andrii Nakryiko
2022-05-18 8:20 ` Dave Marchevsky
2022-05-12 7:43 ` [RFC PATCH bpf-next 4/5] selftests/bpf: Add test for USDT parse of xmm reg Dave Marchevsky
2022-05-16 23:31 ` Andrii Nakryiko
2022-05-17 1:17 ` Alexei Starovoitov
2022-05-18 23:56 ` Andrii Nakryiko
2022-05-12 7:43 ` [RFC PATCH bpf-next 5/5] selftests/bpf: get_reg_val test exercising fxsave fetch Dave Marchevsky
2022-05-12 17:47 ` Dave Marchevsky [this message]
2022-05-16 23:28 ` Andrii Nakryiko
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=5ae1f223-4be4-bd48-e44f-fb4ef52d9a5b@fb.com \
--to=davemarchevsky@fb.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=iii@linux.ibm.com \
--cc=kernel-team@fb.com \
--cc=riel@surriel.com \
--cc=yhs@fb.com \
/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