Re: [PATCH bpf-next v2 02/10] s390/bpf: Add orig_gpr2 to user_pt_regs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
> > ---
> >  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.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux