linux/arch/powerpc
Hari Bathini 2ecfe59cd7 powerpc/64/bpf: fix tail calls for PCREL addressing
With PCREL addressing, there is no kernel TOC. So, it is not setup in
prologue when PCREL addressing is used. But the number of instructions
to skip on a tail call was not adjusted accordingly. That resulted in
not so obvious failures while using tailcalls. 'tailcalls' selftest
crashed the system with the below call trace:

  bpf_test_run+0xe8/0x3cc (unreliable)
  bpf_prog_test_run_skb+0x348/0x778
  __sys_bpf+0xb04/0x2b00
  sys_bpf+0x28/0x38
  system_call_exception+0x168/0x340
  system_call_vectored_common+0x15c/0x2ec

Also, as bpf programs are always module addresses and a bpf helper in
general is a core kernel text address, using PC relative addressing
often fails with "out of range of pcrel address" error. Switch to
using kernel base for relative addressing to handle this better.

Fixes: 7e3a68be42 ("powerpc/64: vmlinux support building with PCREL addresing")
Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240502173205.142794-1-hbathini@linux.ibm.com
2024-05-06 22:05:18 +10:00
..
boot USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
configs powerpc: Add allmodconfig for all 32-bit sub-arches 2024-03-03 22:20:29 +11:00
crypto
include powerpc/dexcr: Add DEXCR prctl interface 2024-05-06 22:04:31 +10:00
kernel powerpc/dexcr: Add DEXCR prctl interface 2024-05-06 22:04:31 +10:00
kexec powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
kvm powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
lib powerpc: Add static_key_feature_checks_initialized flag 2024-04-15 12:53:39 +10:00
math-emu
mm powerpc: Mark memory_limit as initdata 2024-04-30 21:55:26 +10:00
net powerpc/64/bpf: fix tail calls for PCREL addressing 2024-05-06 22:05:18 +10:00
perf powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks 2024-03-03 23:05:21 +11:00
platforms powerpc/pseries/vio: Don't return ENODEV if node or compatible missing 2024-04-29 23:51:16 +10:00
purgatory
sysdev powerpc/dart: Drop unnecessary call to kmemleak_no_scan() 2024-04-29 23:51:16 +10:00
tools
xmon powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
Kconfig.debug
Makefile powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
Makefile.postlink