From patchwork Thu Feb 15 18:56:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10223377 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 960856056E for ; Thu, 15 Feb 2018 19:04:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81C4029474 for ; Thu, 15 Feb 2018 19:04:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7132129406; Thu, 15 Feb 2018 19:04:32 +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 783D729474 for ; Thu, 15 Feb 2018 19:04:31 +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=HVUq8ViSd9sWYRP/pkkfYlNw+jTluTOlryc7a++OIPw=; b=fNjj1bm/PZXZQmvZz6rlsCuLcM LgCtG6JS+pxLbpt2Mwre5c5dUFUV3FA1j/11RLzIylXiOx5CIYRqaFAFmdZJPC4weWpK2yR6o0g62 0cRdkAvJe6jFWzVyhDSQIJLMNG4mj7MaV2JQzXE/8YmQfHlwCjyt5djSDVfwWn5JzNQyuHPX6IMj0 vSsqMaA/Xch3D4EKWUaePZNFUuiWyv0Y6FwjXQNZRQSwP5CIyMbCYPW5cFFz7bKzVMl3O9b/g1b2E EJ0ltV0GH2w0CRIDEqpk3gdzXWLaxuLmePuijxn3/eeB+hNuugLU6X+VDFpTTCBqXZgUoDOHT2EzX 5WaCBgeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emOpV-00013z-Mm; Thu, 15 Feb 2018 19:04:25 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emOka-00057l-8C for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2018 18:59:40 +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 81D50164F; Thu, 15 Feb 2018 10:59:13 -0800 (PST) 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 8F3E23F487; Thu, 15 Feb 2018 10:59:10 -0800 (PST) From: James Morse To: linux-acpi@vger.kernel.org Subject: [PATCH 07/11] ACPI / APEI: Split fixmap pages for arm64 NMI-like notifications Date: Thu, 15 Feb 2018 18:56:02 +0000 Message-Id: <20180215185606.26736-8-james.morse@arm.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180215185606.26736-1-james.morse@arm.com> References: <20180215185606.26736-1-james.morse@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_105920_517755_8B7B25A5 X-CRM114-Status: GOOD ( 12.60 ) 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 , Punit Agrawal , Xie XiuQi , Marc Zyngier , Catalin Marinas , Tyler Baicar , Will Deacon , Dongjiu Geng , linux-mm@kvack.org, Borislav Petkov , linux-arm-kernel@lists.infradead.org, James Morse , Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, Christoffer Dall , 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 CC: Tyler Baicar --- 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 70ccb309a9d8..280c0a58c700 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; @@ -954,6 +953,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 @@ -966,8 +966,8 @@ int ghes_notify_sea(void) static void ghes_sea_add(struct ghes *ghes) { - ghes->nmi_fixmap_lock = &ghes_fixmap_lock_nmi; - ghes->fixmap_idx = FIX_APEI_GHES_NMI; + ghes->nmi_fixmap_lock = &ghes_fixmap_lock_sea; + ghes->fixmap_idx = FIX_APEI_GHES_SEA; ghes_estatus_queue_grow_pool(ghes); mutex_lock(&ghes_list_mutex); @@ -991,12 +991,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) {