From: Heiko Carstens <hca@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Paul Walmsley <paul.walmsley@sifive.com>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 02/10] s390/bpf: Add orig_gpr2 to user_pt_regs
Date: Fri, 4 Feb 2022 11:09:33 +0100 [thread overview]
Message-ID: <Yfz7XZi65R+hdDwW@osiris> (raw)
In-Reply-To: <CAEf4BzYPdqLE152BZo2twbd9FkpG2vahOFqNM6eYXzdWzDUPLQ@mail.gmail.com>
On Thu, Feb 03, 2022 at 09:19:42PM -0800, Andrii Nakryiko wrote:
> On Thu, Feb 3, 2022 at 8:20 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
> >
> > user_pt_regs is used by eBPF in order to access userspace registers -
> > see commit 466698e654e8 ("s390/bpf: correct broken uapi for
> > BPF_PROG_TYPE_PERF_EVENT program type"). In order to access the first
> > syscall argument from eBPF programs, we need to export orig_gpr2.
> >
> > args member is not in use since commit 56e62a737028 ("s390: convert to
> > generic entry"), so move orig_gpr2 in its place.
> >
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> > arch/s390/include/asm/ptrace.h | 3 +--
> > arch/s390/include/uapi/asm/ptrace.h | 2 +-
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
> > index 4ffa8e7f0ed3..0278bacd61be 100644
> > --- a/arch/s390/include/asm/ptrace.h
> > +++ b/arch/s390/include/asm/ptrace.h
> > @@ -80,12 +80,11 @@ struct pt_regs {
> > union {
> > user_pt_regs user_regs;
> > struct {
> > - unsigned long args[1];
> > + unsigned long orig_gpr2;
> > psw_t psw;
> > unsigned long gprs[NUM_GPRS];
> > };
> > };
> > - unsigned long orig_gpr2;
>
> Please don't change the physical location of this field, it
> effectively breaks libbpf's syscall tracing macro on all older
> kernels. Let's do what you did in the previous revision and just
> expose the field at its correct offset. That way with up to date UAPI
> header or vmlinux.h all this will work even on old kernels (even
> without CO-RE).
That's (unfortunately) a valid argument. So looks like we can't get rid of
the args member now. Maybe we can put something else there or simply rename
it to "dontuse".
Anyway, that's not within the scope of this patch series.
next prev parent reply other threads:[~2022-02-04 10:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 4:19 [PATCH bpf-next v2 00/10] libbpf: Fix accessing syscall arguments Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 01/10] arm64/bpf: Add orig_x0 to user_pt_regs Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 02/10] s390/bpf: Add orig_gpr2 " Ilya Leoshkevich
2022-02-04 5:19 ` Andrii Nakryiko
2022-02-04 10:09 ` Heiko Carstens [this message]
2022-02-04 4:19 ` [PATCH bpf-next v2 03/10] selftests/bpf: Fix an endianness issue in bpf_syscall_macro test Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 04/10] libbpf: Add __PT_PARM1_REG_SYSCALL macro Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 05/10] libbpf: Add PT_REGS_SYSCALL macro Ilya Leoshkevich
2022-02-04 5:22 ` Andrii Nakryiko
2022-02-04 5:23 ` Andrii Nakryiko
2022-02-04 12:29 ` Ilya Leoshkevich
2022-02-04 18:09 ` Andrii Nakryiko
2022-02-04 4:19 ` [PATCH bpf-next v2 06/10] selftests/bpf: Use PT_REGS_SYSCALL in bpf_syscall_macro Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 07/10] libbpf: Fix accessing the first syscall argument on arm64 Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 08/10] libbpf: Fix accessing syscall arguments on powerpc Ilya Leoshkevich
2022-02-04 4:19 ` [PATCH bpf-next v2 09/10] libbpf: Fix accessing syscall arguments on riscv Ilya Leoshkevich
2022-02-04 5:25 ` Andrii Nakryiko
2022-02-04 4:19 ` [PATCH bpf-next v2 10/10] libbpf: Fix accessing the first syscall argument on s390 Ilya Leoshkevich
2022-02-04 5:28 ` [PATCH bpf-next v2 00/10] libbpf: Fix accessing syscall arguments 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=Yfz7XZi65R+hdDwW@osiris \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@iogearbox.net \
--cc=gor@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=paul.walmsley@sifive.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