From patchwork Thu Mar 22 18:14:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10302117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FC6E600F6 for ; Thu, 22 Mar 2018 18:22:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F93728477 for ; Thu, 22 Mar 2018 18:22:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5440D288FA; Thu, 22 Mar 2018 18:22:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEDCF28477 for ; Thu, 22 Mar 2018 18:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=B0IU+CqlG+opBBjmVYBQYO/kGQNV9RbaAt3cwf3sQNc=; b=JkqL3p3hVk3wPFCi+h6eOGtu3S SLr+pt8WjYLJ34INvsWQHIaUWpw5/dP0QtFRE4AyadyYRq6/8Sq9qHMSJ0KXF4l+bKbFQEtjuK0/H v1NWBx8vGZ7WAwlYDWopegkW0SlZNAJGiO7iYDrOIsbZCEAd4d6KeFoMG9+yHyuaUrzBdfYqRWEjR 8ewWZ6NWobYUN9zuUPA+vtY0DE5K7fEGfgjb2DbK4BScgIDHvexiFBfleXh5UbrJXe+JCS70O9ruZ RbK9ySM4GmxZKsCGrdL1+W/MJVccO4z+DqdCZsNt0VoFP47FkQVMMlzmCD84nYTdJ96oVIQ6oIXKJ Fe/OoPQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ez4qo-0007uw-Vt; Thu, 22 Mar 2018 18:22:10 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ez4mw-0004H7-LW for linux-arm-kernel@lists.infradead.org; Thu, 22 Mar 2018 18:18:18 +0000 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 3F1CF1529; Thu, 22 Mar 2018 11:18:04 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.207.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4F9F53F487; Thu, 22 Mar 2018 11:18:01 -0700 (PDT) From: James Morse To: linux-acpi@vger.kernel.org Subject: [PATCH v2 07/11] ACPI / APEI: Split fixmap pages for arm64 NMI-like notifications Date: Thu, 22 Mar 2018 18:14:41 +0000 Message-Id: <20180322181445.23298-8-james.morse@arm.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180322181445.23298-1-james.morse@arm.com> References: <20180322181445.23298-1-james.morse@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180322_111811_664060_49EF54A0 X-CRM114-Status: GOOD ( 14.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rafael Wysocki , Tony Luck , Christoffer Dall , Punit Agrawal , Xie XiuQi , Marc Zyngier , Catalin Marinas , Tyler Baicar , Will Deacon , Dongjiu Geng , linux-mm@kvack.org, Borislav Petkov , James Morse , Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that ghes uses the fixmap addresses and locks via some indirection we can support multiple NMI-like notifications on arm64. These should be named after their notification method. x86's NOTIFY_NMI already is, change the SEA fixmap entry to be called FIX_APEI_GHES_SEA. Future patches can add support for FIX_APEI_GHES_SEI and FIX_APEI_GHES_SDEI_{NORMAL,CRITICAL}. Signed-off-by: James Morse Reviewed-by: Punit Agrawal --- arch/arm64/include/asm/fixmap.h | 4 +++- drivers/acpi/apei/ghes.c | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h index ec1e6d6fa14c..c3974517c2cb 100644 --- a/arch/arm64/include/asm/fixmap.h +++ b/arch/arm64/include/asm/fixmap.h @@ -55,7 +55,9 @@ enum fixed_addresses { #ifdef CONFIG_ACPI_APEI_GHES /* Used for GHES mapping from assorted contexts */ FIX_APEI_GHES_IRQ, - FIX_APEI_GHES_NMI, +#ifdef CONFIG_ACPI_APEI_SEA + FIX_APEI_GHES_SEA, +#endif #endif /* CONFIG_ACPI_APEI_GHES */ #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ffe52382033c..f48bc9061e3a 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -119,7 +119,6 @@ static DEFINE_MUTEX(ghes_list_mutex); * handler, but general ioremap can not be used in atomic context, so * the fixmap is used instead. */ -static DEFINE_RAW_SPINLOCK(ghes_fixmap_lock_nmi); static DEFINE_SPINLOCK(ghes_fixmap_lock_irq); static struct gen_pool *ghes_estatus_pool; @@ -952,6 +951,7 @@ static struct notifier_block ghes_notifier_hed = { #ifdef CONFIG_ACPI_APEI_SEA static LIST_HEAD(ghes_sea); +static DEFINE_RAW_SPINLOCK(ghes_fixmap_lock_sea); /* * Return 0 only if one of the SEA error sources successfully reported an error @@ -964,8 +964,8 @@ int ghes_notify_sea(void) static void ghes_sea_add(struct ghes *ghes) { - ghes->nmi_fixmap_lock = &ghes_fixmap_lock_nmi; - ghes->nmi_fixmap_idx = FIX_APEI_GHES_NMI; + ghes->nmi_fixmap_lock = &ghes_fixmap_lock_sea; + ghes->nmi_fixmap_idx = FIX_APEI_GHES_SEA; ghes_estatus_queue_grow_pool(ghes); mutex_lock(&ghes_list_mutex); @@ -989,12 +989,13 @@ static inline void ghes_sea_remove(struct ghes *ghes) { } #ifdef CONFIG_HAVE_ACPI_APEI_NMI /* - * NMI may be triggered on any CPU, so ghes_in_nmi is used for - * having only one concurrent reader. + * NOTIFY_NMI may be triggered on any CPU, so ghes_in_nmi is + * used for having only one concurrent reader. */ static atomic_t ghes_in_nmi = ATOMIC_INIT(0); static LIST_HEAD(ghes_nmi); +static DEFINE_RAW_SPINLOCK(ghes_fixmap_lock_nmi); static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) {