On Fri, Aug 15, 2014 at 11:50 AM, Andy Lutomirski <l...@amacapital.net> wrote: > On Aug 15, 2014 10:36 AM, "Alexei Starovoitov" <a...@plumgrid.com> wrote: >> >> On Fri, Aug 15, 2014 at 10:20 AM, Andy Lutomirski <l...@amacapital.net> >> wrote: >> > The downside of this approach is that compat support might be >> > difficult or impossible. >> >> Would do you mean by compat? 32-bit programs on 64-bit kernels? >> There is no such concept for eBPF. All eBPF programs are always >> operating on 64-bit registers. > > Doesn't the eBPF program need to know sizeof(long) to read these > fields correctly? Or am I misunderstanding what the code does?
correct. eBPF program would be using 8-byte read on 64-bit kernel and 4-byte read on 32-bit kernel. Same with access to ptrace fields and pretty much all other fields in the kernel. The program will be different on different kernels. Say, this bpf_context struct doesn't exist at all. The programs would still need to be different to walk in-kernel data structures... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/