s390/bpf: Implement exceptions
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 3 Jul 2024 00:48:48 +0000 (02:48 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Jul 2024 14:39:35 +0000 (16:39 +0200)
commitfa7bd4b000a7ae32eb6fc049125943561e5b46f3
treed734c917321b136d7066807f5dee84e7ea56e7ad
parent7ba4f43e16de351fe9821de80e15d88c884b2967
s390/bpf: Implement exceptions

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 <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20240703005047.40915-3-iii@linux.ibm.com
arch/s390/net/bpf_jit_comp.c