linux/Documentation
Puranjay Mohan bb5bad6a78
bpf, arm64: Convert struct_ops arena arguments in the trampoline
Implement the struct_ops arena argument conversion on arm64. save_args()
receives the arena base from bpf_tramp_arena_base() and consults the
btf_func_model argument flags as it copies each native argument into the
BPF ctx, routing a marked argument through x10 with the low half of the
base materialized once into x11:

  sub w10, wsrc, w11    /* truncate and clear the upper 32 bits */
  str x10, [sp, #slot]

A nullable argument tests the full 64-bit kernel pointer first:

  mov x10, xsrc
  cbz x10, 1f
  sub w10, w10, w11
1:
  str x10, [sp, #slot]

The 32-bit subtraction is sufficient since (u32)(kaddr - base) ==
(u32)kaddr - (u32)base, and it clears the upper half as the JITs require
of arena pointer registers. Stack-passed arguments already reload
through x10, so only the subtraction (and the NULL test) is inserted
there.

The register loop now walks arguments rather than registers so that the
per-argument flags line up with the slots a multi-slot argument occupies;
the sequence of stores is otherwise unchanged. bpf_tramp_arena_base()
returns a base only for a single-program struct_ops indirect trampoline,
so a tracing trampoline emits exactly what it did before and never
touches x11. The size probe reruns the same emission with the same model
and nodes, so the image size matches by construction.

Conversion must never reach the original function, which takes kernel
addresses. That holds because BPF_TRAMP_F_INDIRECT is incompatible with
BPF_TRAMP_F_CALL_ORIG, so pass 0 rather than the base to the call-origin
save_args() and assert the flag combination the same way x86 does,
rather than leaving the invariant to a comment.

With both the kfunc and struct_ops directions implemented, flip
bpf_jit_supports_arena_args() on for arm64 and drop the x86-64-only
qualifier from the kfunc documentation.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Reviewed-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/bpf/20260813190356.335181-5-puranjay@kernel.org
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
2026-08-14 05:55:02 +02:00
..
ABI Power Supply Fixes for 7.2 cycle 2026-07-30 16:50:17 -07:00
accel accel/amdxdna: Expose per-client BO memory usage via fdinfo 2026-04-09 13:41:47 -07:00
accounting
admin-guide Docs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior 2026-08-02 11:29:33 -10:00
arch KVM: arm64: vgic: Avoid double-deactivate of IRQs in the nested context 2026-07-21 11:19:00 +01:00
block for-7.2/block-20260615 2026-06-16 13:02:47 +05:30
bpf bpf, arm64: Convert struct_ops arena arguments in the trampoline 2026-08-14 05:55:02 +02:00
cdrom
core-api liveupdate: updates for 7.2-rc1 2026-06-21 09:46:14 -07:00
cpu-freq cpufreq: Use policy->min/max init as QoS request 2026-06-08 18:42:14 +02:00
crypto lib/crypto: docs: Improve introduction sentence 2026-07-09 11:06:05 -04:00
dev-tools linux_kselftest-next-7.2-rc1-second 2026-06-23 07:35:37 -07:00
devicetree SCSI fixes on 20260802 2026-08-02 09:32:07 -07:00
doc-guide
driver-api A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
edac
fault-injection
fb
features LoongArch: Add THREAD_INFO_IN_TASK implementation 2026-06-25 13:03:47 +08:00
filesystems ksmbd: doc: update feature support status for durable handles and compression 2026-06-30 21:29:46 -05:00
firmware_class
firmware-guide docs: acpi: dsd: add Motorcomm yt8xxx PHY properties 2026-05-11 18:05:22 -07:00
fpga
gpu drm-next for 7.2-rc1 2026-06-17 10:21:00 +01:00
hid Docs: hid: intel-ish-hid: make long URL usable 2026-04-09 08:40:41 -06:00
hwmon docs: hwmon: ltc4283: fix malformed table docs build error 2026-06-29 08:47:44 -07:00
i2c
iio docs: iio: adc: ad4691: add driver documentation 2026-05-31 11:14:22 +01:00
images
infiniband docs: infiniband: correct name of option to enable the ib_uverbs module 2026-06-16 14:47:24 -03:00
input Input: userio - allow setting other id values 2026-06-01 21:49:14 -07:00
kbuild kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
kernel-hacking Documentation: adopt new coding style of type-aware kmalloc-family 2026-05-03 08:54:21 -06:00
leds LEDs for v7.2 2026-06-18 14:45:08 -07:00
litmus-tests
livepatch
locking Things have calmed down a bit on the docs front, with no earthshaking 2026-06-16 08:35:59 +05:30
maintainer docs: auto-generate maintainer entry profile links 2026-05-03 09:24:30 -06:00
mhi
misc-devices misc: Remove old APDS990x driver 2026-04-27 09:58:24 +01:00
mm A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
netlabel
netlink ovpn: limit keepalive values to one day 2026-07-30 11:28:30 +02:00
networking xsk: reclaim invalid Tx descriptors in ZC batch path 2026-07-24 15:12:14 -07:00
nvdimm
nvme
PCI Documentation: PCI: Fix typos 2026-04-27 09:47:42 -05:00
pcmcia
peci
power
process docs, resolve_btfids: Document kfunc BTF annotation emission 2026-08-06 22:01:28 -07:00
RCU Documentation: RCU: adopt new coding style of type-aware kmalloc-family 2026-05-03 08:55:13 -06:00
rust s390 updates for 7.2 merge window 2026-06-16 05:08:13 +05:30
scheduler sched_ext: Documentation: Fix ops table header reference 2026-07-07 12:23:33 -10:00
scsi scsi: st: Fix typo in documentation 2026-05-14 21:59:19 -04:00
security integrity-v7.2 2026-06-19 11:32:05 -07:00
sound Documentation: sound: tas675x: Fix temperature range and impedance documentation 2026-07-01 19:52:38 +01:00
sphinx docs: maintainers_include: keep the last entry at the end 2026-05-25 14:24:09 -06:00
sphinx-includes
sphinx-static docs: sphinx-static: fix typo "wich" -> "which" 2026-05-15 07:52:37 -06:00
spi Documentation: adopt new coding style of type-aware kmalloc-family 2026-05-03 08:54:21 -06:00
staging docs: staging: fix various typos and grammar issues 2026-04-27 04:00:29 -06:00
sunrpc/xdr Documentation: Add the RPC language description of NLM version 3 2026-06-09 16:32:59 -04:00
target
tee
timers
tools A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
trace A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
translations MAINTAINERS: update ndesaulniers 2026-07-06 15:49:29 -07:00
usb
userspace-api Char/Misc/IIO/FPGA/GPIB/etc driver updates for 7.2-rc1 2026-06-22 12:20:21 -07:00
virt KVM/arm64 fixes for 7.2, take #3 2026-07-28 17:43:23 +02:00
w1
watchdog docs: watchdog: Fix brackets 2026-07-02 07:12:58 -07:00
wmi modpost: Handle malformed WMI GUID strings 2026-06-12 16:01:55 +03:00
.gitignore
.renames.txt Revert "drivers: net: 3com: 3c509: Remove this driver" 2026-05-21 08:28:56 -07:00
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
docutils.conf
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst net: remove ISDN subsystem and Bluetooth CMTP 2026-04-23 10:24:02 -07:00