]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Load correct TOC pointer while waking up from winkle.
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Fri, 5 Aug 2016 13:43:12 +0000 (19:13 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 9 Aug 2016 04:50:19 +0000 (14:50 +1000)
commit2f2b2722f9a8a2746c348bad2285dae338cf0e01
tree836a040e5903fd87956f89a1368fc16e7af2c5ca
parent6b8624aeb00ca2b070cf582a33b2ab7f14c7c3f0
powerpc/powernv: Load correct TOC pointer while waking up from winkle.

The function pnv_restore_hyp_resource() loads the TOC into r2 from
the invalid PACA pointer before fixing r13 value. This do not affect
POWER ISA 3.0 but it does have an impact on POWER ISA 2.07 or less
leading CPU to get stuck forever.

login: [  471.830433] Processor 120 is stuck.

This can be easily reproducible using following steps:
- Turn off SMT
$ ppc64_cpu --smt=off
- offline/online any online cpu (Thread 0 of any core which is online)
$ echo 0 > /sys/devices/system/cpu/cpu<num>/online
$ echo 1 > /sys/devices/system/cpu/cpu<num>/online

For POWER ISA 2.07 or less, the last bit of HSPRG0 is set indicating
that thread is waking up from winkle. Hence, the last bit of HSPRG0(r13)
needs to be clear before accessing it as PACA to avoid loading invalid
values from invalid PACA pointer.

Fix this by loading TOC after r13 register is corrected.

Fixes: 65f267fd4a4f ("powerpc/powernv: Add platform support for stop instruction")
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/idle_book3s.S