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

2014-03-28 Thread Paolo Bonzini

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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-03-28 Thread Paul Mackerras
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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-03-27 Thread Michael Neuling
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 
---
 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.
+*/
+   orisr7, 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html