diff mbox

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

Message ID 1395985237-27345-1-git-send-email-mikey@neuling.org
State New, archived
Headers show

Commit Message

Michael Neuling March 28, 2014, 5:40 a.m. UTC
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@neuling.org>
---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Paul Mackerras March 28, 2014, 11:08 a.m. UTC | #1
On Fri, Mar 28, 2014 at 04:40:36PM +1100, Michael Neuling wrote:
> 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.

Thanks, Mikey.

Do you mind if I fold these two patches into patch 2/8 of the set I
posted?

Paul.
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini March 28, 2014, 12:14 p.m. UTC | #2
Il 28/03/2014 12:08, Paul Mackerras ha scritto:
>> > 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.
> Thanks, Mikey.
>
> Do you mind if I fold these two patches into patch 2/8 of the set I
> posted?

In either case, am I right that this doesn't include the patches in 
kvm-ppc-queue?  I'm waiting for the pull request. :)

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

Patch

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