On Tue, 2024-06-04 at 18:17 +0200, Alexander Potapenko wrote:
> On Tue, Jun 4, 2024 at 6:07 PM Ilya Leoshkevich
> wrote:
> >
> > On Thu, 2023-08-10 at 20:30 +0800, Xuan Zhuo wrote:
> > > If the vq is the premapped mode, use the sg_dma_address()
> > > direct
On Thu, 2023-08-10 at 20:30 +0800, Xuan Zhuo wrote:
> If the vq is the premapped mode, use the sg_dma_address() directly.
>
> Signed-off-by: Xuan Zhuo
> ---
> drivers/virtio/virtio_ring.c | 19 +--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virti
intf(stderr, "warning: insn #%d jumps to insn #%d, "
> + if (delta < 0 || delta > 255) {
> + fprintf(stderr, "error: insn #%d jumps to insn #%d, "
> "which is out of range\n", i, off);
> + exit(1);
> + }
> return (uint8_t) delta;
> }
>
Acked-by: Ilya Leoshkevich
On Tue, 2021-02-23 at 15:26 -0500, Ian Denhardt wrote:
> Hi,
>
> I'm using the `bpf_asm` tool to do some syscall filtering, and found
> out
> the hard way that its error checking isn't very strict. In particular,
> it issues a warning (not an error) when a jump offset overflows the
> instruction's
{ { 1, 0xbee } },
> .fill_helper = bpf_fill_ld_abs_get_processor_id,
> - .expected_errcode = -ENOTSUPP,
> },
> /*
>* LD_IND / LD_ABS on fragmented SKBs
Thank you for the fix!
I tested it and it indeed fixes these 4 failures.
I will have a look at the remaining 8 tomorrow.
Reviewed-by: Ilya Leoshkevich
On Thu, 2020-06-11 at 22:50 +0200, Jiri Olsa wrote:
> hi,
> we're hitting a problem on s390 with BTF data alignment.
>
> When running simple test, we're getting this message from
> verifier and console:
>
> bpf_common.c:91: BROK: Failed verification: in-kernel BTF is
> malformed
> [ 41.5455
\
> struct btf_map_##name { \
> type_key key; \
> --
> 2.17.1
>
Acked-by: Ilya Leoshkevich
n-zero (even if binary is successfully produced).
> - Run "make clean" from bpf/ and not only bpf/bpftool/ in that same script,
> when relevant.
> - Add a patch to clean up generated "feature/" and "libbpf/" directories.
>
> Cc: Lorenz Bauer
> C
> Am 29.08.2019 um 12:56 schrieb Quentin Monnet :
>
> +make_and_clean() {
> + echo -e "\$PWD:$PWD"
> + echo -e "command: make -s $* >/dev/null"
> + make $J -s $* >/dev/null
Would it make sense to set ERROR=1 if make produces a bpftool binary,
but still fails with a non-zero RC for
> Am 12.08.2019 um 20:39 schrieb Andrii Nakryiko :
>
> @@ -92,23 +92,34 @@ vmlinux_link()
> }
>
> # generate .BTF typeinfo from DWARF debuginfo
> +# ${1} - vmlinux image
> +# ${2} - file to dump raw BTF data into
> gen_btf()
> {
> - local pahole_ver;
> + local pahole_ver
> + local bin
that the wrong opcode was used.
Fix by using the correct opcode.
Signed-off-by: Ilya Leoshkevich
---
arch/s390/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index e636728ab452..6299156f9738 100644
> Am 27.07.2019 um 20:53 schrieb Andrii Nakryiko :
>
> On Fri, Jul 26, 2019 at 3:01 PM Stanislav Fomichev wrote:
>>
>> On 07/26, Andrii Nakryiko wrote:
>>> On Fri, Jul 26, 2019 at 2:21 PM Stanislav Fomichev wrote:
On 07/26, Andrii Nakryiko wrote:
> Apprently listing header as a n
> Am 19.07.2019 um 20:17 schrieb Jakub Kicinski :
>
> On Fri, 19 Jul 2019 15:12:24 +0200, Ilya Leoshkevich wrote:
>>> Am 18.07.2019 um 20:51 schrieb Jakub Kicinski
>>> :
>>>
>>> We should probably make a script with all the ways of calling make
>
> Am 18.07.2019 um 20:51 schrieb Jakub Kicinski :
>
> We should probably make a script with all the ways of calling make
> should work. Otherwise we can lose track too easily.
Thanks for the script!
I’m trying to make it all pass now, and hitting a weird issue in the
Kbuild case. The build print
ft count calculation to account for endianness.
Fixes: 31fd85816dbe ("bpf: permits narrower load from bpf program context
fields")
Signed-off-by: Ilya Leoshkevich
---
v1 -> v2: extract endianness-dependent code into a separate function
v2 -> v3: rename the function and move i
point of the
test, replace two short comparisons with a single int comparison.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/progs/sendmsg6_prog.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/progs/sendmsg6_prog.c
b/tools/t
ft count calculation to account for endianness.
Fixes: 31fd85816dbe ("bpf: permits narrower load from bpf program context
fields")
Signed-off-by: Ilya Leoshkevich
---
include/linux/filter.h | 13 +
kernel/bpf/verifier.c | 4 ++--
2 files changed, 15 insertions(+), 2 deleti
ix by invoking libbpf build in a manner similar to $(call descend) -
descend itself cannot be used, since libbpf is a sibling, and not a
child, of bpftool.
Also, don't link bpftool with libbpf.a twice.
Signed-off-by: Ilya Leoshkevich
---
tools/bpf/bpftool/Makefile | 17 ++---
1 fi
This test looks up a 32-bit map element and then loads it using a 64-bit
load. This does not work on s390, which is a big-endian machine.
Since the point of this test doesn't seem to be loading a smaller value
using a larger load, simply use a 32-bit load.
Signed-off-by: Ilya Leoshk
> Am 17.07.2019 um 18:25 schrieb Y Song :
>
> On Wed, Jul 17, 2019 at 3:36 AM Ilya Leoshkevich wrote:
>>
>>
>> Here is a better one: len=0x11223344 and we would like to do
>> ((u8 *)&len)[3].
>>
>> len is represented as `11 22 33 44` in me
test_xdp_noinline fails on s390 due to a handful of endianness issues.
Use ntohs for parsing eth_proto.
Replace bswaps with ntohs/htons.
Signed-off-by: Ilya Leoshkevich
Acked-by: Vasily Gorbik
---
.../selftests/bpf/progs/test_xdp_noinline.c | 17 +
1 file changed, 9
> Am 17.07.2019 um 11:21 schrieb Ilya Leoshkevich :
>
>> Am 17.07.2019 um 07:11 schrieb Y Song :
>>
>> [sorry, resend again as previous one has come text messed out due to
>> networking issues]
>>
>> On Tue, Jul 16, 2019 at 10:08 PM Y Song wrote:
>
> Am 17.07.2019 um 07:11 schrieb Y Song :
>
> [sorry, resend again as previous one has come text messed out due to
> networking issues]
>
> On Tue, Jul 16, 2019 at 10:08 PM Y Song wrote:
>>
>> On Tue, Jul 16, 2019 at 4:59 AM Ilya Leoshkevich wrote:
>>>
> Am 16.07.2019 um 19:49 schrieb Alexei Starovoitov
> :
>
> On Mon, Jul 15, 2019 at 3:22 PM Daniel Borkmann wrote:
>>
>> On 7/12/19 3:56 PM, Ilya Leoshkevich wrote:
>>> When directories are used as prerequisites in Makefiles, they can cause
>>>
perf_buffer test fails for exactly the same reason test_attach_probe
used to fail: different nanosleep syscall kprobe name.
Reuse the test_attach_probe fix.
Fixes: ee5cf82ce04a ("selftests/bpf: test perf buffer API")
Signed-off-by: Ilya Leoshkevich
---
.../testing/selftests/bpf/
shift and a bitwise AND, it assumes that
the machine is little endian.
Adjust shift count calculation to account for endianness.
Fixes: 31fd85816dbe ("bpf: permits narrower load from bpf program context
fields")
Signed-off-by: Ilya Leoshkevich
---
kernel/bpf/verifier.c | 8 ++
Some setups (e.g. virtual machines) might run with hardware perf events
disabled. If this is the case, skip the test_send_signal_nmi test.
Add a separate test involving a software perf event. This allows testing
the perf event path regardless of hardware perf event support.
Signed-off-by: Ilya
BPF_LDX_MEM is used to load the least significant byte of the retrieved
test_val.index, however, on big-endian machines it ends up retrieving
the most significant byte.
Change the test to load the whole int in order to make it
endianness-independent.
Signed-off-by: Ilya Leoshkevich
---
v1->
While $ARCH can be relatively flexible (see Makefile and
tools/scripts/Makefile.arch), $SRCARCH always corresponds to a directory
name under arch/.
Therefore, build samples with -D__TARGET_ARCH_$(SRCARCH), since that
matches the expectations of bpf_helpers.h.
Signed-off-by: Ilya Leoshkevich
Many s390 setups (most notably, KVM guests) do not have access to
hardware performance events.
Therefore, use the software event instead.
Signed-off-by: Ilya Leoshkevich
Acked-by: Vasily Gorbik
---
tools/testing/selftests/bpf/prog_tests/send_signal.c | 9 +
1 file changed, 9
Add a rule to put test_stub.o in $(OUTPUT) and change the references to
it accordingly. This prevents test_stub.o from being created in the
source directory.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/Makefile | 7 +--
1 file changed, 5 insertions(+), 2 deletions
depends on, which is the case for selftests/bpf, this
directory should be specified as an order-only prerequisite: it would
still be created in case it does not exist, but it would not trigger a
rebuild of a target in case it's considered changed.
Signed-off-by: Ilya Leoshkevich
---
tools/te
ftests/bpf: add kprobe/uprobe selftests")
Signed-off-by: Ilya Leoshkevich
Acked-by: Vasily Gorbik
---
tools/testing/selftests/bpf/prog_tests/attach_probe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/attach_probe.c
b/tools/testing/selftests
> Am 12.07.2019 um 02:53 schrieb Andrii Nakryiko :
>
> On Thu, Jul 11, 2019 at 7:32 AM Ilya Leoshkevich wrote:
>>
>> This opens up the possibility of accessing registers in an
>> arch-independent way.
>>
>> Signed-off-by: Ilya Leoshkevich
>> --
> Am 11.07.2019 um 22:35 schrieb Stanislav Fomichev :
>
> On 07/11, Ilya Leoshkevich wrote:
>> Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
>>
>> This patch series consists of three preparatory commits, which make it
>> possibl
> Am 11.07.2019 um 16:55 schrieb Andrii Nakryiko :
>
> On Thu, Jul 11, 2019 at 2:14 AM Ilya Leoshkevich wrote:
>>
>>
>> In addition, pull Kbuild.include in order to get .DELETE_ON_ERROR target,
>
> In your original patch you explicitly declared .DELETE_ON_
Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/progs/loop1.c | 2 +-
tools/testing/selftests/bpf/progs/loop2.c | 2 +-
tools/testing/selftests/bpf/progs/loop3.c | 2 +-
3 files changed, 3 insertions(+)
;s390/bpf: correct broken uapi for
BPF_PROG_TYPE_PERF_EVENT program type").
Ditto on arm64.
On x86, provide userspace versions of PT_REGS_* macros. Unlike s390 and
arm64, x86 provides struct pt_regs to both userspace and kernel, however,
with different member names.
Signed-off-by: Ilya L
Also check for __s390__ instead of __s390x__, just in case bpf_helpers.h
is ever used by 32-bit userspace.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/bpf_helpers.h | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf
This opens up the possibility of accessing registers in an
arch-independent way.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile
b/tools/testing/selftests/bpf
6", SRCARCH always corresponds to directory names under arch/.
v1->v2: Split into multiple patches.
v2->v3: Added arm64 support.
v3->v4: Added i386 support, use SRCARCH instead of ARCH.
Signed-off-by: Ilya Leoshkevich
tion was chosen
over using pipefail, having separate targets or getting rid of llc
invocation due to its simplicity.
In addition, pull Kbuild.include in order to get .DELETE_ON_ERROR target,
which would cause partial .o files to be removed.
Signed-off-by: Ilya Leoshkevich
---
v1->v2: use in
bpf_helpers.h fails to compile on sparc: the code should be checking
for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
Also change #ifdef bpf_target_powerpc to #if defined() for consistency.
Signed-off-by: Ilya Leoshkevich
---
v1->v2: bpf_target_powerpc change
to
> Am 09.07.2019 um 19:48 schrieb Andrii Nakryiko :
>
> On Tue, Jul 9, 2019 at 8:19 AM Ilya Leoshkevich wrote:
>>
>> Right now, on certain architectures, these macros are usable only with
>> kernel headers. This patch makes it possible to use them with userspace
>&
> Am 10.07.2019 um 12:43 schrieb Vasily Gorbik :
>
> Ilya Leoshkevich is joining as s390 bpf maintainer. With his background
> as gcc developer he would be valuable for the team and community as a
> whole. Ilya, have fun!
>
> Since there is now enough eyes on s390 b
> Am 09.07.2019 um 19:56 schrieb Andrii Nakryiko :
>
> On Tue, Jul 9, 2019 at 8:22 AM Ilya Leoshkevich wrote:
>>
>> bpf_helpers.h fails to compile on sparc: the code should be checking
>> for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
bpf_helpers.h fails to compile on sparc: the code should be checking
for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools
Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/progs/loop1.c | 2 +-
tools/testing/selftests/bpf/progs/loop2.c | 2 +-
tools/testing/selftests/bpf/progs/loop3.c | 2 +-
3 files changed, 3 insertions(+)
;s390/bpf: correct broken uapi for
BPF_PROG_TYPE_PERF_EVENT program type").
Ditto on arm64.
On x86, provide userspace versions of PT_REGS_* macros. Unlike s390 and
arm64, x86 provides struct pt_regs to both userspace and kernel, however,
with different member names.
Signed-off-by: Ilya L
This opens up the possibility of accessing registers in an
arch-independent way.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile
b/tools/testing/selftests/bpf
Also check for __s390__ instead of __s390x__, just in case bpf_helpers.h
is ever used by 32-bit userspace.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/bpf_helpers.h | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf
related build problems, which I will
post separately.
v1->v2: Split into multiple patches.
v2->v3: Added arm64 support.
Signed-off-by: Ilya Leoshkevich
> Am 08.07.2019 um 23:20 schrieb Stanislav Fomichev :
>
> On 07/08, Ilya Leoshkevich wrote:
>>
>>
>>> Am 08.07.2019 um 18:13 schrieb Stanislav Fomichev :
>>>
>>> On 07/03, Y Song wrote:
>>>> On Wed, Jul 3, 2019 at 1:51 PM Stani
g/selftests/bpf/progs/loop3.c
>>> index 30a0f6cba080..3a7f12d7186c 100644
>>> --- a/tools/testing/selftests/bpf/progs/loop3.c
>>> +++ b/tools/testing/selftests/bpf/progs/loop3.c
>>> @@ -14,9 +14,10 @@ SEC("raw_tracepoint/consume_skb")
>>> int while_tr
BPF_LDX_MEM is used to load the least significant byte of the retrieved
test_val.index, however, on big-endian machines it ends up retrieving
the most significant byte.
Use the correct least significant byte offset on big-endian machines.
Signed-off-by: Ilya Leoshkevich
---
v1->v2:
-
BPF_LDX_MEM is used to load the least significant byte of the retrieved
test_val.index, however, on big-endian machines it ends up retrieving
the most significant byte.
Use the correct least significant byte offset on big-endian machines.
Signed-off-by: Ilya Leoshkevich
---
tools/testing
This opens up the possibility of accessing registers in an
arch-independent way.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile
b/tools/testing/selftests/bpf
Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/progs/loop1.c | 2 +-
tools/testing/selftests/bpf/progs/loop2.c | 2 +-
tools/testing/selftests/bpf/progs/loop3.c | 2 +-
3 files changed, 3 insertions(+)
i for
BPF_PROG_TYPE_PERF_EVENT program type").
On x86, provide userspace versions of PT_REGS_* macros. Unlike s390, x86
provides struct pt_regs to both userspace and kernel, however, with
different member names.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/bpf_help
Also check for __s390__ instead of __s390x__, just in case bpf_helpers.h
is ever used by 32-bit userspace.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/bpf_helpers.h | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf
Use PT_REGS_RC(ctx) instead of ctx->rax, which is not present on s390.
This patch series consists of preparatory commits, which make it
possible to use PT_REGS_RC in BPF selftests, followed by the actual fix.
Signed-off-by: Ilya Leoshkevich
Fix endianness issue: passing a pointer to 64-bit fd as a 32-bit key
does not work on big-endian architectures. So cast fd to 32-bits when
necessary.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/test_maps.c | 21 +++--
1 file changed, 15 insertions(+), 6
> Am 02.07.2019 um 18:42 schrieb Y Song :
>
> On Tue, Jul 2, 2019 at 8:40 AM Ilya Leoshkevich wrote:
>>
>> -#elif defined(__s390x__)
>> - #define bpf_target_s930x
>
> I see in some other places (e.g., bcc) where
> macro __s390x__ is also used to indic
ovides struct pt_regs to both userspace and kernel, however, with
different field names.
Signed-off-by: Ilya Leoshkevich
---
tools/testing/selftests/bpf/Makefile | 4 +-
tools/testing/selftests/bpf/bpf_helpers.h | 46 +++
tools/testing/selftests/bpf/progs/loop1.c | 2 +-
64 matches
Mail list logo