KVM: PPC: Book3S HV Nested: Fix TM softpatch HFAC interrupt emulation
authorNicholas Piggin <npiggin@gmail.com>
Wed, 11 Aug 2021 16:00:38 +0000 (02:00 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Aug 2021 06:37:17 +0000 (16:37 +1000)
commitd82b392d9b3556b63e3f9916cf057ea847e173a9
treefea730012a8d023806cf1abe07e622f4a12b94d5
parent4782e0cd0d184d727ad3b0cfe20d1d44d9f98239
KVM: PPC: Book3S HV Nested: Fix TM softpatch HFAC interrupt emulation

Have the TM softpatch emulation code set up the HFAC interrupt and
return -1 in case an instruction was executed with HFSCR bits clear,
and have the interrupt exit handler fall through to the HFAC handler.
When the L0 is running a nested guest, this ensures the HFAC interrupt
is correctly passed up to the L1.

The "direct guest" exit handler will turn these into PROGILL program
interrupts so functionality in practice will be unchanged. But it's
possible an L1 would want to handle these in a different way.

Also rearrange the FAC interrupt emulation code to match the HFAC format
while here (mainly, adding the FSCR_INTR_CAUSE mask).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210811160134.904987-5-npiggin@gmail.com
arch/powerpc/include/asm/reg.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_tm.c