Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3472022imu; Sun, 11 Nov 2018 15:53:34 -0800 (PST) X-Google-Smtp-Source: AJdET5fL82gpogVRkqjOK+mR70Spf/TyUGoQpA6RAlFB8qFtmWYoS0uXada6LllFpltsWtF4fFdh X-Received: by 2002:a62:cac4:: with SMTP id y65-v6mr17900172pfk.27.1541980414277; Sun, 11 Nov 2018 15:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980414; cv=none; d=google.com; s=arc-20160816; b=y7RTdmATrJz1eHs3Iqctlm1q0o7bHIYXtoSW1hfLdusLFz7M8RG8GfFs1klcFVSjjP 2OHJcT4fvLYitHQsLSYqVzLc/sDt9VOqZ+QIsA3tHZCnFuKOOIjP1y7gEc4PSNL97jfs GTV0mmEWomn28TfJb+r2/GsZYStNd3jfEIL9afUW22KjrP02VriDsrn/rbR98Mk+mzAD prxXpZTX4DYZvoGuYdwDQ1Y3NAfMyE/ca8H18j+YDXMSdfhY4YoYSxiRPFRIc1LFRF8Y wlhw4SyL+KwXNtdt9ZpQwol8oAzOvNwEXAh1N1JT7/9cmlqRkJ3Br7vwFfW8XuPzgolA B2WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wi6cvbkPi9NkGvwDG5Tk/btCL6XMUMuogbxSX/Qn8sY=; b=Icizg1u08sNe7bqb58XCk/CH4XGbMOoK4BcET02ekMlWKhmmidQqvyrXJIQyjZhrMY pkUUuYsiU0TFLaBYmXz1Tdk80GGexTnOu06qEuGI7aG60wbcoSrTa8VJuyoQ68Ov8XHo fIT9986B7tHlptfhU0/hkX3wEPQKasIW+7e1nz27TY/7VhF4pRXYViaZSI6LRzp1uCi7 vYMHuaKxRbJHlSjFaKYjvXqTnJp4evtqL8YscvnYOz962CQh1ZEffWyP2Z0gsYxNhKih iYeEeVPnxUQwuuok0+tZiXiNvr3MFAlfeCWC62w4Dxkji5uS+f4jys7ElDJcaow3sH4r ZxaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZNp+n6/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si17739644pfh.233.2018.11.11.15.53.19; Sun, 11 Nov 2018 15:53:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZNp+n6/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732957AbeKLJnU (ORCPT + 99 others); Mon, 12 Nov 2018 04:43:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:37302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729525AbeKLIS0 (ORCPT ); Mon, 12 Nov 2018 03:18:26 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 044FD223CB; Sun, 11 Nov 2018 22:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975311; bh=9QrDgurJfpklA+V/Zreigr7MBAtuXFYMWEmHPARX4lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZNp+n6/vhjAsfvzgh8bDrcnIpIHVxb49hJoFiyvDU2/6PY6nXR0JbqLWkK6rO1kxq XBZTw9NYXyw+QuseioPcRYZrS89qP2vbHyAwzy7IpLy+63ARX8sx3zm215ekFCU0Il N+ClVfllJr6p6lys5omqASkynVpTDI+jTzzB52Yk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Neuling , Paul Mackerras Subject: [PATCH 4.19 282/361] powerpc/tm: Fix HFSCR bit for no suspend case Date: Sun, 11 Nov 2018 14:20:29 -0800 Message-Id: <20181111221655.978383172@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Neuling commit dd9a8c5a87395b6f05552c3b44e42fdc95760552 upstream. Currently on P9N DD2.1 we end up taking infinite TM facility unavailable exceptions on the first TM usage by userspace. In the special case of TM no suspend (P9N DD2.1), Linux is told TM is off via CPU dt-ftrs but told to (partially) use it via OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED. So HFSCR[TM] will be off from dt-ftrs but we need to turn it on for the no suspend case. This patch fixes this by enabling HFSCR TM in this case. Cc: stable@vger.kernel.org # 4.15+ Signed-off-by: Michael Neuling Signed-off-by: Paul Mackerras Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/setup_64.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -243,13 +243,19 @@ static void cpu_ready_for_interrupts(voi } /* - * Fixup HFSCR:TM based on CPU features. The bit is set by our - * early asm init because at that point we haven't updated our - * CPU features from firmware and device-tree. Here we have, - * so let's do it. + * Set HFSCR:TM based on CPU features: + * In the special case of TM no suspend (P9N DD2.1), Linux is + * told TM is off via the dt-ftrs but told to (partially) use + * it via OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED. So HFSCR[TM] + * will be off from dt-ftrs but we need to turn it on for the + * no suspend case. */ - if (cpu_has_feature(CPU_FTR_HVMODE) && !cpu_has_feature(CPU_FTR_TM_COMP)) - mtspr(SPRN_HFSCR, mfspr(SPRN_HFSCR) & ~HFSCR_TM); + if (cpu_has_feature(CPU_FTR_HVMODE)) { + if (cpu_has_feature(CPU_FTR_TM_COMP)) + mtspr(SPRN_HFSCR, mfspr(SPRN_HFSCR) | HFSCR_TM); + else + mtspr(SPRN_HFSCR, mfspr(SPRN_HFSCR) & ~HFSCR_TM); + } /* Set IR and DR in PACA MSR */ get_paca()->kernel_msr = MSR_KERNEL;