]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Fix get_wchan() to support the ORC unwinder
authorQi Zheng <zhengqi.arch@bytedance.com>
Wed, 29 Sep 2021 22:02:17 +0000 (15:02 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 Oct 2021 09:25:14 +0000 (11:25 +0200)
commit720149634008d23420868e8e923bc47ce22a3287
treef9f4a5d7a04d22d2b7bb4d0fa4d9d0301b436497
parent626a77b9cfdcaddb01eb1350543877d2125429eb
x86: Fix get_wchan() to support the ORC unwinder

Currently, the kernel CONFIG_UNWINDER_ORC option is enabled by default
on x86, but the implementation of get_wchan() is still based on the frame
pointer unwinder, so the /proc/<pid>/wchan usually returned 0 regardless
of whether the task <pid> is running.

Reimplement get_wchan() by calling stack_trace_save_tsk(), which is
adapted to the ORC and frame pointer unwinders.

Fixes: db2584c01c72 ("x86/unwind: Add the ORC unwinder")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211008111626.271115116@infradead.org
arch/x86/kernel/process.c