OSDN Git Service

s390/kvm: fix interrupt race with HANDLE_SIE_INTERCEPT
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 22 Jun 2015 15:14:14 +0000 (17:14 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 22 Jul 2015 07:58:03 +0000 (09:58 +0200)
commitdcd2a9aaa0e0331ba0c4d7a64830788f22f26aa4
tree49711292e4ef4cd27bc12f326c12f7194c1b293e
parentd05377c12ae2ac88e747a28ae1e23f556d549592
s390/kvm: fix interrupt race with HANDLE_SIE_INTERCEPT

The HANDLE_SIE_INTERCEPT macro is used in the interrupt handlers
and the program check handler to undo a few changes done by sie64a.
Among them are guest vs host LPP, the gmap ASCE vs kernel ASCE and
the bit that indicates that SIE is currently running on the CPU.

There is a race of a voluntary SIE exit vs asynchronous interrupts.
If the CPU completed the SIE instruction and the TM instruction of
the LPP macro at the time it receives an interrupt, the interrupt
handler will run while the LPP, the ASCE and the SIE bit are still
set up for guest execution. This might result in wrong sampling data,
but it will not cause data corruption or lockups.

The critical section in sie64a needs to be enlarged to include all
instructions that undo the changes required for guest execution.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/entry.S