samples/bpf: Enable powerpc support
Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David S. Miller <davem@davemloft.net> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
128d1514be
commit
138d6153a1
@@ -27,10 +27,10 @@ int bpf_prog2(struct pt_regs *ctx)
|
||||
long init_val = 1;
|
||||
long *value;
|
||||
|
||||
/* x64/s390x specific: read ip of kfree_skb caller.
|
||||
/* read ip of kfree_skb caller.
|
||||
* non-portable version of __builtin_return_address(0)
|
||||
*/
|
||||
bpf_probe_read(&loc, sizeof(loc), (void *)PT_REGS_RET(ctx));
|
||||
BPF_KPROBE_READ_RET_IP(loc, ctx);
|
||||
|
||||
value = bpf_map_lookup_elem(&my_map, &loc);
|
||||
if (value)
|
||||
|
Reference in New Issue
Block a user