<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/net, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-07-24T06:58:30Z</updated>
<entry>
<title>s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL again</title>
<updated>2025-07-24T06:58:30Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2025-07-16T19:35:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a4f9c7846b1ac428921ce9676b1b8c80ed60093c'/>
<id>urn:sha1:a4f9c7846b1ac428921ce9676b1b8c80ed60093c</id>
<content type='text'>
commit 6a5abf8cf182f577c7ae6c62f14debc9754ec986 upstream.

Commit 7ded842b356d ("s390/bpf: Fix bpf_plt pointer arithmetic") has
accidentally removed the critical piece of commit c730fce7c70c
("s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL"), causing
intermittent kernel panics in e.g. perf's on_switch() prog to reappear.

Restore the fix and add a comment.

Fixes: 7ded842b356d ("s390/bpf: Fix bpf_plt pointer arithmetic")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20250716194524.48109-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Store backchain even for leaf progs</title>
<updated>2025-06-19T13:39:53Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2025-05-12T12:26:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e5e2f46c50e7d8cca7d21fd00599f0481699e24'/>
<id>urn:sha1:6e5e2f46c50e7d8cca7d21fd00599f0481699e24</id>
<content type='text'>
[ Upstream commit 5f55f2168432298f5a55294831ab6a76a10cb3c3 ]

Currently a crash in a leaf prog (caused by a bug) produces the
following call trace:

     [&lt;000003ff600ebf00&gt;] bpf_prog_6df0139e1fbf2789_fentry+0x20/0x78
     [&lt;0000000000000000&gt;] 0x0

This is because leaf progs do not store backchain. Fix by making all
progs do it. This is what GCC and Clang-generated code does as well.
Now the call trace looks like this:

     [&lt;000003ff600eb0f2&gt;] bpf_prog_6df0139e1fbf2789_fentry+0x2a/0x80
     [&lt;000003ff600ed096&gt;] bpf_trampoline_201863462940+0x96/0xf4
     [&lt;000003ff600e3a40&gt;] bpf_prog_05f379658fdd72f2_classifier_0+0x58/0xc0
     [&lt;000003ffe0aef070&gt;] bpf_test_run+0x210/0x390
     [&lt;000003ffe0af0dc2&gt;] bpf_prog_test_run_skb+0x25a/0x668
     [&lt;000003ffe038a90e&gt;] __sys_bpf+0xa46/0xdb0
     [&lt;000003ffe038ad0c&gt;] __s390x_sys_bpf+0x44/0x50
     [&lt;000003ffe0defea8&gt;] __do_syscall+0x150/0x280
     [&lt;000003ffe0e01d5c&gt;] system_call+0x74/0x98

Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20250512122717.54878-1-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf: Introduce load-acquire and store-release instructions</title>
<updated>2025-03-15T18:48:28Z</updated>
<author>
<name>Peilin Ye</name>
</author>
<published>2025-03-04T01:06:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=880442305a3908589bf4d6fc1d79edb577ee497c'/>
<id>urn:sha1:880442305a3908589bf4d6fc1d79edb577ee497c</id>
<content type='text'>
Introduce BPF instructions with load-acquire and store-release
semantics, as discussed in [1].  Define 2 new flags:

  #define BPF_LOAD_ACQ    0x100
  #define BPF_STORE_REL   0x110

A "load-acquire" is a BPF_STX | BPF_ATOMIC instruction with the 'imm'
field set to BPF_LOAD_ACQ (0x100).

Similarly, a "store-release" is a BPF_STX | BPF_ATOMIC instruction with
the 'imm' field set to BPF_STORE_REL (0x110).

Unlike existing atomic read-modify-write operations that only support
BPF_W (32-bit) and BPF_DW (64-bit) size modifiers, load-acquires and
store-releases also support BPF_B (8-bit) and BPF_H (16-bit).  As an
exception, however, 64-bit load-acquires/store-releases are not
supported on 32-bit architectures (to fix a build error reported by the
kernel test robot).

An 8- or 16-bit load-acquire zero-extends the value before writing it to
a 32-bit register, just like ARM64 instruction LDARH and friends.

Similar to existing atomic read-modify-write operations, misaligned
load-acquires/store-releases are not allowed (even if
BPF_F_ANY_ALIGNMENT is set).

As an example, consider the following 64-bit load-acquire BPF
instruction (assuming little-endian):

  db 10 00 00 00 01 00 00  r0 = load_acquire((u64 *)(r1 + 0x0))

  opcode (0xdb): BPF_ATOMIC | BPF_DW | BPF_STX
  imm (0x00000100): BPF_LOAD_ACQ

Similarly, a 16-bit BPF store-release:

  cb 21 00 00 10 01 00 00  store_release((u16 *)(r1 + 0x0), w2)

  opcode (0xcb): BPF_ATOMIC | BPF_H | BPF_STX
  imm (0x00000110): BPF_STORE_REL

In arch/{arm64,s390,x86}/net/bpf_jit_comp.c, have
bpf_jit_supports_insn(..., /*in_arena=*/true) return false for the new
instructions, until the corresponding JIT compiler supports them in
arena.

[1] https://lore.kernel.org/all/20240729183246.4110549-1-yepeilin@google.com/

Acked-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Acked-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Cc: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Peilin Ye &lt;yepeilin@google.com&gt;
Link: https://lore.kernel.org/r/a217f46f0e445fbd573a1a024be5c6bf1d5fe716.1741049567.git.yepeilin@google.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/bpf: Implement exceptions</title>
<updated>2024-07-08T14:39:35Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-03T00:48:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa7bd4b000a7ae32eb6fc049125943561e5b46f3'/>
<id>urn:sha1:fa7bd4b000a7ae32eb6fc049125943561e5b46f3</id>
<content type='text'>
Implement the following three pieces required from the JIT:

- A "top-level" BPF prog (exception_boundary) must save all
  non-volatile registers, and not only the ones that it clobbers.
- A "handler" BPF prog (exception_cb) must switch stack to that of
  exception_boundary, and restore the registers that exception_boundary
  saved.
- arch_bpf_stack_walk() must unwind the stack and provide the results
  in a way that satisfies both bpf_throw() and exception_cb.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240703005047.40915-3-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Change seen_reg to a mask</title>
<updated>2024-07-08T14:39:35Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-03T00:48:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ba4f43e16de351fe9821de80e15d88c884b2967'/>
<id>urn:sha1:7ba4f43e16de351fe9821de80e15d88c884b2967</id>
<content type='text'>
Using a mask instead of an array saves a small amount of memory and
allows marking multiple registers as seen with a simple "or". Another
positive side-effect is that it speeds up verification with jitterbug.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240703005047.40915-2-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Support arena atomics</title>
<updated>2024-07-02T16:31:52Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-01T23:40:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f9469484a3b52c66b799de73bd1ca75617bc8d5'/>
<id>urn:sha1:2f9469484a3b52c66b799de73bd1ca75617bc8d5</id>
<content type='text'>
s390x supports most BPF atomics using single instructions, which
makes implementing arena support a matter of adding arena address to
the base register (unfortunately atomics do not support index
registers), and wrapping the respective native instruction in probing
sequences.

An exception is BPF_XCHG, which is implemented using two different
memory accesses and a loop. Make sure there is enough extable entries
for both instructions. Compute the base address once for both memory
accesses. Since on exception we need to land after the loop, emit the
nops manually.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240701234304.14336-10-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Enable arena</title>
<updated>2024-07-02T16:31:52Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-01T23:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e36027e39b8b3fa567ce3d743dbda5954dc0a56'/>
<id>urn:sha1:1e36027e39b8b3fa567ce3d743dbda5954dc0a56</id>
<content type='text'>
Now that BPF_PROBE_MEM32 and address space cast instructions are
implemented, tell the verifier that the JIT supports arena.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240701234304.14336-9-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Support address space cast instruction</title>
<updated>2024-07-02T16:31:52Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-01T23:40:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=555469cc9be4a7f52c0ad07a4a237d63e8c5c5f4'/>
<id>urn:sha1:555469cc9be4a7f52c0ad07a4a237d63e8c5c5f4</id>
<content type='text'>
The new address cast instruction translates arena offsets to userspace
addresses. NULL pointers must not be translated.

The common code sets up the mappings in such a way that it's enough to
replace the higher 32 bits to achieve the desired result. s390x has
just an instruction for this: INSERT IMMEDIATE.

Implement the sequence using 3 instruction: LOAD AND TEST, BRANCH
RELATIVE ON CONDITION and INSERT IMMEDIATE.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240701234304.14336-8-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Support BPF_PROBE_MEM32</title>
<updated>2024-07-02T16:31:52Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-01T23:40:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d3a453b434fd2f389960890ae6d767f8d50c403'/>
<id>urn:sha1:4d3a453b434fd2f389960890ae6d767f8d50c403</id>
<content type='text'>
BPF_PROBE_MEM32 is a new mode for LDX, ST and STX instructions. The JIT
is supposed to add the start address of the kernel arena mapping to the
%dst register, and use a probing variant of the respective memory
access.

Reuse the existing probing infrastructure for that. Put the arena
address into the literal pool, load it into %r1 and use that as an
index register. Do not clear any registers in ex_handler_bpf() for
failing ST and STX instructions.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240701234304.14336-7-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>s390/bpf: Land on the next JITed instruction after exception</title>
<updated>2024-07-02T16:31:52Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2024-07-01T23:40:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1c04bcc41f9638460a9c68f894fb770596380de'/>
<id>urn:sha1:a1c04bcc41f9638460a9c68f894fb770596380de</id>
<content type='text'>
Currently we land on the nop, which is unnecessary: we can just as well
begin executing the next instruction. Furthermore, the upcoming arena
support for the loop-based BPF_XCHG implementation will require landing
on an instruction that comes after the loop.

So land on the next JITed instruction, which covers both cases.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240701234304.14336-6-iii@linux.ibm.com
</content>
</entry>
</feed>
