diff options
author | Ilya Leoshkevich <[email protected]> | 2019-07-11 16:29:29 +0200 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2019-07-12 15:38:14 +0200 |
commit | 7cd04535abc95c50ba9bfa48efc76274b63c70f5 (patch) | |
tree | 93c528eba51d88121b8cda494171e2ec7bbd67a7 /net/lapb/lapb_timer.c | |
parent | 05c2dc17dae310f92a0c5979e227133b0e85f2fa (diff) |
selftests/bpf: make PT_REGS_* work in userspace
Right now, on certain architectures, these macros are usable only with
kernel headers. This patch makes it possible to use them with userspace
headers and, as a consequence, not only in BPF samples, but also in BPF
selftests.
On s390, provide the forward declaration of struct pt_regs and cast it
to user_pt_regs in PT_REGS_* macros. This is necessary, because instead
of the full struct pt_regs, s390 exposes only its first member
user_pt_regs to userspace, and bpf_helpers.h is used with both userspace
(in selftests) and kernel (in samples) headers. It was added in commit
466698e654e8 ("s390/bpf: correct broken uapi for
BPF_PROG_TYPE_PERF_EVENT program type").
Ditto on arm64.
On x86, provide userspace versions of PT_REGS_* macros. Unlike s390 and
arm64, x86 provides struct pt_regs to both userspace and kernel, however,
with different member names.
Signed-off-by: Ilya Leoshkevich <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Reviewed-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions