]> git.baikalelectronics.ru Git - kernel.git/commit
s390/unwind: avoid duplicated unwinding entries for kretprobes
authorVasily Gorbik <gor@linux.ibm.com>
Sat, 5 Mar 2022 12:16:07 +0000 (13:16 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Sun, 27 Mar 2022 20:18:39 +0000 (22:18 +0200)
commitf907e392143932fd7cf792b2f72b00668688b54d
tree630387a974eaca87727952030397b4191f33d90a
parente12a044c6bbc5c7817e6a43e9bf8682b70f5648e
s390/unwind: avoid duplicated unwinding entries for kretprobes

Currently when unwinding starts from pt_regs or encounters pt_regs along
the way unwinder tries to yield 2 unwinding entries:
1. (reliable)     ip1: pt_regs->psw.addr,  sp1: regs->gprs[15]
2. (non-reliable) ip2: sp1->gprs[8] (r14), sp2: regs->gprs[15]

In case of kretprobes those are identical and serves no other purpose
than causing confusion over duplicated entries and cause kprobes tests
to fail. So, skip a duplicate non-reliable entry in this case.

With that kretprobes and unwinder implementation now comply with
ARCH_CORRECT_STACKTRACE_ON_KRETPROBE.

Reviewed-by: Tobias Huschle <huschle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/Kconfig
arch/s390/kernel/unwind_bc.c