From: Puranjay Mohan <puranjay@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>,
Manu Bretelle <chantra@meta.com>, KP Singh <kpsingh@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Mykola Lysenko <mykolal@meta.com>,
Alexei Starovoitov <ast@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Florent Revest <revest@google.com>
Subject: Re: [PATCH bpf] selftests/bpf: DENYLIST.aarch64: Remove fexit_sleep
Date: Mon, 15 Jul 2024 16:31:48 +0000 [thread overview]
Message-ID: <mb61pjzhmpqff.fsf@kernel.org> (raw)
In-Reply-To: <978e127b-4967-950d-ccca-8575d1a885ae@iogearbox.net>
[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]
Hi Daniel, Manu
I was able to reproduce this issue on KVM and found the root cause for
this hang! The other issue that we fixed is unrelated to this hang and
doesn't occur on self hosted github runners as they use 48-bit VAs.
The userspace test code has:
#define STACK_SIZE (1024 * 1024)
static char child_stack[STACK_SIZE];
cpid = clone(do_sleep, child_stack + STACK_SIZE, CLONE_FILES | SIGCHLD, fexit_skel);
arm64 requires the stack pointer to be 16 byte aligned otherwise
SPAlignmentFault occurs, this appears as Bus error in the userspace.
The stack provided to the clone system call is not guaranteed to be
aligned properly in this selftest.
The test hangs on the following line:
while (READ_ONCE(fexit_skel->bss->fentry_cnt) != 2);
Because the child process is killed due to SPAlignmentFault, the
fentry_cnt remains at 0!
Reading the man page of clone system call, the correct way to allocate
stack for this call is using mmap like this:
stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
This fixes the issue, I will send a patch to use this and once again
remove this test from DENYLIST and I hope this time it fixes it for good.
> It looks like there is still an issue left. A recent CI run on bpf-next is
> still hitting the same on arm64:
>
> Base:
>
> https://github.com/kernel-patches/bpf/commits/series/870746%3D%3Ebpf-next/
>
> CI:
>
> https://github.com/kernel-patches/bpf/actions/runs/9905842936/job/27366435436
>
> [...]
> #89/11 fexit_bpf2bpf/func_replace_global_func:OK
> #89/12 fexit_bpf2bpf/fentry_to_cgroup_bpf:OK
> #89/13 fexit_bpf2bpf/func_replace_progmap:OK
> #89 fexit_bpf2bpf:OK
> Error: The operation was canceled.
Thanks,
Puranjay
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]
next prev parent reply other threads:[~2024-07-15 16:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 14:50 [PATCH bpf] selftests/bpf: DENYLIST.aarch64: Remove fexit_sleep Puranjay Mohan
2024-07-08 14:52 ` Daniel Borkmann
2024-07-08 15:00 ` Puranjay Mohan
2024-07-08 15:26 ` KP Singh
2024-07-08 15:29 ` Daniel Borkmann
2024-07-08 15:31 ` Florent Revest
2024-07-08 15:35 ` Puranjay Mohan
2024-07-08 16:09 ` Daniel Borkmann
2024-07-08 16:42 ` KP Singh
2024-07-09 17:44 ` Daniel Borkmann
2024-07-09 19:06 ` Manu Bretelle
2024-07-10 7:18 ` Puranjay Mohan
2024-07-11 14:00 ` Puranjay Mohan
2024-07-11 15:55 ` Daniel Borkmann
2024-07-12 13:50 ` Daniel Borkmann
2024-07-12 16:07 ` Alexei Starovoitov
2024-07-12 16:19 ` Daniel Borkmann
2024-07-15 16:31 ` Puranjay Mohan [this message]
2024-07-15 17:07 ` Alexei Starovoitov
2024-07-15 17:32 ` Puranjay Mohan
2024-07-12 17:27 ` Manu Bretelle
2024-07-12 18:08 ` Puranjay Mohan
2024-07-12 19:59 ` Manu Bretelle
2024-07-08 20:30 ` patchwork-bot+netdevbpf
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=mb61pjzhmpqff.fsf@kernel.org \
--to=puranjay@kernel.org \
--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=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@meta.com \
--cc=revest@google.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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