linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>,
	ast@kernel.org, Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-kernel@vger.kernel.org,
	Michael Holzheu <holzheu@linux.vnet.ibm.com>,
	davem@davemloft.net, yhs@fb.com, linux-arch@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: Fwd: struct pt_regs missing in /usr/include/ tree for eBPF program compile
Date: Tue, 22 Aug 2017 22:01:11 -0700	[thread overview]
Message-ID: <20170823050109.vyubf33dru2fdd3w@ast-mbp> (raw)
In-Reply-To: <20170814120807.GB3305@osiris>

On Mon, Aug 14, 2017 at 02:08:07PM +0200, Heiko Carstens wrote:
> > Now, I would like to avoid going down that road to pull
> > in kernel internal headers into test_verifier.c, could
> > we instead add a bpf_ptregs.h helper in tools/testing/selftests/bpf/,
> > where s390 and arm64 would put a definition to fallback when
> > otherwise not available? Admittedly, it's a bit of a hack
> > if exporting them is not an option, but 'normal' tracing
> > progs would consult kernel headers anyway. Thoughts?
>
> I really don't think that struct pt_regs is part of uapi and should be
> exported. We did change the layout of the pt_regs structure more than once
> and would like to be able to do so in the future as well.

I think Daniel's suggestion above it the best solution and doesn't
prevent future modification to pt_regs on s390.

> We could add the hack you outlined above, but I'd like to have the same API
> for all architectures. Otherwise we keep adding special cases for
> architectures which don't export pt_regs via uapi (which I think is wrong).

I don't see any other choice but to make this hack for s390/arm64
The programs need to be able to access the registers in the format that
kernel keeps, since the programs are attached to kprobe and perf_events
and are walking in-kernel data structures.
It's already well understood that kprobe+bpf is unstable api, so having
pt_regs being unstable on s390/arm64 doesn't make it any worse.

      parent reply	other threads:[~2017-08-23  5:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c8a10777-9da1-461e-0b69-2c1280fa0ee7@linux.vnet.ibm.com>
     [not found] ` <49c5e39b-a7d9-1e2d-24ec-57852f7d1e51@linux.vnet.ibm.com>
     [not found]   ` <CAADnVQKpaF+3EZKMtMBdKLatEQGytqc9YJQQSSFRFQ=7THpvTw@mail.gmail.com>
     [not found]     ` <598492A6.10707@iogearbox.net>
2017-08-14 12:08       ` Fwd: struct pt_regs missing in /usr/include/ tree for eBPF program compile Heiko Carstens
2017-08-14 14:39         ` Arnd Bergmann
2017-08-14 14:39           ` Arnd Bergmann
2017-08-23  5:01         ` Alexei Starovoitov [this message]

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=20170823050109.vyubf33dru2fdd3w@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tmricht@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).