diff options
| author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-10-27 22:51:36 +0800 |
|---|---|---|
| committer | Huacai Chen <chenhuacai@loongson.cn> | 2026-10-27 22:51:36 +0800 |
| commit | 67ab1a331481ef282c53003e6c041c8c4348d4cd (patch) | |
| tree | 62e2417f1eee807fa82fa6247d782fac4c3379bb /tools/lib/python/kdoc/python_version.py | |
| parent | 2a5ec3a553f7b23359344d52332263d5fa88aac6 (diff) | |
LoongArch: BPF: Fix stack arguments for indirect trampolines
LoongArch passes arguments beyond a0-a7 at the caller stack pointer. The
trampoline store_args() helper always reads those arguments at FP + 16,
which is correct for a regular fentry trampoline: its prologue leaves FP
16 bytes below the stack pointer at trampoline entry to hold the saved
RA/FP frame record of the parent function.
A struct_ops indirect trampoline is entered through a function pointer
and only saves its own RA and FP before setting FP to the entry stack
pointer. Its stack arguments therefore start at FP rather than FP + 16.
As a result, every stack-passed struct_ops argument is currently read
two slots late.
Select the source offset based on whether the trampoline is indirect.
This also prepares the stack-passed arena argument path to consume the
actual pointer slot.
With this patch the BPF selftest "./test_progs -t struct_ops_multi_args"
passed on LoongArch.
Fixes: c9ebe2016de9 ("LoongArch: BPF: Support up to 12 function arguments for trampoline")
Acked-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
