MIPS: Clear XContext at boot time
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Wed, 22 Apr 2020 14:45:34 +0000 (22:45 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 24 Apr 2020 16:37:23 +0000 (18:37 +0200)
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>
arch/mips/kernel/head.S

index 351d40f..3b02ffe 100644 (file)
@@ -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