KVM: PPC: Book3s: mmio: Deliver DSI after emulation failure
authorFabiano Rosas <farosas@linux.ibm.com>
Tue, 25 Jan 2022 21:56:55 +0000 (18:56 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 31 Jan 2022 02:43:00 +0000 (13:43 +1100)
commitc1c8a66367a35aabbad9bd629b105b9fb49f2c1f
tree75092218759f4803b869bd1f97b799bc546bd7a9
parent349fbfe9b918e6dea00734f07c0fbaf4c2e2df5e
KVM: PPC: Book3s: mmio: Deliver DSI after emulation failure

MMIO emulation can fail if the guest uses an instruction that we are
not prepared to emulate. Since these instructions can be and most
likely are valid ones, this is (slightly) closer to an access fault
than to an illegal instruction, so deliver a Data Storage interrupt
instead of a Program interrupt.

BookE ignores bad faults, so it will keep using a Program interrupt
because a DSI would cause a fault loop in the guest.

Suggested-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220125215655.1026224-6-farosas@linux.ibm.com
arch/powerpc/kvm/emulate_loadstore.c
arch/powerpc/kvm/powerpc.c