]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
samples/ftrace: Adjust LoongArch register restore order in direct calls
authorChenghao Duan <duanchenghao@kylinos.cn>
Wed, 31 Dec 2025 07:19:25 +0000 (15:19 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 31 Dec 2025 07:19:25 +0000 (15:19 +0800)
commitbb85d206be208bbf834883e948125a35ac59993a
tree1792fbdda1a6bfcbdc79dc95e853d5d6100bacc3
parent73721d8676771c6c7b06d4e636cc053fc76afefd
samples/ftrace: Adjust LoongArch register restore order in direct calls

Ensure that in the ftrace direct call logic, the CPU register state
(with ra = parent return address) is restored to the correct state after
the execution of the custom trampoline function and before returning to
the traced function. Additionally, guarantee the correctness of the jump
logic for jr t0 (traced function address).

Cc: stable@vger.kernel.org
Fixes: 9cdc3b6a299c ("LoongArch: ftrace: Add direct call support")
Reported-by: Youling Tang <tangyouling@kylinos.cn>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
samples/ftrace/ftrace-direct-modify.c
samples/ftrace/ftrace-direct-multi-modify.c
samples/ftrace/ftrace-direct-multi.c
samples/ftrace/ftrace-direct-too.c
samples/ftrace/ftrace-direct.c