[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220429094355.122389-36-chenzhongjin@huawei.com>
Date: Fri, 29 Apr 2022 17:43:53 +0800
From: Chen Zhongjin <chenzhongjin@...wei.com>
To: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-arch@...r.kernel.org>
CC: <jthierry@...hat.com>, <catalin.marinas@....com>,
<will@...nel.org>, <masahiroy@...nel.org>, <jpoimboe@...hat.com>,
<peterz@...radead.org>, <ycote@...hat.com>,
<herbert@...dor.apana.org.au>, <mark.rutland@....com>,
<davem@...emloft.net>, <ardb@...nel.org>, <maz@...nel.org>,
<tglx@...utronix.de>, <luc.vanoostenryck@...il.com>,
<chenzhongjin@...wei.com>
Subject: [RFC PATCH v4 35/37] arm64: entry: Annotate code switching to tasks
From: Julien Thierry <jthierry@...hat.com>
Add UNWIND_HINT_REGS in kernel_entry after saving pt_regs.
Whether returning to userland or creating a new task, sp is
pointing to a pt_regs frame.
Signed-off-by: Julien Thierry <jthierry@...hat.com>
Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
---
arch/arm64/kernel/entry.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index eeb576ec97ba..c7ab5143949f 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -220,6 +220,7 @@ alternative_cb_end
stp x24, x25, [sp, #16 * 12]
stp x26, x27, [sp, #16 * 13]
stp x28, x29, [sp, #16 * 14]
+ UNWIND_HINT_REGS
.if \el == 0
clear_gp_regs
@@ -602,6 +603,7 @@ SYM_CODE_START_LOCAL(ret_to_kernel)
SYM_CODE_END(ret_to_kernel)
SYM_CODE_START_LOCAL(ret_to_user)
+ UNWIND_HINT_REGS
ldr x19, [tsk, #TSK_TI_FLAGS] // re-check for single-step
enable_step_tsk x19, x2
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
@@ -874,6 +876,7 @@ NOKPROBE(cpu_switch_to)
* This is how we return from a fork.
*/
SYM_CODE_START(ret_from_fork)
+ UNWIND_HINT_REGS
bl schedule_tail
cbz x19, 1f // not a kernel thread
mov x0, x20
--
2.17.1
Powered by blists - more mailing lists