Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8557886imu; Tue, 4 Dec 2018 10:11:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/UsNLysAvIj0lf2cUd58RCdSp0LvxZ8C7kF9kLWEpTUWkqyRbli+aVEYPeL4wxAwTM+v8dh X-Received: by 2002:a17:902:4503:: with SMTP id m3mr21282538pld.23.1543947092723; Tue, 04 Dec 2018 10:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543947092; cv=none; d=google.com; s=arc-20160816; b=CLo2TfJBxKPEtq/6qaE/Fls6g45fpgFzjdSLFNVFJ36EbpXVqbBTG5r1TEy8aiJ6rE 2py9bmbQySzUQcxwz/VNTNLUP7oLx7V5BsRr0L/iuLRa2U0FZiYqB1JnjvF/1Hrm9ClX EVbSL/5nA3zEsEfbqV0k4otJRMfPOTJr202yz5m4t0H6gup8eVLsYdeIt04PvEPlwJE6 qn7zpmfep1JB3lcYHjF6Xq5MVI9MS3eOVB+8QRKhvdSFXkIGCRnNpTlMfyTMAV79Fc2v jOSTBFn5bF84nJ21Na/6iqTLtj0vVuvdKvR5T/5gWoebZSDRVj8YhiuQuHGJjuf5l5Ic NwHA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oUQOkDEEHJLuX33UFQ/1YUn66MM+57iFa22b6pwuRz4=; b=iElgXvcyz4D6NhOrCZmDKdtnt5+Jf+8AylNdu34IoEr2dW0W08zZFNCyldroAdFiWl CBJuoxIc1rO3I/iaZPpNZYcy+DMYRmylWEWFNL3GAZHxcV3wzfYk07jJdsGY4VDzi1jh /+rbQneA6XtV9eyw5pbQMWrvGP2z7GhM6OntoyX0UxeOt8joKMjJJThJqTtArgVMfKu2 YHG48r+iNgnqvq4EX5GunqwMbSXDdDvceDUF0NrwVEMYWu0eWD9uKa1ybqST9009coXe 8tursYPo6RdlFgvbseeUd1pUDKdOo1uDRYktCmtClTQVcciD/MWKURPm/EymAuFuIo55 gBQA== 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 q127si20758791pfq.19.2018.12.04.10.11.15; Tue, 04 Dec 2018 10:11:32 -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; 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 S1725927AbeLDSJX (ORCPT + 99 others); Tue, 4 Dec 2018 13:09:23 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38440 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbeLDSJX (ORCPT ); Tue, 4 Dec 2018 13:09:23 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AD485A78; Tue, 4 Dec 2018 10:09:22 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD2453F59C; Tue, 4 Dec 2018 10:09:20 -0800 (PST) Date: Tue, 4 Dec 2018 18:09:18 +0000 From: Catalin Marinas To: Julien Thierry Cc: linux-arm-kernel@lists.infradead.org, Mark Rutland , daniel.thompson@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, james.morse@arm.com, joel@joelfernandes.org, Dave Martin Subject: Re: [PATCH v6 21/24] arm64: Handle serror in NMI context Message-ID: <20181204180917.GE19210@arrakis.emea.arm.com> References: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> <1542023835-21446-22-git-send-email-julien.thierry@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542023835-21446-22-git-send-email-julien.thierry@arm.com> 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 Mon, Nov 12, 2018 at 11:57:12AM +0000, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index 5f4d9ac..66344cd 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -897,13 +897,17 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr) > > asmlinkage void do_serror(struct pt_regs *regs, unsigned int esr) > { > - nmi_enter(); > + const bool was_in_nmi = in_nmi(); > + > + if (!was_in_nmi) > + nmi_enter(); > > /* non-RAS errors are not containable */ > if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr)) > arm64_serror_panic(regs, esr); > > - nmi_exit(); > + if (!was_in_nmi) > + nmi_exit(); > } Do we actually need nmi_enter/exit in the outer do_serror() function? Could we just move it to arm64_serror_panic()? -- Catalin