From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by kanga.kvack.org (Postfix) with ESMTP id 4D3C26B7AD4 for ; Thu, 6 Dec 2018 11:17:37 -0500 (EST) Received: by mail-ot1-f71.google.com with SMTP id 62so383180otr.14 for ; Thu, 06 Dec 2018 08:17:37 -0800 (PST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id g5si285911otn.228.2018.12.06.08.17.36 for ; Thu, 06 Dec 2018 08:17:36 -0800 (PST) Date: Thu, 6 Dec 2018 16:17:30 +0000 From: Catalin Marinas Subject: Re: [PATCH v7 14/25] arm64: KVM/mm: Move SEA handling behind a single 'claim' interface Message-ID: <20181206161730.GM54495@arrakis.emea.arm.com> References: <20181203180613.228133-1-james.morse@arm.com> <20181203180613.228133-15-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203180613.228133-15-james.morse@arm.com> Sender: owner-linux-mm@kvack.org List-ID: To: James Morse Cc: linux-acpi@vger.kernel.org, Rafael Wysocki , Tony Luck , Fan Wu , Xie XiuQi , Marc Zyngier , Will Deacon , Christoffer Dall , Dongjiu Geng , linux-mm@kvack.org, Borislav Petkov , Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown On Mon, Dec 03, 2018 at 06:06:02PM +0000, James Morse wrote: > To split up APEIs in_nmi() path, the caller needs to always be > in_nmi(). Add a helper to do the work and claim the notification. > > When KVM or the arch code takes an exception that might be a RAS > notification, it asks the APEI firmware-first code whether it wants > to claim the exception. A future kernel-first mechanism may be queried > afterwards, and claim the notification, otherwise we fall through > to the existing default behaviour. > > The NOTIFY_SEA code was merged before considering multiple, possibly > interacting, NMI-like notifications and the need to consider kernel > first in the future. Make the 'claiming' behaviour explicit. > > Restructuring the APEI code to allow multiple NMI-like notifications > means any notification that might interrupt interrupts-masked > code must always be wrapped in nmi_enter()/nmi_exit(). This will > allow APEI to use in_nmi() to use the right fixmap entries. > > Mask SError over this window to prevent an asynchronous RAS error > arriving and tripping 'nmi_enter()'s BUG_ON(in_nmi()). > > Signed-off-by: James Morse > Acked-by: Marc Zyngier > Tested-by: Tyler Baicar Acked-by: Catalin Marinas