summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-04-22 22:45:34 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-04-24 18:37:23 +0200
commitc213db614685e8dc9f910bca5cf934816ba423fe (patch)
tree6e4c6c24228bd99061c5cf0294c768cac42ebe96
parentd82d500f5118f9d07477d597fe75c3bd73b44c8e (diff)
downloadlinux-stable-c213db614685e8dc9f910bca5cf934816ba423fe.tar.gz
linux-stable-c213db614685e8dc9f910bca5cf934816ba423fe.tar.bz2
linux-stable-c213db614685e8dc9f910bca5cf934816ba423fe.zip
MIPS: Clear XContext at boot time
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> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-rw-r--r--arch/mips/kernel/head.S3
1 files changed, 3 insertions, 0 deletions
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