[PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently using kvmppc_set_one_reg() a transaction could be setup without
TEXASR Failure Summary (FS) not set.  When this is switched back in by the
host, this will result in a TM Bad Thing (ie 0x700 program check) when the
trechkpt is run.

This avoids this by always setting the TEXASR FS when there is an active
transaction being started.

This patch is on top of Paulus' recent KVM TM patch set.

Signed-off-by: Michael Neuling <mikey@xxxxxxxxxxx>
---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 217a22e..01d5701 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -639,6 +639,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_TM)
 	rldicl. r5, r5, 64 - MSR_TS_S_LG, 62
 	beq	1f	/* TM not active in guest */
 
+	/* Make sure the failure summary is set, otherwise we'll program check
+	 * when we trechkpt.  It's possible that this might have been not set
+	 * on a kvmppc_set_one_reg() call but we shouldn't let this crash the
+	 * host.
+	 */
+	oris	r7, r7, (TEXASR_FS)@h
+	mtspr	SPRN_TEXASR, r7
+
 	/*
 	 * We need to load up the checkpointed state for the guest.
 	 * We need to do this early as it will blow away any GPRs, VSRs and
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux