Merge tag 'lsk-v3.10-android-15.01'
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / process.c
index c419e4814ba7eb2290dd98041b5c76ef88a3c6bb..809f4d2c234629805fb330b5c48b8ea70f1b7282 100644 (file)
 #include <asm/processor.h>
 #include <asm/stacktrace.h>
 
-static void setup_restart(void)
-{
-       /*
-        * Tell the mm system that we are going to reboot -
-        * we may need it to insert some 1:1 mappings so that
-        * soft boot works.
-        */
-       setup_mm_for_reboot();
-
-       /* Clean and invalidate caches */
-       flush_cache_all();
-
-       /* Turn D-cache off */
-       cpu_cache_off();
-
-       /* Push out any further dirty data, and ensure cache is empty */
-       flush_cache_all();
-}
+#ifdef CONFIG_CC_STACKPROTECTOR
+#include <linux/stackprotector.h>
+unsigned long __stack_chk_guard __read_mostly;
+EXPORT_SYMBOL(__stack_chk_guard);
+#endif
 
 void soft_restart(unsigned long addr)
 {
-       typedef void (*phys_reset_t)(unsigned long);
-       phys_reset_t phys_reset;
-
-       setup_restart();
-
-       /* Switch to the identity mapping */
-       phys_reset = (phys_reset_t)virt_to_phys(cpu_reset);
-       phys_reset(addr);
-
+       setup_mm_for_reboot();
+       cpu_soft_restart(virt_to_phys(cpu_reset), addr);
        /* Should never get here */
        BUG();
 }