target/ppc: Don't clobber MSR:EE on PM instructions
commit3621e2c96082c6e5094dfec244077a135383d538
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 15 Feb 2019 16:16:40 +0000 (15 17:16 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Feb 2019 22:21:24 +0000 (26 09:21 +1100)
treeab0fdcc7af7e369aac950a76f05d0197acec0893
parent154c69f2b8512bdbfcd48a82bfd902e9449a895a
target/ppc: Don't clobber MSR:EE on PM instructions

When issuing a power management instruction, we set MSR:EE
to force ppc_hw_interrupt() into calling powerpc_excp()
to deal with the fact that on P7 and P8, the system reset
caused by the wakeup needs to be generated regardless of
the MSR:EE value (using LPCR only).

This however means that the OS will see a bogus SRR1:EE
value which is a problem. It also prevents properly
implementing P9 STOP "light".

So fix this by instead putting some logic in ppc_hw_interrupt()
to decide whether to deliver or not by taking into account the
fact that we are waking up from sleep.

The LPCR isn't checked as this is done in the has_work() test.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20190215161648.9600-3-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/excp_helper.c