Thread (13 messages) 13 messages, 4 authors, 2021-11-25

Re: [RESEND PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

flat view

From: Christophe Leroy <hidden>
Date: 2021-10-14 08:34:04
Also in: bpf, linuxppc-dev


Le 14/10/2021 à 10:15, David Laight a écrit :
From: Hari Bathini
quoted
Sent: 12 October 2021 13:31

Patch #1 & #2 are simple cleanup patches. Patch #3 refactors JIT
compiler code with the aim to simplify adding BPF_PROBE_MEM support.
Patch #4 introduces PPC_RAW_BRANCH() macro instead of open coding
branch instruction. Patch #5 & #7 add BPF_PROBE_MEM support for PPC64
& PPC32 JIT compilers respectively. Patch #6 & #8 handle bad userspace
pointers for PPC64 & PPC32 cases respectively.
I thought that BPF was only allowed to do fairly restricted
memory accesses - so WTF does it need a BPF_PROBE_MEM instruction?

Looks like it's been added by commit 2a02759ef5f8 ("bpf: Add support for BTF pointers to interpreter")

They say in the log:

    Pointer to BTF object is a pointer to kernel object or NULL.
    The memory access in the interpreter has to be done via probe_kernel_read
    to avoid page faults.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help