]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: PPC: Book3S HV: Fix CR0 setting in TM emulation
authorMichael Neuling <mikey@neuling.org>
Thu, 20 Jun 2019 06:00:40 +0000 (16:00 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 Jul 2019 05:19:36 +0000 (15:19 +1000)
commit3fefd1cd95df04da67c83c1cb93b663f04b3324f
tree1016f43d2c65f708b433ac360add43c0a9564ee0
parent5636427d087a55842c1a199dfb839e6545d30e5d
KVM: PPC: Book3S HV: Fix CR0 setting in TM emulation

When emulating tsr, treclaim and trechkpt, we incorrectly set CR0. The
code currently sets:
    CR0 <- 00 || MSR[TS]
but according to the ISA it should be:
    CR0 <-  0 || MSR[TS] || 0

This fixes the bit shift to put the bits in the correct location.

This is a data integrity issue as CR0 is corrupted.

Fixes: 4bb3c7a0208f ("KVM: PPC: Book3S HV: Work around transactional memory bugs in POWER9")
Cc: stable@vger.kernel.org # v4.17+
Tested-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kvm/book3s_hv_tm.c