Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-30 Thread Maciej Fijalkowski
On Thu, Jul 30, 2020 at 10:16:00PM +0200, Daniel Borkmann wrote: > On 7/29/20 11:10 PM, Maciej Fijalkowski wrote: > > On Wed, Jul 29, 2020 at 06:10:44PM +0200, Maciej Fijalkowski wrote: > > > On Wed, Jul 29, 2020 at 12:07:52AM +0200, Daniel Borkmann wrote: > > > > On 7/24/20 7:35 PM, Maciej Fijalko

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-30 Thread Daniel Borkmann
On 7/29/20 11:10 PM, Maciej Fijalkowski wrote: On Wed, Jul 29, 2020 at 06:10:44PM +0200, Maciej Fijalkowski wrote: On Wed, Jul 29, 2020 at 12:07:52AM +0200, Daniel Borkmann wrote: On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: This commit serves two things: 1) it optimizes BPF prologue/epilogue

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-29 Thread Maciej Fijalkowski
On Wed, Jul 29, 2020 at 06:10:44PM +0200, Maciej Fijalkowski wrote: > On Wed, Jul 29, 2020 at 12:07:52AM +0200, Daniel Borkmann wrote: > > On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: > > > This commit serves two things: > > > 1) it optimizes BPF prologue/epilogue generation > > > 2) it makes poss

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-29 Thread Maciej Fijalkowski
On Wed, Jul 29, 2020 at 12:07:52AM +0200, Daniel Borkmann wrote: > On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: > > This commit serves two things: > > 1) it optimizes BPF prologue/epilogue generation > > 2) it makes possible to have tailcalls within BPF subprogram > > > > Both points are related

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-28 Thread Daniel Borkmann
On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: This commit serves two things: 1) it optimizes BPF prologue/epilogue generation 2) it makes possible to have tailcalls within BPF subprogram Both points are related to each other since without 1), 2) could not be achieved. [...] diff --git a/kerne

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-28 Thread Daniel Borkmann
On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: This commit serves two things: 1) it optimizes BPF prologue/epilogue generation 2) it makes possible to have tailcalls within BPF subprogram [...] [...] diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 7be02e555ab9..d86a35474d7b 100644 --- a

[PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-24 Thread Maciej Fijalkowski
This commit serves two things: 1) it optimizes BPF prologue/epilogue generation 2) it makes possible to have tailcalls within BPF subprogram Both points are related to each other since without 1), 2) could not be achieved. In [1], Alexei says: "The prologue will look like: nop5 xor eax,eax  // tw