diff options
| author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2026-08-17 22:07:23 +0800 |
|---|---|---|
| committer | Huacai Chen <chenhuacai@loongson.cn> | 2026-08-17 22:07:23 +0800 |
| commit | cd7e356b07a27e91394838cf3fb655862b519294 (patch) | |
| tree | 31e79823c974c187a9b47cf2a2334377d7ef940b /scripts/stackusage | |
| parent | fd3cb1bfeb9d98618bd709bfee9c1133e9f189e6 (diff) | |
| download | linux-cd7e356b07a27e91394838cf3fb655862b519294.tar.gz linux-cd7e356b07a27e91394838cf3fb655862b519294.zip | |
LoongArch: BPF: Move arena register slot below TCC context
Currently, the stack layout places the optional arena register slot
above the tail call counter context. When arena_vm_start is dynamically
enabled, it shifts the relative offset of the tcc_ptr slot within the
stack frame, causing hardcoded tracking macros to mismatch and leading
to memory misalignment or corruption potentially.
To fix this, move the arena register save and restore sequences below
the tail call counter context slots in both build_prologue() and the
epilogue.
Update __build_epilogue() to insert a proper offset decrement to safely
skip the unneeded tcc_ptr reading block while accurately aligning with
the relocated arena slot at the very bottom.
With this patch, the tcc_ptr slot is always positioned at a fixed
distance directly underneath the base callee-saved registers that is
independent of whether the arena features are on.
Cc: stable@vger.kernel.org
Fixes: ef54c517a937 ("LoongArch: BPF: Implement PROBE_MEM32 pseudo instructions")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
