Files
linux/arch/loongarch/kernel
Chenghao Duan 45cb47c628 LoongArch: Refactor register restoration in ftrace_common_return
Refactor the register restoration sequence in the ftrace_common_return
function to clearly distinguish between the logic of normal returns and
direct call returns in function tracing scenarios. The logic is as
follows:

1. In the case of a normal return, the execution flow returns to the
traced function, and ftrace must ensure that the register data is
consistent with the state when the function was entered.

ra = parent return address; t0 = traced function return address.

2. In the case of a direct call return, the execution flow jumps to the
custom trampoline function, and ftrace must ensure that the register
data is consistent with the state when ftrace was entered.

ra = traced function return address; t0 = parent return address.

Cc: stable@vger.kernel.org
Fixes: 9cdc3b6a29 ("LoongArch: ftrace: Add direct call support")
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2025-12-31 15:19:20 +08:00
..
2022-06-03 20:09:27 +08:00
2022-10-12 16:36:19 +08:00
2022-12-14 08:41:53 +08:00
2025-02-13 12:02:35 +08:00
2024-10-16 21:56:56 +02:00
2022-10-12 16:36:14 +08:00
2025-02-13 12:02:35 +08:00
2025-11-14 10:01:52 +01:00