aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup-common.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-03-31 20:57:10 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2018-04-01 00:47:38 +1100
commit1d0afc0d5a7c281f8ced3bd39f61f3328d5d3822 (patch)
tree7c65dd8321b532d05cab7f707e540b9b56e975f8 /arch/powerpc/kernel/setup-common.c
parentpowerpc/kvm: Fix guest boot failure on Power9 since DAWR changes (diff)
downloadlinux-dev-1d0afc0d5a7c281f8ced3bd39f61f3328d5d3822.tar.xz
linux-dev-1d0afc0d5a7c281f8ced3bd39f61f3328d5d3822.zip
powerpc/64e: Fix oops due to deferral of paca allocation
On 64-bit Book3E systems, in setup_tlb_core_data() we reference other CPUs pacas. But in commit 59f577743d71 ("powerpc/64: Defer paca allocation until memory topology is discovered") the allocation of non-boot-CPU pacas was deferred until later in boot. This leads to an oops: CPU maps initialized for 1 thread per core Unable to handle kernel paging request for data at address 0x8888888888888918 Faulting instruction address: 0xc000000000e2f0d0 Oops: Kernel access of bad area, sig: 11 [#1] NIP .setup_tlb_core_data+0xdc/0x160 Call Trace: .setup_tlb_core_data+0x5c/0x160 (unreliable) .setup_arch+0x80/0x348 .start_kernel+0x7c/0x598 start_here_common+0x1c/0x40 Luckily setup_tlb_core_data() is called immediately prior to smp_setup_pacas(). So simply switching their order is sufficient to fix the oops and seems unlikely to have any other unwanted side effects. Fixes: 59f577743d71 ("powerpc/64: Defer paca allocation until memory topology is discovered") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r--arch/powerpc/kernel/setup-common.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 56f7a2b793e0..0af5c11b9e78 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -915,9 +915,6 @@ void __init setup_arch(char **cmdline_p)
/* Parse memory topology */
mem_topology_setup();
- /* On BookE, setup per-core TLB data structures. */
- setup_tlb_core_data();
-
/*
* Release secondary cpus out of their spinloops at 0x60 now that
* we can map physical -> logical CPU ids.
@@ -927,6 +924,10 @@ void __init setup_arch(char **cmdline_p)
*/
#ifdef CONFIG_SMP
smp_setup_pacas();
+
+ /* On BookE, setup per-core TLB data structures. */
+ setup_tlb_core_data();
+
smp_release_cpus();
#endif