KVM: PPC: Book3S PR: Fix MSR setting when delivering interrupts
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 7 Jun 2018 08:04:37 +0000 (18:04 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 12 Jun 2018 23:45:28 +0000 (09:45 +1000)
commit916ccadccdcd8a0b7184dce37066a9fb2f9b4195
treef96e9a1d3d6007a7753d9e4cd891b74b8f683a91
parentb71dc519a993d10f5db416c82b174f60e644ac3a
KVM: PPC: Book3S PR: Fix MSR setting when delivering interrupts

This makes sure that MSR "partial-function" bits are not transferred
to SRR1 when delivering an interrupt.  This was causing failures in
guests running kernels that include commit f3d96e698ed0 ("powerpc/mm:
Overhaul handling of bad page faults", 2017-07-19), which added code
to check bits of SRR1 on instruction storage interrupts (ISIs) that
indicate a bad page fault.  The symptom was that a guest user program
that handled a signal and attempted to return from the signal handler
would get a SIGBUS signal and die.

The code that generated ISIs and some other interrupts would
previously set bits in the guest MSR to indicate the interrupt status
and then call kvmppc_book3s_queue_irqprio().  This technique no
longer works now that kvmppc_inject_interrupt() is masking off those
bits.  Instead we make kvmppc_core_queue_data_storage() and
kvmppc_core_queue_inst_storage() call kvmppc_inject_interrupt()
directly, and make sure that all the places that generate ISIs or
DSIs call kvmppc_core_queue_{data,inst}_storage instead of
kvmppc_book3s_queue_irqprio().

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/book3s_pr.c