]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64e: Fix oops due to deferral of paca allocation
authorMichael Ellerman <mpe@ellerman.id.au>
Sat, 31 Mar 2018 09:57:10 +0000 (20:57 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 31 Mar 2018 13:47:38 +0000 (00:47 +1100)
commit4ea3079c0a62a6d1d566deb1b706d1c4a94e8dbf
tree7c65dd8321b532d05cab7f707e540b9b56e975f8
parentd0a1be27e5847815a9a58936538634a052644bc0
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 8a4ff6c786f8 ("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: 8a4ff6c786f8 ("powerpc/64: Defer paca allocation until memory topology is discovered")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c