Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2137686pxk; Mon, 14 Sep 2020 05:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBvAYc62BrRoFeGurfbT3ZmtZWXoXPhvWH7wtu2OFokr4gypE+5nStG+gueG5EGbicIUg0 X-Received: by 2002:a17:906:9389:: with SMTP id l9mr14905344ejx.537.1600087917031; Mon, 14 Sep 2020 05:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600087917; cv=none; d=google.com; s=arc-20160816; b=Df2No4IuPEldC4UDA4gupBQ2Lja5H7xFDB5KlZQqznEPeZzVCpwXcYnvubHd0lHTGY saJKQmVDFwT5758YQc4LFAZyFqMvhmfJVBLP3wuHvruweGgsNBo3EX5poCjjSSmcAMOX pmqmiUzpyrY06XqipPh433m4AmgtlylmG0yToACAcDD1WTfyNQOFh3c1wU+YVsKW3pne X+5LpfXbi62vgQpEQsvSWx77pInB26LCDC7jBxn2fhj5+a5ndrv/7zsDBPRW/9qhujhV geomz/5mf1E1Cw7192L17cllLJaif8HDplxCcFLZ3MLWuPMnjYpPY1oGiZ7ahDt7PlaJ G7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oqE9wnILIU0tWcKiNr9cLVtZZpjmoVKevINvIOovjSM=; b=lrBewp6sWwyqBN0whLPZepUdvJWtoqHYUfI42/pPiCaNZHfJL3UlYuxknRMHuZIzsl z+7/am4ZB1WLxmhQd1mUJ25RsR8MuhPAsiwiXCLPHRx0I++jEf6sx3myoYSFH6ILjq5v 9dKgBRmYhKXubQOZsVfmAMK4lM4t40ymbE5J2ur8IBICLFDW0m0WFiXrhhk+/cZJciF1 wXE7p7UN/Tgd+rajADPZ5Li/qKbt409VGmUNJSGGuzEwwb+sIsHNcT9f+f2WyzJE78je zZ3J9A2C+29VFyzD5woc1ojCCCnSoMP9F30/k7Bkv5ktd7lRl4SIUJLIm+HhWaH9gNc9 ZSHg== ARC-Authentication-Results: i=1; mx.google.com; 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 q6si6651766edw.446.2020.09.14.05.51.34; Mon, 14 Sep 2020 05:51:57 -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; 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 S1726547AbgINMuc (ORCPT + 99 others); Mon, 14 Sep 2020 08:50:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:58000 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgINMq6 (ORCPT ); Mon, 14 Sep 2020 08:46:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 586A5AC79; Mon, 14 Sep 2020 12:46:30 +0000 (UTC) Date: Mon, 14 Sep 2020 14:46:12 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Michael Ellerman Cc: Christophe Leroy , 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 Message-ID: <20200914124612.GC29778@kitsune.suse.cz> References: <1c804764d38fb084b420b12ca13e8c1b2dea075e.1548166189.git.christophe.leroy@c-s.fr> <20200911091542.GE29521@kitsune.suse.cz> <87pn6sqweq.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pn6sqweq.fsf@mpe.ellerman.id.au> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11, 2020 at 11:23:57PM +1000, Michael Ellerman wrote: > Michal Such?nek 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); > > 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"); > > out: > #ifdef CONFIG_PPC_BOOK3S_64 > BUG_ON(get_paca()->in_nmi == 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. Indeed, replied to the wrong patch. I was looking at daf00ae71dad ("powerpc/traps: restore recoverability of machine_check interrupts") which has very similar commit message. Sorry about the confusion. Thanks Michal > > 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. > >> > >> Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt") > >> Fixes: daf00ae71dad ("powerpc/traps: restore recoverability of machine_check interrupts") > >> Signed-off-by: Christophe Leroy > >> Cc: stable@vger.kernel.org > >> --- > >> arch/powerpc/kernel/traps.c | 8 ++++---- > >> 1 file changed, 4 insertions(+), 4 deletions(-) > >> > >> 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; > >> > >> - /* Must die if the interrupt is not recoverable */ > >> - if (!(regs->msr & MSR_RI)) > >> - nmi_panic(regs, "Unrecoverable Machine check"); > >> - > >> if (!nested) > >> nmi_exit(); > >> > >> die("Machine check", regs, SIGBUS); > >> > >> + /* Must die if the interrupt is not recoverable */ > >> + if (!(regs->msr & MSR_RI)) > >> + nmi_panic(regs, "Unrecoverable Machine check"); > >> + > >> return; > >> > >> bail: > >> -- > >> 2.13.3 > >>