]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/bpf: Add s390 JIT support for timed may_goto
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 21 Aug 2025 11:25:55 +0000 (13:25 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 26 Aug 2025 23:51:52 +0000 (16:51 -0700)
commitb8efa810c1db201dece99e4113229e5ecc00db5c
tree5ce5dda3a2a5c069e01f8d76c2a91a889a8996ac
parentd0f27ff27c048a3bdc49877255a7e7f8b49f5603
s390/bpf: Add s390 JIT support for timed may_goto

The verifier provides an architecture-independent implementation of the
may_goto instruction, which is currently used on s390x, but it has a
downside: there is no way to prevent progs using it from running for a
very long time.

The solution to this problem is an alternative timed implementation,
which requires architecture-specific bits. Its availability is signaled
to the verifier by bpf_jit_supports_timed_may_goto() returning true.

The verifier then emits a call to arch_bpf_timed_may_goto() using a
non-standard calling convention. This function must act as a trampoline
for bpf_check_timed_may_goto().

Implement bpf_jit_supports_timed_may_goto(), account for the special
calling convention in the BPF_CALL implementation, and implement
arch_bpf_timed_may_goto().

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20250821113339.292434-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/s390/net/Makefile
arch/s390/net/bpf_jit_comp.c
arch/s390/net/bpf_timed_may_goto.S [new file with mode: 0644]