On 10/4/19 10:03 PM, Alexei Starovoitov wrote: > Pointer to BTF object is a pointer to kernel object or NULL. > Such pointers can only be used by BPF_LDX instructions. > The verifier changed their opcode from LDX|MEM|size > to LDX|PROBE_MEM|size to make JITing easier. > The number of entries in extable is the number of BPF_LDX insns > that access kernel memory via "pointer to BTF type". ... > } > if (proglen == oldproglen) { > - header = bpf_jit_binary_alloc(proglen, &image, > - 1, jit_fill_hole); > + /* > + * The number of entries in extable is the number of > BPF_LDX > + * insns that access kernel memory via "pointer to BTF > type". > + * The verifier changed their opcode from LDX|MEM|size > + * to LDX|PROBE_MEM|size to make JITing easier. > + */ > + u32 extable_size = prog->aux->num_exentries * > + sizeof(struct exception_table_entry); > + > + /* allocate module memory for x86 insns and extable */ > + header = bpf_jit_binary_alloc(proglen + extable_size, > + &image, 1, jit_fill_hole); > if (!header) { > prog = orig_prog; > goto out_addrs; > } > + prog->aux->extable = (void *) image + proglen; You might want to align ->extable to __alignof__(struct exception_table_entry) (4 bytes currently)
- [PATCH bpf-next 01/10] bpf: add typecast to raw_tracepo... Alexei Starovoitov
- Re: [PATCH bpf-next 01/10] bpf: add typecast to ra... Andrii Nakryiko
- RE: [PATCH bpf-next 01/10] bpf: add typecast to ra... John Fastabend
- [PATCH bpf-next 02/10] bpf: add typecast to bpf helpers... Alexei Starovoitov
- Re: [PATCH bpf-next 02/10] bpf: add typecast to bp... Andrii Nakryiko
- RE: [PATCH bpf-next 02/10] bpf: add typecast to bp... John Fastabend
- [PATCH bpf-next 09/10] bpf: disallow bpf_probe_read[_st... Alexei Starovoitov
- Re: [PATCH bpf-next 09/10] bpf: disallow bpf_probe... Andrii Nakryiko
- Re: [PATCH bpf-next 09/10] bpf: disallow bpf_p... Alexei Starovoitov
- [PATCH bpf-next 07/10] bpf: add support for BTF pointer... Alexei Starovoitov
- Re: [PATCH bpf-next 07/10] bpf: add support for BT... Eric Dumazet
- Re: [PATCH bpf-next 07/10] bpf: add support for BT... Andrii Nakryiko
- Re: [PATCH bpf-next 07/10] bpf: add support fo... Alexei Starovoitov
- [PATCH bpf-next 06/10] bpf: add support for BTF pointer... Alexei Starovoitov
- Re: [PATCH bpf-next 06/10] bpf: add support for BT... Andrii Nakryiko
- [PATCH bpf-next 08/10] bpf: check types of arguments pa... Alexei Starovoitov
- Re: [PATCH bpf-next 08/10] bpf: check types of arg... Andrii Nakryiko
- Re: [PATCH bpf-next 08/10] bpf: check types of... Alexei Starovoitov