arm64: Fix the soft_restart routine
authorGeoff Levand <geoff@infradead.org>
Tue, 17 Dec 2013 00:19:29 +0000 (00:19 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 26 Feb 2014 11:16:28 +0000 (11:16 +0000)
Change the soft_restart() routine to call cpu_reset() at its identity mapped
physical address.

The cpu_reset() routine must be called at its identity mapped physical address
so that when the MMU is turned off the instruction pointer will be at the correct
location in physical memory.

Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/process.c

index 1c0a9be2ffa85ad87245ac5837c94149e246533a..fa6b5bba15f6248c8b83f765cab516faf3775d37 100644 (file)
@@ -72,8 +72,17 @@ static void setup_restart(void)
 
 void soft_restart(unsigned long addr)
 {
+       typedef void (*phys_reset_t)(unsigned long);
+       phys_reset_t phys_reset;
+
        setup_restart();
-       cpu_reset(addr);
+
+       /* Switch to the identity mapping */
+       phys_reset = (phys_reset_t)virt_to_phys(cpu_reset);
+       phys_reset(addr);
+
+       /* Should never get here */
+       BUG();
 }
 
 /*