On Thu, 2020-11-26 at 23:00 -0800, Yonghong Song wrote:
> On 11/26/20 8:44 AM, Florent Revest wrote:
> > +SEC("iter/task_file")
> > +int fill_socket_owner(struct bpf_iter__task_file *ctx)
> > +{
> > + struct task_struct *task = ctx->task;
> > +
On Fri, 2020-11-27 at 03:32 +0100, KP Singh wrote:
> > + ret = strlen(name) + 1;
> > + if (symbol_size) {
> > + strncpy(symbol, name, symbol_size);
> > + symbol[symbol_size - 1] = '\0';
> > + }
> > +
> > + if (modname && module_size) {
> > +
On Fri, 2020-11-27 at 10:25 +0100, Florent Revest wrote:
> I prefer Yongonhong's suggestion of having two helpers.
Argh! I hit enter too fast! Yonghong*, sorry :|
On Sat, Jan 23, 2021 at 9:45 PM Yonghong Song wrote:
> On 1/22/21 7:34 AM, Florent Revest wrote:
> > On Wed, Jan 20, 2021 at 8:06 PM Florent Revest wrote:
> >>
> >> On Wed, Jan 20, 2021 at 8:04 PM Alexei Starovoitov
> >> wrote:
> >>>
>
On Wed, Jan 27, 2021 at 10:01 PM Andrii Nakryiko
wrote:
>
> On Tue, Jan 26, 2021 at 10:36 AM Florent Revest wrote:
> >
> > This needs a new helper that:
> > - can work in a sleepable context (using sock_gen_cookie)
> > - takes a struct sock pointer and checks tha
On Fri, Jan 29, 2021 at 1:49 PM Daniel Borkmann wrote:
>
> On 1/29/21 11:57 AM, Daniel Borkmann wrote:
> > On 1/27/21 10:01 PM, Andrii Nakryiko wrote:
> >> On Tue, Jan 26, 2021 at 10:36 AM Florent Revest
> >> wrote:
> >>>
> >>> This ne
by: Daniel Borkmann
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..0b
This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8
kernel
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
tools/testing/selftests/bpf/.gitignore| 1 -
tools/testing/selftests/bpf/Makefile
e need to extract ctx->sk in a variable before checking and
dereferencing it.
Acked-by: KP Singh
Signed-off-by: Florent Revest
---
.../testing/selftests/bpf/progs/socket_cookie_prog.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
.../selftests/bpf/prog_tests/socket_cookie.c | 11 --
.../selftests/bpf/progs
On Thu, 2017-08-31 at 11:23 +0200, Christoffer Dall wrote:
> > diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
> > index 2ea21da..1d2d3df 100644
> > --- a/virt/kvm/arm/mmu.c
> > +++ b/virt/kvm/arm/mmu.c
> > @@ -772,6 +772,11 @@ static void stage2_unmap_memslot(struct kvm
> > *kvm,
> >
On Thu, 2017-08-31 at 11:26 +0200, Christoffer Dall wrote:
> I wonder if this should be split into two series; one that sets up
> anything you may need from KVM, and another one that uses that for
> UEFI.
>
> There's a lot KVM and UEFI intertwined logic and assumptions in patch
> 10, which makes
On Fri, 2017-09-22 at 14:44 -0700, Ard Biesheuvel wrote:
> From the EFI side, there are some minor concerns on my part regarding
> the calling convention, and the fact that we can no longer invoke
> runtime services from a kernel running at EL1, but those all seem
> fixable. I will respond to the
d/1RLkH3QxdmrcW_t41KllEvUmVsrHMbMOgd6CqAgzR7U4/pub?slide=id.p
[3] https://lwn.net/Articles/688585/
[4] https://lwn.net/Articles/641204/
[5] https://github.com/FlorentRevest/linux-sunxi-cedrus
[6] https://github.com/FlorentRevest/sunxi-cedrus-drv-video
Florent Revest (9):
clk: sunxi-ng: Add a couple
This control is to be used with the new low-level decoder API for MPEG4
to provide additional parameters for the hardware that cannot parse the
input stream.
Some fields are still missing for this structure to be complete.
Signed-off-by: Florent Revest
---
drivers/media/v4l2-core/v4l2-ctrls.c
Now that we have a driver matching "allwinner,sun5i-a13-video-engine" we
can load it.
The "video-engine" node depends on the new sunxi-ng's CCU clock and
reset bindings. This patch also includes a ve_reserved DMA pool for
videobuf2 buffer allocations in sunxi-cedrus.
Si
This control is to be used with the new low-level decoder API for
MPEG2 to provide additional parameters for the hardware that cannot parse
the input stream.
Signed-off-by: Florent Revest
---
drivers/media/v4l2-core/v4l2-ctrls.c | 11 +++
drivers/media/v4l2-core/v4l2-ioctl.c | 1
Device Tree bindings for the Allwinner's video engine
Signed-off-by: Florent Revest
---
.../devicetree/bindings/media/sunxi-cedrus.txt | 44 ++
1 file changed, 44 insertions(+)
create mode 100644 Documentation/devicetree/bindings/media/sunxi-cedrus.txt
diff --git
This patch introduces the support of MPEG2 video decoding to the
sunxi-cedrus video decoder driver.
Signed-off-by: Florent Revest
---
drivers/media/platform/sunxi-cedrus/Makefile | 2 +-
drivers/media/platform/sunxi-cedrus/sunxi_cedrus.c | 26 +++-
.../platform/sunxi-cedrus
Add support for the allwinner's proprietary pixel format described in
details here: http://linux-sunxi.org/File:Ve_tile_format_v1.pdf
This format is similar to V4L2_PIX_FMT_NV12M but the planes are divided
in tiles of 32x32px.
Signed-off-by: Florent Revest
---
include/uapi/linux/videodev2.h
This patch introduces the support of MPEG4 video decoding to the
sunxi-cedrus video decoder driver.
Signed-off-by: Florent Revest
---
drivers/media/platform/sunxi-cedrus/Makefile | 3 +-
drivers/media/platform/sunxi-cedrus/sunxi_cedrus.c | 15 +++
.../platform/sunxi-cedrus
Add a new style driver for the clock control unit in Allwinner A13.
Only AVS and VE are supported since they weren't provided until now and are
needed for "sunxi-cedrus".
Signed-off-by: Florent Revest
---
.../devicetree/bindings/clock/sunxi-ccu.txt| 1 +
arch/arm/boot/dts
From: Pawel Osciak
V4L2_CTRL_TYPE_PRIVATE is to be used for private driver compound
controls that use the "ptr" member of struct v4l2_ext_control.
Signed-off-by: Pawel Osciak
Signed-off-by: Jung Zhao
Signed-off-by: Florent Revest
---
drivers/media/v4l2-core/v4l2-ctrls.c | 4 +++
ngineering on which I based my work comes from the
"Cedrus" project: http://linux-sunxi.org/Cedrus
The driver currently only runs on the A13 and this patch doesn't
include any codec.
Signed-off-by: Florent Revest
---
drivers/media/platform/Kconfig | 13 +
dr
On Mon, 2020-12-07 at 10:39 -0800, Randy Dunlap wrote:
> On 12/7/20 1:25 AM, Stephen Rothwell wrote:
> > Hi all,
> >
> > Changes since 20201204:
> >
>
> on i386:
> # CONFIG_NET is not set
>
> ld: kernel/trace/bpf_trace.o: in function `bpf_sock_from_file':
> bpf_trace.c:(.text+0xe23): undefined
This avoids
ld: kernel/trace/bpf_trace.o: in function `bpf_sock_from_file':
bpf_trace.c:(.text+0xe23): undefined reference to `sock_from_file'
When compiling a kernel with BPF and without NET.
Reported-by: Randy Dunlap
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 4
1
On Mon, 2020-12-07 at 20:55 +0100, Florent Revest wrote:
> This avoids
> ld: kernel/trace/bpf_trace.o: in function `bpf_sock_from_file':
> bpf_trace.c:(.text+0xe23): undefined reference to `sock_from_file'
> When compiling a kernel with BPF and without NET.
>
> Reporte
This avoids
ld: kernel/trace/bpf_trace.o: in function `bpf_sock_from_file':
bpf_trace.c:(.text+0xe23): undefined reference to `sock_from_file'
When compiling a kernel with BPF and without NET.
Reported-by: Randy Dunlap
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 4
1
On Mon, 2020-12-07 at 14:09 +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the block tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> fs/io_uring.c: In function 'io_shutdown':
> fs/io_uring.c:3782:9: error: too many arguments to function
>
On Mon, 2020-12-07 at 13:33 -0800, Martin KaFai Lau wrote:
> On Mon, Dec 07, 2020 at 09:06:05PM +0100, Florent Revest wrote:
> > This avoids
> > ld: kernel/trace/bpf_trace.o: in function `bpf_sock_from_file':
> > bpf_trace.c:(.text+0xe23): undefined reference to
> >
':
bpf_trace.c:(.text+0xe23): undefined reference to `sock_from_file'
When compiling a kernel with BPF and without NET.
Reported-by: kernel test robot
Reported-by: Randy Dunlap
Acked-by: Randy Dunlap
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/trace/bpf_trace.c | 22
attachment strategy and different headers.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/socket_cookie.c | 24 +++
.../selftests/bpf/progs/socket_cookie_prog.c | 41 ---
2 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/tools/testing
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/Makefile | 3 +-
.../selftests/bpf/prog_tests/socket_cookie.c | 82
On Tue, 2020-12-08 at 12:06 -0800, Randy Dunlap wrote:
> On 12/8/20 9:36 AM, Florent Revest wrote:
> > Acked-by: Randy Dunlap
>
> I would say that I didn't ack this version of the patch (hey,
> it's 3x the size of the v1/v2 patches), but I have just
> rebuilt with v3, so the
by: Daniel Borkmann
Signed-off-by: Florent Revest
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 30b477a26482..ba59309f4d18 100644
---
types such as LSM.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 2 ++
include/uapi/linux/bpf.h | 7 +++
kernel/trace/bpf_trace.c | 4
net/core/filter.c | 24
tools/include/uapi/linux/bpf.h | 7 +++
5 files
On Fri, 2020-12-04 at 20:03 +0100, Daniel Borkmann wrote:
> On 12/4/20 7:56 PM, Daniel Borkmann wrote:
> > On 12/3/20 10:33 PM, Florent Revest wrote:
> > > This creates a new helper proto because the existing
> > > bpf_get_socket_cookie_sock_proto has a ARG_PTR_TO_
On Fri, 2020-12-04 at 11:47 -0800, Martin KaFai Lau wrote:
> On Thu, Dec 03, 2020 at 10:33:28PM +0100, Florent Revest wrote:
> > +const struct bpf_func_proto
> > bpf_get_socket_cookie_sock_tracing_proto = {
> > + .func = bpf_get_socket_cookie_sock,
> >
On Mon, Feb 1, 2021 at 11:37 PM Alexei Starovoitov
wrote:
>
> On Mon, Feb 1, 2021 at 2:32 PM Daniel Borkmann wrote:
> >
> > On 1/30/21 12:45 PM, Florent Revest wrote:
> > > On Fri, Jan 29, 2021 at 1:49 PM Daniel Borkmann
> > > wrote:
> > >
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
.../selftests/bpf/prog_tests/socket_cookie.c | 11 --
.../selftests/bpf/progs
e need to extract ctx->sk in a variable before checking and
dereferencing it.
Acked-by: KP Singh
Acked-by: Andrii Nakryiko
Signed-off-by: Florent Revest
---
.../testing/selftests/bpf/progs/socket_cookie_prog.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tool
by: Daniel Borkmann
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..0b
This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8
kernel
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
Acked-by: KP Singh
Acked-by: Andrii Nakryiko
---
tools/testing/selftests/bpf/.gitignore| 1 -
tools/testing
On Wed, Feb 10, 2021 at 8:52 PM Andrii Nakryiko
wrote:
>
> On Wed, Feb 10, 2021 at 3:14 AM Florent Revest wrote:
> >
> > This needs a new helper that:
> > - can work in a sleepable context (using sock_gen_cookie)
> > - takes a struct sock pointer and checks that it
a per-cpu temporary buffer
- Addressed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
libbpf
specifiers to print symbols.
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 529 ++-
1 file changed, 244 insertions(+), 285 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 0d23755c2747..0fdca94a3c9c 100644
: Add bpf_iter support")
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 26 ++
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9ef37707888..d9a4c3f77ff4 100644
--- a/too
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
string validation, currently done in formatting
helper calls, into the verifier logic. This makes debugging easier and
also slightly improves the runtime performance.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 6
include/uapi/linux/bpf.h | 28
This exercises most of the format specifiers when things go well.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 65 +++
.../selftests/bpf/progs/test_snprintf.c | 59 +
2 files changed, 124 insertions(+)
create mode
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a/tools/lib/bpf
On Tue, Mar 23, 2021 at 4:21 AM Alexei Starovoitov
wrote:
>
> On Wed, Mar 10, 2021 at 11:02:08PM +0100, Florent Revest wrote:
> >
> > +struct bpf_snprintf_buf {
> > + char buf[MAX_SNPRINTF_MEMCPY][MAX_SNPRINTF_STR_LEN];
> > +};
> > +static DE
[Sorry for the late replies, I'm just back from a long easter break :)]
On Fri, Mar 26, 2021 at 11:51 PM Andrii Nakryiko
wrote:
> On Fri, Mar 26, 2021 at 2:53 PM Andrii Nakryiko
> wrote:
> > On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > > Unfortunatel
On Fri, Mar 26, 2021 at 11:23 PM Andrii Nakryiko
wrote:
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > +
> > + map_off = reg->off + reg->var_off.value;
> > + err = map->ops->map_direct_value_addr(map, _addr,
> >
On Sat, Mar 27, 2021 at 12:05 AM Andrii Nakryiko
wrote:
>
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> >
> > This exercises most of the format specifiers when things go well.
> >
> > Signed-off-by: Florent Revest
> > ---
>
> Looks good.
On Sat, Mar 27, 2021 at 12:01 AM Andrii Nakryiko
wrote:
>
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> >
> > When initializing the __param array with a one liner, if all args are
> > const, the initial array value will be placed in the rodata section but
On Fri, Mar 26, 2021 at 11:55 PM Andrii Nakryiko
wrote:
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > The implementation takes inspiration from the existing bpf_trace_printk
> > helper but there are a few differences:
> >
> > To allow for a large
On Tue, Mar 16, 2021 at 2:25 AM Andrii Nakryiko
wrote:
>
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> >
> > The implementation takes inspiration from the existing bpf_trace_printk
> > helper but there are a few differences:
> >
> > To allow for
On Wed, Mar 17, 2021 at 2:02 AM Andrii Nakryiko
wrote:
> On Tue, Mar 16, 2021 at 5:46 PM Florent Revest wrote:
> > On Wed, Mar 17, 2021 at 1:35 AM Andrii Nakryiko
> > wrote:
> > > On Tue, Mar 16, 2021 at 4:58 PM Florent Revest
> > > wrote:
> > >
On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote:
> On 3/9/21 7:43 PM, Yonghong Song wrote:
> > On 3/9/21 5:54 PM, Florent Revest wrote:
> >> I noticed that initializing an array of pointers using this syntax:
> >> __u64 array[] = { (__u64), (__u64) };
> >>
relocation should be supported
by libbpf but this would require a disproportionate amount of work given
the actual usecases. (it is very unlikely that one uses a const array of
relocated addresses)
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 30 +-
1 file
On Wed, Mar 10, 2021 at 10:51 PM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 12:12 PM Andrii Nakryiko
> wrote:
> > On Wed, Mar 10, 2021 at 8:59 AM Yonghong Song wrote:
> > > On 3/10/21 3:48 AM, Florent Revest wrote:
> > > > On Wed, Mar 10, 202
string validation, currently done in formatting
helper calls, into the verifier logic. This makes debugging easier and
also slightly improves the runtime performance.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 4 +
include/uapi/linux/bpf.h | 28 +++
kernel/bpf
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 15 +++
1 file changed, 15 insertions(+)
diff --git a/tools/lib/bpf
This exercices most of the format specifiers when things go well.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 71 +++
.../selftests/bpf/progs/test_snprintf.c | 71 +++
2 files changed, 142 insertions(+)
create mode
/20210310015455.1095207-1-rev...@chromium.org/T/#u
Florent Revest (5):
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
libbpf: Introduce a BPF_SNPRINTF helper macro
selftests/bpf: Add a series
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a NULL character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
On Wed, Mar 17, 2021 at 1:35 AM Andrii Nakryiko
wrote:
> On Tue, Mar 16, 2021 at 4:58 PM Florent Revest wrote:
> > On Tue, Mar 16, 2021 at 2:03 AM Andrii Nakryiko
> > wrote:
> > > On Wed, Mar 10, 2021 at 2:02 PM Florent Revest
> > > wrote:
&g
On Tue, Mar 16, 2021 at 5:36 AM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> > +#define ___bpf_build_param0(narg, x)
> > +#define ___bpf_build_param1(narg, x) ___param[narg - 1] = x
> > +#define ___bpf_build_param2(narg, x, args...) _
On Tue, Mar 16, 2021 at 2:03 AM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> > + } else if (arg_type == ARG_PTR_TO_CONST_STR) {
> > + struct bpf_map *map = reg->map_ptr;
> > + int map_off, i;
> >
=STR1 str2=STR2 '
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/prog_tests/bug.c | 41 +++
tools/testing/selftests/bpf/progs/test_bug.c | 43
2 files changed, 84 insertions(+)
create mode 100644 tools/testing/selftests/bpf/prog_tests/bug.c
On Thu, Apr 8, 2021 at 12:03 AM Andrii Nakryiko
wrote:
> On Tue, Apr 6, 2021 at 9:06 AM Florent Revest wrote:
> > On Fri, Mar 26, 2021 at 11:55 PM Andrii Nakryiko
> > wrote:
> > > On Tue, Mar 23, 2021 at 7:23 PM Florent Revest
> > > wrote:
> > > >
On Wed, Apr 7, 2021 at 11:54 PM Andrii Nakryiko
wrote:
> On Tue, Apr 6, 2021 at 8:35 AM Florent Revest wrote:
> > On Fri, Mar 26, 2021 at 11:51 PM Andrii Nakryiko
> > wrote:
> > > On Fri, Mar 26, 2021 at 2:53 PM Andrii Nakryiko
> > > wrote:
> > >
On Thu, Apr 15, 2021 at 12:16 AM Andrii Nakryiko
wrote:
>
> On Wed, Apr 14, 2021 at 2:21 AM Florent Revest wrote:
> >
> > On Wed, Apr 14, 2021 at 1:21 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest
> &
On Thu, Apr 15, 2021 at 12:57 AM Andrii Nakryiko
wrote:
>
> On Wed, Apr 14, 2021 at 2:46 AM Florent Revest wrote:
> >
> > On Wed, Apr 14, 2021 at 1:16 AM Andrii Nakryiko
> > wrote:
> > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest
> > > wrote
On Thu, Apr 15, 2021 at 2:28 AM Andrii Nakryiko
wrote:
> On Wed, Apr 14, 2021 at 11:58 AM Martin KaFai Lau wrote:
> > On Wed, Apr 14, 2021 at 05:56:32PM +0200, Florent Revest wrote:
> > > It is just missing a ';'. This macro is not used by any test yet.
> > >
> >
On Thu, Apr 15, 2021 at 2:38 AM Andrii Nakryiko
wrote:
> On Wed, Apr 14, 2021 at 11:54 AM Florent Revest wrote:
> > +static int try_get_fmt_tmp_buf(char **tmp_buf)
> > +{
> > + struct bpf_printf_buf *bufs;
> > + int used;
> > +
> > + if
This exercises most of the format specifiers.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
.../selftests/bpf/prog_tests/snprintf.c | 81 +++
.../selftests/bpf/progs/test_snprintf.c | 74 +
2 files changed, 155 insertions(+)
create
symbols.
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 529 ++-
1 file changed, 248 insertions(+), 281 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 0d23755c2747..3ce9aeee6681 100644
--- a/kernel/trace
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a/tools/lib/bpf
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 6
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c | 2 ++
kernel/bpf/verifier.c | 41
: Add bpf_iter support")
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 40 +++--
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9ef37707888..1c2e91ee041d 100644
--- a
.
- bpf_snprintf's str_size can now be 0
- bpf_snprintf is now exposed to all BPF program types
- We now preempt_disable when using a per-cpu temporary buffer
- Addressed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR
: Add bpf_iter support")
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 40 +++--
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9
of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c | 50
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff
symbols.
The implementation is also moved from bpf_trace.c to helpers.c because
the upcoming bpf_snprintf helper will be made available to all BPF
programs and will need it.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 20 +++
kernel/bpf/helpers.c | 256
The "positive" part tests all format specifiers when things go well.
The "negative" part makes sure that incorrect format strings fail at
load time.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 125 ++
.../selftests/bpf/p
cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
libbpf: Introduce a BPF_SNPRINTF helper macro
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
include/linux
On Wed, Apr 14, 2021 at 1:01 AM Andrii Nakryiko
wrote:
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > +/* Per-cpu temp buffers which can be used by printf-like helpers for %s or
> > %p
> > + */
> > +#define MAX_PRINTF_BUF_LEN 512
>
On Wed, Apr 14, 2021 at 1:21 AM Andrii Nakryiko
wrote:
>
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> >
> > This exercises most of the format specifiers.
> >
> > Signed-off-by: Florent Revest
> > Acked-by: Andrii Nakryiko
> > ---
>
&
On Wed, Apr 14, 2021 at 1:16 AM Andrii Nakryiko
wrote:
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > +static int check_bpf_snprintf_call(struct bpf_verifier_env *env,
> > + struct bpf_reg_state *regs)
> > +{
> > + st
On Wed, Apr 14, 2021 at 11:56 AM Florent Revest wrote:
> On Wed, Apr 14, 2021 at 1:01 AM Andrii Nakryiko
> wrote:
> > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > > + err = 0;
> > > +out:
> > > + put_fmt_tmp_buf();
> >
&
On Mon, Apr 12, 2021 at 10:32 PM kernel test robot wrote:
>m68k-linux-ld: kernel/bpf/verifier.o: in function
> `check_helper_call.isra.0':
> >> verifier.c:(.text+0xf79e): undefined reference to `bpf_printf_prepare'
>m68k-linux-ld: kernel/bpf/helpers.o: in function `bpf_base_func_proto':
It is just missing a ';'. This macro is not used by any test yet.
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/test_progs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_progs.h
b/tools/testing/selftests/bpf/test_progs.h
of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c | 50 ++
kernel/bpf/verifier.c
101 - 200 of 213 matches
Mail list logo