* [PATCH] MIPS: Clear XContext at boot time
@ 2020-04-22 14:45 Jiaxun Yang
2020-04-24 21:36 ` Thomas Bogendoerfer
0 siblings, 1 reply; 2+ messages in thread
From: Jiaxun Yang @ 2020-04-22 14:45 UTC (permalink / raw)
To: linux-mips; +Cc: Jiaxun Yang, Thomas Bogendoerfer, linux-kernel
XContext might be dirty at boot time. We need to clear it
to ensure early stackframe is safe.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
arch/mips/kernel/head.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 351d40fe0859..3b02ffe46304 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -132,6 +132,9 @@ dtb_found:
#endif
MTC0 zero, CP0_CONTEXT # clear context register
+#ifdef CONFIG_64BIT
+ MTC0 zero, CP0_XCONTEXT
+#endif
PTR_LA $28, init_thread_union
/* Set the SP after an empty pt_regs. */
PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE
--
2.26.0.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: Clear XContext at boot time
2020-04-22 14:45 [PATCH] MIPS: Clear XContext at boot time Jiaxun Yang
@ 2020-04-24 21:36 ` Thomas Bogendoerfer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2020-04-24 21:36 UTC (permalink / raw)
To: Jiaxun Yang; +Cc: linux-mips, linux-kernel
On Wed, Apr 22, 2020 at 10:45:34PM +0800, Jiaxun Yang wrote:
> XContext might be dirty at boot time. We need to clear it
> to ensure early stackframe is safe.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> arch/mips/kernel/head.S | 3 +++
> 1 file changed, 3 insertions(+)
>
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-24 21:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-22 14:45 [PATCH] MIPS: Clear XContext at boot time Jiaxun Yang
2020-04-24 21:36 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).