diff options
| author | Saket Kumar Bhaskar <skb99@linux.ibm.com> | 2026-04-03 13:50:16 +0300 |
|---|---|---|
| committer | Madhavan Srinivasan <maddy@linux.ibm.com> | 2026-06-02 08:36:42 +0300 |
| commit | b55b6b9ad76cdb82123c62a15c6a4ebe4abb8bfa (patch) | |
| tree | 7efb94c5597ae378998fd5ebec9fec9268a66abb /include/linux | |
| parent | 2442f10c6eae63392452ab84a813dbc1f87c724d (diff) | |
| download | linux-b55b6b9ad76cdb82123c62a15c6a4ebe4abb8bfa.tar.xz | |
powerpc64/bpf: Add powerpc64 JIT support for timed may_goto
When verifier sees a timed may_goto instruction, it emits a call to
arch_bpf_timed_may_goto() with a stack offset in BPF_REG_AX
(powerpc64 R12) and expects the refreshed count value to be returned
in the same register. The verifier doesn't save or restore any registers
before emitting this call.
arch_bpf_timed_may_goto() should act as a trampoline to call
bpf_check_timed_may_goto() with powerpc64 ELF ABI calling convention.
To support this custom calling convention, implement
arch_bpf_timed_may_goto() in assembly and make sure BPF caller saved
registers are preserved, then call bpf_check_timed_may_goto with
the powerpc64 ABI calling convention where first argument and return
value both are in R3. Finally, move the result back into BPF_REG_AX(R12)
before returning.
Also, introduce bpf_jit_emit_func_call() that computes the offset from
kernel_toc_addr(), validates that the target and emits the ADDIS/ADDI
sequence to load the function address before performing the indirect
branch via MTCTR/BCTRL. The existing code in bpf_jit_emit_func_call_rel()
is refactored to use this function.
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260403105016.74775-1-skb99@linux.ibm.com
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
