Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-19 Thread Yonghong Song
On 6/19/20 10:44 AM, John Fastabend wrote: Yonghong Song wrote: On 6/18/20 7:04 PM, Alexei Starovoitov wrote: On Thu, Jun 18, 2020 at 5:26 PM John Fastabend wrote: foo(int a, __int128 b) would put a in r0 and b in r2 and r3 leaving a hole in r1. But that was some old reference manua

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-19 Thread John Fastabend
Yonghong Song wrote: > > > On 6/18/20 7:04 PM, Alexei Starovoitov wrote: > > On Thu, Jun 18, 2020 at 5:26 PM John Fastabend > > wrote: > >> > >> foo(int a, __int128 b) > >> > >> would put a in r0 and b in r2 and r3 leaving a hole in r1. But that > >> was some old reference manual and might n

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-19 Thread Jiri Olsa
On Thu, Jun 18, 2020 at 03:05:11PM -0700, Alexei Starovoitov wrote: > On Thu, Jun 18, 2020 at 01:48:06PM +0200, Jiri Olsa wrote: > > On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > > > Jiri Olsa wrote: > > > > This way we can have trampoline on function > > > > that has arguments

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread Yonghong Song
On 6/18/20 7:04 PM, Alexei Starovoitov wrote: On Thu, Jun 18, 2020 at 5:26 PM John Fastabend wrote: foo(int a, __int128 b) would put a in r0 and b in r2 and r3 leaving a hole in r1. But that was some old reference manual and might no longer be the case This should not happen if clang

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread Alexei Starovoitov
On Thu, Jun 18, 2020 at 5:26 PM John Fastabend wrote: > > foo(int a, __int128 b) > > would put a in r0 and b in r2 and r3 leaving a hole in r1. But that > was some old reference manual and might no longer be the case > in reality. Perhaps just spreading hearsay, but the point is we > should say

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread John Fastabend
Andrii Nakryiko wrote: > On Thu, Jun 18, 2020 at 3:50 PM John Fastabend > wrote: > > > > Jiri Olsa wrote: > > > On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > > > > Jiri Olsa wrote: > > > > > This way we can have trampoline on function > > > > > that has arguments with types li

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread Andrii Nakryiko
On Thu, Jun 18, 2020 at 3:50 PM John Fastabend wrote: > > Jiri Olsa wrote: > > On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > > > Jiri Olsa wrote: > > > > This way we can have trampoline on function > > > > that has arguments with types like: > > > > > > > > kuid_t uid > > > >

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread John Fastabend
Jiri Olsa wrote: > On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > > Jiri Olsa wrote: > > > This way we can have trampoline on function > > > that has arguments with types like: > > > > > > kuid_t uid > > > kgid_t gid > > > > > > which unwind into small structs like: > > >

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread Alexei Starovoitov
On Thu, Jun 18, 2020 at 01:48:06PM +0200, Jiri Olsa wrote: > On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > > Jiri Olsa wrote: > > > This way we can have trampoline on function > > > that has arguments with types like: > > > > > > kuid_t uid > > > kgid_t gid > > > > > > whi

Re: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-18 Thread Jiri Olsa
On Wed, Jun 17, 2020 at 04:20:54PM -0700, John Fastabend wrote: > Jiri Olsa wrote: > > This way we can have trampoline on function > > that has arguments with types like: > > > > kuid_t uid > > kgid_t gid > > > > which unwind into small structs like: > > > > typedef struct { > > ui

RE: [PATCH] bpf: Allow small structs to be type of function argument

2020-06-17 Thread John Fastabend
Jiri Olsa wrote: > This way we can have trampoline on function > that has arguments with types like: > > kuid_t uid > kgid_t gid > > which unwind into small structs like: > > typedef struct { > uid_t val; > } kuid_t; > > typedef struct { > gid_t val; > } kgid_t; > >

[PATCH] bpf: Allow small structs to be type of function argument

2020-06-16 Thread Jiri Olsa
This way we can have trampoline on function that has arguments with types like: kuid_t uid kgid_t gid which unwind into small structs like: typedef struct { uid_t val; } kuid_t; typedef struct { gid_t val; } kgid_t; And we can use them in bpftrace like: (assuming d_