On Tue, Dec 2, 2014 at 10:38 PM, Z Lim <zlim....@gmail.com> wrote: > Hi Alexei, > > On Sat, Nov 29, 2014 at 2:46 PM, Alexei Starovoitov <a...@plumgrid.com> wrote: >> classic BPF has a restriction that last insn is always BPF_RET. >> eBPF doesn't have BPF_RET instruction and this restriction. >> It has BPF_EXIT insn which can appear anywhere in the program >> one or more times and it doesn't have to be last insn. > > Just to confirm, in valid eBPF, BPF_EXIT *must* be present at least > once, correct? > Does an eBPF JIT implementation need to check for it?
yes. of course. At least one bpf_exit is always there and there are no loops. verifier is checking for it. So no need for jit to check it again. > I'll cook up a patch for arm64 if you haven't already done so. > Any related test case I should run through? Pending socket samples are generating such code by llvm. I was planning to add an explicit test to test_bpf, but feel free to beat me to it. -- 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/