]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix idle wakeup potential to clobber registers
authorNicholas Piggin <npiggin@gmail.com>
Fri, 17 Mar 2017 05:13:20 +0000 (15:13 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Mar 2017 09:35:12 +0000 (20:35 +1100)
commit98ab0ceff303ef85870324e2b70f52b2a8bd9f2d
treec82e26270f43b62c901d506e99adc1b6d0717d91
parent5f112193c4e1e9ad16e25d609d5673103e112d39
powerpc/64s: Fix idle wakeup potential to clobber registers

We concluded there may be a window where the idle wakeup code could get
to pnv_wakeup_tb_loss() (which clobbers non-volatile GPRs), but the
hardware may set SRR1[46:47] to 01b (no state loss) which would result
in the wakeup code failing to restore non-volatile GPRs.

I was not able to trigger this condition with trivial tests on real
hardware or simulator, but the ISA (at least 2.07) seems to allow for
it, and Gautham says that it can happen if there is an exception pending
when the sleep/winkle instruction is executed.

Fixes: f34b34aa495e ("powerpc/kvm: make hypervisor state restore a function")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/idle_book3s.S