]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV P9: Fix guest TM support
authorNicholas Piggin <npiggin@gmail.com>
Mon, 12 Jul 2021 01:36:50 +0000 (11:36 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 15 Jul 2021 11:53:37 +0000 (21:53 +1000)
commit8ecbe7e57789af3564dad4a8ed847bd7b67c775d
treeb5df1f342f7f20f3be8d893210ec49b6d2401b20
parent01da9c8979f3d24bb75ef7080a8d9915e88dff94
KVM: PPC: Book3S HV P9: Fix guest TM support

The conversion to C introduced several bugs in TM handling that can
cause host crashes with TM bad thing interrupts. Mostly just simple
typos or missed logic in the conversion that got through due to my
not testing TM in the guest sufficiently.

- Early TM emulation for the softpatch interrupt should be done if fake
  suspend mode is _not_ active.

- Early TM emulation wants to return immediately to the guest so as to
  not doom transactions unnecessarily.

- And if exiting from the guest, the host MSR should include the TM[S]
  bit if the guest was T/S, before it is treclaimed.

After this fix, all the TM selftests pass when running on a P9 processor
that implements TM with softpatch interrupt.

Fixes: 8b36738cf8c2d ("KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C")
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210712013650.376325-1-npiggin@gmail.com
arch/powerpc/kvm/book3s_hv_p9_entry.c