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 | fd3cb1bfeb9d98618bd709bfee9c1133e9f189e6 (patch) | |
| tree | c9f74080c0e9a3a2975aad8c823a2ddadb7d2135 /scripts/objdiff | |
| parent | 29479b14315de24616cc1fad86cbd392c36f557a (diff) | |
| download | linux-fd3cb1bfeb9d98618bd709bfee9c1133e9f189e6.tar.gz linux-fd3cb1bfeb9d98618bd709bfee9c1133e9f189e6.zip | |
LoongArch: BPF: Optimize redundant TCC loads in epilogue
The legacy epilogue implementation pops the tail call counter (TCC)
context via a redundant double-load pattern. It first decrements the
load_offset by 2 slots to fetch 'tcc_ptr', and then immediately bumps
it back up by 1 slot to load the original 'tcc' value into REG_TCC,
unnecessarily overwriting the register.
Optimize this sequence by adjusting the load_offset by only 1 slot.
This aligns the offset directly with the higher stack slot containing
the entry TCC counter (or caller state), allowing us to restore the
REG_TCC register safely with a single load.
This removes one redundant instruction from the epilogue hot path,
improves code readability, and ensures the correct TCC register context
is handed back cleanly upon normal return.
Cc: stable@vger.kernel.org
Fixes: c0fcc955ff82 ("LoongArch: BPF: Fix the tailcall hierarchy")
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/objdiff')
0 files changed, 0 insertions, 0 deletions
