]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds
authorMichael Neuling <mikey@neuling.org>
Thu, 13 Sep 2018 05:33:47 +0000 (15:33 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Sep 2018 06:23:28 +0000 (16:23 +1000)
commitbf1e02f66829078899ba9be70a232ce6734540bc
treef7179ab15ba302b978937ad2a27018fc8fe5a410
parentd9cd171e36a0a756e2d44073ffb1adf94fb7ed60
KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds

When we come into the softpatch handler (0x1500), we use r11 to store
the HSRR0 for later use by the denorm handler.

We also use the softpatch handler for the TM workarounds for
POWER9. Unfortunately, in kvmppc_interrupt_hv we later store r11 out
to the vcpu assuming it's still what we got from userspace.

This causes r11 to be corrupted in the VCPU and hence when we restore
the guest, we get a corrupted r11. We've seen this when running TM
tests inside guests on P9.

This fixes the problem by only touching r11 in the denorm case.

Fixes: fc35d41584 ("KVM: PPC: Book3S HV: Work around transactional memory bugs in POWER9")
Cc: <stable@vger.kernel.org> # 4.17+
Test-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S