Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9444656imu; Wed, 5 Dec 2018 05:03:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/VpgmyglEcJE3O9La+8J9fHP5Uht1L2XseEBFK+Yk/E+UMgKfUXmZyFy2HZecMSlwKz2vIq X-Received: by 2002:a62:28c9:: with SMTP id o192mr24798398pfo.57.1544015019983; Wed, 05 Dec 2018 05:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544015019; cv=none; d=google.com; s=arc-20160816; b=TMnTSFGq549xuy0XihJ5tjOs74+KowvfmlYUXrWf4BasywZJcxhjIUk4XL2Bcp76Jr 2mql2Q2dpG9pmSaqD1NVaCG/FIVOK6hxrfszXUmFNA3Z6qCbc4Jw+Pu/XOUAegKYrK7z njIbHIY4aCJhuFBqSSRQu3Ydbwo/2S1mlXm3vQgWkgkn7+rGDqYC8LIHTql91RM4gqGt l7H663xgr0cKITT7ac88mkIWN8NUJxwGLZKEkhqtEjBHgSGD0WaxRXYa9MBUDcIh/LEo q205qpHzx2QVgSkEZsHNPGne2WSXWhxiafr5vzc1KePiNu4VjxnWx2IswCu4SAracoEu wR2Q== 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:from:references:cc:to:subject; bh=eHaguF/RVOlcAnWMH7/X+uw2DsFXkSitZgCtV2SBaOU=; b=mmnJkg0wQmRxgr0opll6qgGWSRjPFIov8jwBawrxQBx7hyg5vMGaCcD9TbfjBgPCXc yYOEw8L4Q+WNJ8D0v1AK+0ECXjXhtRhGwbZWXm2PXekJh5pK0iabUBsZ7zcPtZzBLE2s Y+zAvKWhMtjFeeJHvjyA38HMuOWkmZBQr66VN71SvHb8r4Jafwf6SmsYZq0tDtTqKIl7 85lfvkpBdMADSrXEQzIIH52XgeEihlsalXRph2YwG3OZegGSfpqhecCWyGJ8pxTCvW9v QhKUFJ2m8qyRZtHTZC++3ZRdKOrdqtl/qMrfUQAQz1ei6CQMYLnfU793DCwmhpVVjn+G XzKQ== 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 v9si19148468pgt.464.2018.12.05.05.03.23; Wed, 05 Dec 2018 05:03:39 -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 S1727182AbeLENCk (ORCPT + 99 others); Wed, 5 Dec 2018 08:02:40 -0500 Received: from foss.arm.com ([217.140.101.70]:54050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbeLENCk (ORCPT ); Wed, 5 Dec 2018 08:02:40 -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 D0D5FA78; Wed, 5 Dec 2018 05:02:39 -0800 (PST) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0525D3F575; Wed, 5 Dec 2018 05:02:37 -0800 (PST) Subject: Re: [PATCH v6 21/24] arm64: Handle serror in NMI context To: Catalin Marinas Cc: Julien Thierry , 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, joel@joelfernandes.org, Dave Martin References: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> <1542023835-21446-22-git-send-email-julien.thierry@arm.com> <20181204180917.GE19210@arrakis.emea.arm.com> From: James Morse Message-ID: <3ff15164-11db-d3c9-e194-a35facf9971d@arm.com> Date: Wed, 5 Dec 2018 13:02:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181204180917.GE19210@arrakis.emea.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Catalin, On 04/12/2018 18:09, Catalin Marinas wrote: > 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()? They might need to be here in the future: if we support kernel-first we would have extra calls in here that need to be in_nmi(), the same if we call out to APEI to support APCI's NOTIFY_SEI. Thanks, James