Skip to content

Commit

Permalink
arm64: Fix the soft_restart routine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geoff Levand authored and Catalin Marinas committed Feb 26, 2014
1 parent ea8c2e1 commit 09024aa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion arch/arm64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/*
Expand Down

0 comments on commit 09024aa

Please sign in to comment.