From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Neuling Subject: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check Date: Fri, 28 Mar 2014 16:40:36 +1100 Message-ID: <1395985237-27345-1-git-send-email-mikey@neuling.org> References: <1395704828-20180-4-git-send-email-paulus@samba.org> Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Anton Blanchard , Michael Neuling To: Alexander Graf , Paul Mackerras Return-path: In-Reply-To: <1395704828-20180-4-git-send-email-paulus@samba.org> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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. + */ + 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Neuling Date: Fri, 28 Mar 2014 05:40:36 +0000 Subject: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check Message-Id: <1395985237-27345-1-git-send-email-mikey@neuling.org> List-Id: References: <1395704828-20180-4-git-send-email-paulus@samba.org> In-Reply-To: <1395704828-20180-4-git-send-email-paulus@samba.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf , Paul Mackerras Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Anton Blanchard , 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. + */ + 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