]> git.baikalelectronics.ru Git - kernel.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)
commit66055422ac27186490d080738a0f48ec1862862f
tree1016f43d2c65f708b433ac360add43c0a9564ee0
parent2a09a5bf598b529fb3fde6a288c06f4e65a70de0
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: fc35d41584d7 ("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