提交 8c89628b 编写于 作者: M Mao Minkai 提交者: guzitao

sw64: fix incorrect gp after kretprobe triggered

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XTM4

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

SW64 use r26 to calculate gp after function return, so r26 needs to be
restored when kretprobe trampoline is hit.
Signed-off-by: NMao Minkai <maominkai@wxiat.com>
Reviewed-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 89aefedb
...@@ -284,6 +284,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, ...@@ -284,6 +284,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
orig_ret_address = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL); orig_ret_address = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
instruction_pointer(regs) = orig_ret_address; instruction_pointer(regs) = orig_ret_address;
regs->r26 = orig_ret_address;
/* /*
* By returning a non-zero value, we are telling * By returning a non-zero value, we are telling
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册