]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc/powernv: Recover correct PACA on wakeup from a stop on P9 DD1
authorGautham R. Shenoy <ego@linux.vnet.ibm.com>
Wed, 17 May 2017 10:51:11 +0000 (06:51 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:45:46 +0000 (10:45 +0200)
commiteade0ee48e7db33309b20dadf1e317dc43ab7dbe
treec0686a50b9ed323c822385ce55efd8c73150ee18
parentf9f9f10f0f4f54a7b252b54823805440f79b9d73
powerpc/powernv: Recover correct PACA on wakeup from a stop on P9 DD1

BugLink: http://bugs.launchpad.net/bugs/1685792
POWER9 DD1.0 hardware has a bug where the SPRs of a thread waking up
from stop 0,1,2 with ESL=1 can endup being misplaced in the core. Thus
the HSPRG0 of a thread waking up from can contain the paca pointer of
its sibling.

This patch implements a context recovery framework within threads of a
core, by provisioning space in paca_struct for saving every sibling
threads's paca pointers. Basically, we should be able to arrive at the
right paca pointer from any of the thread's existing paca pointer.

At bootup, during powernv idle-init, we save the paca address of every
CPU in each one its siblings paca_struct in the slot corresponding to
this CPU's index in the core.

On wakeup from a stop, the thread will determine its index in the core
from the TIR register and recover its PACA pointer by indexing into
the correct slot in the provisioned space in the current PACA.

Furthermore, ensure that the NVGPRs are restored from the stack on the
way out by setting the NAPSTATELOST in paca.

[Changelog written with inputs from svaidy@linux.vnet.ibm.com]
Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Call it a bug]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(backported from commit 17ed4c8f81da2bf340d33a8c875f4d6b1dfd9398)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/idle_book3s.S
arch/powerpc/platforms/powernv/idle.c