Thread (45 messages) flat view 45 messages, 6 authors, 2019-11-08

Re: [PATCH v2 bpf-next 11/17] bpf: Reserver space for BPF trampoline in BPF programs

From: Andrii Nakryiko <hidden>
Date: 2019-11-08 05:03:45
Also in: bpf

On Wed, Nov 6, 2019 at 9:48 PM Alexei Starovoitov [off-list ref] wrote:
BPF trampoline can be made to work with existing 5 bytes of BPF program
prologue, but let's add 5 bytes of NOPs to the beginning of every JITed BPF
program to make BPF trampoline job easier. They can be removed in the future.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
Acked-by: Andrii Nakryiko <redacted>
quoted hunk ↗ jump to hunk
 arch/x86/net/bpf_jit_comp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 44169e8bffc0..260f61276f18 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -206,7 +206,7 @@ struct jit_context {
 /* number of bytes emit_call() needs to generate call instruction */
 #define X86_CALL_SIZE          5

-#define PROLOGUE_SIZE          20
+#define PROLOGUE_SIZE          25
nit: define as 20 + X86_CALL_SIZE ?

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help