why eBPF programs need some passes to get jited code?

Viewed 59

I'm new to eBPF, I am reading the source code from linux kernel tree arch/x86/net/bpf_jit_comp.c. I noticed there are some passes needed for the final jited image. I'm very confused about this. Toturial says JITed image shrinks with every pass and the loop iterates until the image stops shrinking. Could you give me an example? As far as I am concerned, eBPF jit is a one-to-one mapping, how can the image shrink?

1 Answers

Thanks for qmo .Maybe this can be helpful. I think this is due to the x86 instruction length is not fixed and some passes are needed for relocation.

Related