Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3609635imm; Mon, 15 Oct 2018 00:43:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Bmqkcoz+sToHN+iX6xSsU5XMb78ybwNh3HnFCtv5n/ZlVv70JrAo69GnVupEzjpAHx3VE X-Received: by 2002:a17:902:9b84:: with SMTP id y4-v6mr16278630plp.332.1539589403391; Mon, 15 Oct 2018 00:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539589403; cv=none; d=google.com; s=arc-20160816; b=zcR9QuC66CcJTyreNIpLsU/M5oOSgCFoSmM5eYI7ntoPafMOtnBIOzUOhD5Y9aqOba c33e6VkOXfchrCrv4NM3lDok08g2927zJ4b6Y5DVd3dSx0YbM3Xw0YFDjC+TRNF7xb5Q bbyKj991+ZJYBW3VtDTCA6SNTp+LRmcpZevqOAX3VJXBbgA9pst1sXYkAGu2zNHgI//C 3WU75eKN7wMiT557Ud4NzdXnsirjbotumPL4RNzncRaZH/gYRHBFkqemBm0bST1hvXFE 6ELsB+ou9O0z5GkFzqQh1LuPpWleqLKoi93U4W9c0oZMr7BThRj1SJf7l9pyfqwGqHWo vGcA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=zbgspRaYewiEUnic/Hh0PDRxHCj2KpqF6F4JpAcSEFM=; b=G5w/NGUMsJ20GfSO+wadrlT+2oaCTjm//naNDFzMsAHLZD3mUyvWTk7rsT3tr7WREO 0tDbnfBNRcWWZh5GMsnfvhsRv7mpTNwfG1yi0LPX9/4P1BwD2mmBXOwHmsb9RzR0K/OO iqL8TvZ7orb7JG7VZJXHt1khbBbXJYGkDIek66a/RKrC+vbpAlQoc9TP8GaG/9uJ37oY l+5NjTjQuiNw6nfwtvtnv/yHRwsVQ2A81U7NtDLXUIe3z3WRPYsxkzMOxrXeDdD+620a pvqouXaFQut796Fwn1b0krLRbCcRVlSO8M1VidDmY86mQUgt/FNYiSfVcxhdmwZ/9sRy B7fw== ARC-Authentication-Results: i=1; mx.google.com; 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 m1-v6si9463150pgq.112.2018.10.15.00.43.08; Mon, 15 Oct 2018 00:43:23 -0700 (PDT) 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; 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 S1726718AbeJOPY4 (ORCPT + 99 others); Mon, 15 Oct 2018 11:24:56 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:24934 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeJOPY4 (ORCPT ); Mon, 15 Oct 2018 11:24:56 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42YVjQ0ZCTz9ttC9; Mon, 15 Oct 2018 09:40:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id CIRxqfhijdlL; Mon, 15 Oct 2018 09:40:42 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42YVjQ04btz9ttC7; Mon, 15 Oct 2018 09:40:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2B8898B788; Mon, 15 Oct 2018 09:40:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id X8TwBg0NVB6w; Mon, 15 Oct 2018 09:40:51 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EF36E8B786; Mon, 15 Oct 2018 09:40:50 +0200 (CEST) Subject: Re: [PATCH] powerpc/traps: restore recoverability of machine_check interrupts From: Christophe LEROY To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "stable@vger.kernel.org" References: Message-ID: Date: Mon, 15 Oct 2018 09:40:50 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Le 13/10/2018 à 11:16, Christophe Leroy a écrit : > commit b96672dd840f ("powerpc: Machine check interrupt is a non- > maskable interrupt") added a call to nmi_enter() at the beginning of > machine check restart exception handler. Due to that, in_interrupt() > always returns true regardless of the state before entering the > exception, and die() panics even when the system was not already in > interrupt. > > This patch calls nmi_exit() before calling die() in order to restore > the interrupt state we had before calling nmi_enter() > > Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt") > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/traps.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c > index fd58749b4d6b..4f880c2a6e4c 100644 > --- a/arch/powerpc/kernel/traps.c > +++ b/arch/powerpc/kernel/traps.c > @@ -765,12 +765,17 @@ void machine_check_exception(struct pt_regs *regs) > if (check_io_access(regs)) > goto bail; > > - die("Machine check", regs, SIGBUS); > - > /* 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); > + > + return; > + > bail: > if (!nested) > nmi_exit(); >