Commit baf22419 authored by Tiezhu Yang's avatar Tiezhu Yang
Browse files

LoongArch: Fix definition of ftrace_regs_set_instruction_pointer()

mainline inclusion
from mainline-v6.8
commit 91af17cd7d03db8836554c91ba7c38b0817aa980
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB3IRE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91af17cd7d03db8836554c91ba7c38b0817aa980



---------------------------------------------------------------------------

The current definition of ftrace_regs_set_instruction_pointer() is not
correct. Obviously, this function is used to set instruction pointer but
not return value, so it should call instruction_pointer_set() instead of
regs_set_return_value().

There is no side effect by now because it is only used for kernel live-
patching which is not supported, so fix it to avoid failure when testing
livepatch in the future.

Fixes: 6fbff14a ("LoongArch: ftrace: Abstract DYNAMIC_FTRACE_WITH_ARGS accesses")
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 7984eaba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ ftrace_regs_get_instruction_pointer(struct ftrace_regs *fregs)
static __always_inline void
ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs, unsigned long ip)
{
	regs_set_return_value(&fregs->regs, ip);
	instruction_pointer_set(&fregs->regs, ip);
}

#define ftrace_regs_get_argument(fregs, n) \