Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp368653pxk; Fri, 11 Sep 2020 09:05:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIcBWYQNZdUZdCeGFXEOzSwhRc714HclgRCj+Yin8YM0xxZxcVHHJCRzxjNqYuYYxekcRZ X-Received: by 2002:aa7:d403:: with SMTP id z3mr2761124edq.310.1599840322341; Fri, 11 Sep 2020 09:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599840322; cv=none; d=google.com; s=arc-20160816; b=amYXMEjWIrY5hHY5yK1EbYS2WfRIBIllQr+gpVi7M6tLcpjGZxTlFr8EL49RdQzyFw jardVCxENJrlf1hy6C4B9vWzenB/1uR3Hg79VeDfe4+Ob/XHcxtETJnNUpIivytiwc0+ uyBTM8rhwPqXaNBvhzpcnhHbvyXDkuoM7wWsSy1JM4o8//3x2I0wcGw76LYxQ4doiXIr cPHInfQ8nk/Q6hRReA0/tUAAI51tT45N38leokSW8B9iJmAxuB/9h4tf9FYEHu6f3XUD b2D0tV8QRFXpr/iOpUrk+YeCsODDB4Y3BQlr5aNNsdrWfcSUKgslH6GIJA3eSeFI/DhV zlBA== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=Ep4GhHQzkcPPOcu7Qw1leOAOTFkVG3d+tO/FURVuJos=; b=ns7X6y6bx++rqC/oIeDmqIgngDIdnhIsRSNRch0sIYJobMow+Xw1YLfl111vYjxEqh N0xj7mlxhuP7vV9jrTKXpd6qThRW0UjPX85uAu0JmrNxMYH0tR57fygq7Cr3rr1lqnmz 0oGhDc81EDATx2C/tx5fXKxZ2/230KkB1eebkoJ73df4/LC0/A4hP3l3UeXOi/ZrMiBO WsMAzkzFYOHzMniVnk7s9k9qnrXQ8nM2i5tPKukFKYqhplW+S6w8AvyLOX3tkgDGB2TD oMXMnuoEvyp6fEHnF8tYK0GHZDnlFqBiSTu2+JzHAuT2Heqr5LbSYDDIyu8hhz8TA10+ XD/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=UrUsxTIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx23si1520730ejb.355.2020.09.11.09.04.58; Fri, 11 Sep 2020 09:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=UrUsxTIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725904AbgIKQDe (ORCPT + 99 others); Fri, 11 Sep 2020 12:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbgIKQCk (ORCPT ); Fri, 11 Sep 2020 12:02:40 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E2B1C061573 for ; Fri, 11 Sep 2020 06:25:02 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BnxKp3lBvz9sTN; Fri, 11 Sep 2020 23:23:57 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1599830639; bh=3GjkYcPqs3ZA/bSxg0wAn4yNJ8JMUPPVp+hwR5eSDBM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UrUsxTInpnbdHP6suY/Sb4wvknzIPRTNTvgIqQ+zndA/xjcMT7GPGScgVUp5ccamc N039a4XehE0CWxL5HWL0y9c3InE9AY0eEUPdRMcwyxmFKOvj3EH2WyUtnIJYXnDinV gc35uTczu1ha1go43Vy9RYxV4HT0Rpl7iIMZlc2vAz9m0ODBahme3oyu/Ni8htbL56 7YfFEqcxrI0t4E0PGeEHjolK2MGvEEmjGF9UDP4yi5BS8l3Ho879N1y64TXrnWmOJe bPTpCfBXsdo9Ar3YyDAgpCe2z72rOad+OkXaTDtmFw4lbFMhvZZDMPdgyySgW2wSEx Jh+j/PQZbwnOA== From: Michael Ellerman To: Michal =?utf-8?Q?Such=C3=A1nek?= , Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/traps: fix recoverability of machine check handling on book3s/32 In-Reply-To: <20200911091542.GE29521@kitsune.suse.cz> References: <1c804764d38fb084b420b12ca13e8c1b2dea075e.1548166189.git.christophe.leroy@c-s.fr> <20200911091542.GE29521@kitsune.suse.cz> Date: Fri, 11 Sep 2020 23:23:57 +1000 Message-ID: <87pn6sqweq.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Such=C3=A1nek writes: > Hello, > > does this logic apply to "Unrecoverable System Reset" as well? Which logic do you mean? We do call die() before checking MSR_RI in system_reset_exception(): /* * No debugger or crash dump registered, print logs then * panic. */ die("System Reset", regs, SIGABRT); =20=20 mdelay(2*MSEC_PER_SEC); /* Wait a little while for others to print */ add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); nmi_panic(regs, "System Reset"); =20=20 out: #ifdef CONFIG_PPC_BOOK3S_64 BUG_ON(get_paca()->in_nmi =3D=3D 0); if (get_paca()->in_nmi > 1) die("Unrecoverable nested System Reset", regs, SIGABRT); #endif /* Must die if the interrupt is not recoverable */ if (!(regs->msr & MSR_RI)) die("Unrecoverable System Reset", regs, SIGABRT); So you should see the output from die("System Reset", ...) even if MSR[RI] was clear when you took the system reset. cheers > On Tue, Jan 22, 2019 at 02:11:24PM +0000, Christophe Leroy wrote: >> Looks like book3s/32 doesn't set RI on machine check, so >> checking RI before calling die() will always be fatal >> allthought this is not an issue in most cases. >>=20 >> Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable= interrupt") >> Fixes: daf00ae71dad ("powerpc/traps: restore recoverability of machine_c= heck interrupts") >> Signed-off-by: Christophe Leroy >> Cc: stable@vger.kernel.org >> --- >> arch/powerpc/kernel/traps.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >>=20 >> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c >> index 64936b60d521..c740f8bfccc9 100644 >> --- a/arch/powerpc/kernel/traps.c >> +++ b/arch/powerpc/kernel/traps.c >> @@ -763,15 +763,15 @@ void machine_check_exception(struct pt_regs *regs) >> if (check_io_access(regs)) >> goto bail; >>=20=20 >> - /* Must die if the interrupt is not recoverable */ >> - if (!(regs->msr & MSR_RI)) >> - nmi_panic(regs, "Unrecoverable Machine check"); >> - >> if (!nested) >> nmi_exit(); >>=20=20 >> die("Machine check", regs, SIGBUS); >>=20=20 >> + /* Must die if the interrupt is not recoverable */ >> + if (!(regs->msr & MSR_RI)) >> + nmi_panic(regs, "Unrecoverable Machine check"); >> + >> return; >>=20=20 >> bail: >> --=20 >> 2.13.3 >>=20