From patchwork Fri Mar 28 05:40:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 334592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 63989140144 for ; Fri, 28 Mar 2014 16:41:04 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068AbaC1Fk7 (ORCPT ); Fri, 28 Mar 2014 01:40:59 -0400 Received: from ozlabs.org ([203.10.76.45]:50541 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbaC1Fkl (ORCPT ); Fri, 28 Mar 2014 01:40:41 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 2CFAE1400BA; Fri, 28 Mar 2014 16:40:39 +1100 (EST) Received: by localhost.localdomain (Postfix, from userid 1000) id 49D52D44289; Fri, 28 Mar 2014 16:40:38 +1100 (EST) From: Michael Neuling To: Alexander Graf , Paul Mackerras Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Anton Blanchard , 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> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395704828-20180-4-git-send-email-paulus@samba.org> References: <1395704828-20180-4-git-send-email-paulus@samba.org> Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@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