Re: [PATCH v3 07/29] x86: bpf_jit, use ENTRY+ENDPROC
From: David Miller
Date: Mon Apr 24 2017 - 14:25:03 EST
From: Jiri Slaby <jslaby@xxxxxxx>
Date: Mon, 24 Apr 2017 19:51:54 +0200
> For example what's the point of making the sk_load_word_positive_offset
> label a global, callable function? Note that this is exactly the reason
> why this particular two hunks look weird to you even though the
> annotations only mechanically paraphrase what is in the current code.
So that it can be referenced by the eBPF JIT, because these are
helpers for eBPF JIT generated code. Every architecture implementing
an eBPF JIT has this "mess".
You can't even put a tracepoint or kprobe on these things and expect
to see "arguments" or "return PC" values in the usual spots. This
code has special calling conventions and register usage as Alexei
explained.
I would suggest that you read and understand how this assembler is
designed, how it is called from the generated JIT code, and what it's
semantics and register usage are, before trying to annotating it.
Thank you.