From patchwork Mon Dec 3 18:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10710313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B2481057 for ; Mon, 3 Dec 2018 18:22:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BDD72B495 for ; Mon, 3 Dec 2018 18:22:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F1842B4A6; Mon, 3 Dec 2018 18:22:50 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 AB2022B495 for ; Mon, 3 Dec 2018 18:22:49 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=tjrcDrt5E5a3uwAWvZFGpZP+qxpoCaUNSSMDQm6arZA=; b=K+V/P/yljxwHMS pNI7M9MuBeGabTDBRP0O47gLWo6Wa78Hb6V/nNoyDjS8V8xZokqe0U7qUlhRajTsh/X8shO+da2Vl 5Y0AdC7RVP11ApU3BvGo8TO5XK2wakF9aFVlEh69DKLYnY4n2s7Ph1YvOoVQ3T9lm5l5ydxorDIX3 cyx0zztOCd1LPiZ9kUFTZIwW3206T7kDbUtr4BSTc7QQ2162tjZKrtcGACHDL0USKR40e6FEXHz8o q15An9iOq8VK21yh+jqnkVlaMo3WBlc7+91FXfJvBBJBQUZTH1HCz9Me/ZaGL5fGBpZeuusF/+EGL XMDoRF5qMPQcS6zIKKqA==; 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 1gTsrm-0005kp-Fk; Mon, 03 Dec 2018 18:22:46 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTsrd-0005ML-4h for linux-arm-kernel@bombadil.infradead.org; Mon, 03 Dec 2018 18:22:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JjFMpXuQdPX46XYZAzvi+XQG8d/WswNsuRYargo7X0o=; b=rPZcUrZHDc9QwwS5NC55wM/0r/ dVlfqpEg2Zs5xFah/TYCVjocnvVBWByfEex0zxGAJquvxMzrTQNOX0prUz+xXBtZJd14xyVMCN15P jmnLam0j0TofyTaYfm1r+0mxWSFbHRU603intJzeGbxX1hFK/pCOXn/oJzNFbA6whAglabA8Q7o5C QxGOacfryQL0sJELwdHyagBCd1Ftdvi+kUeCnFo4W9aCj8s52SabDVHzqX7kpogKBElg3GS3Ga1wg bOhoc9BVrfFJx5hnP2k3i6vGUIXxgJLSBNKcc+/Fz1yjxl+w4mTHgQP2h0CTCD+gEzIoLp7t+99Ke A9hGe8Fg==; Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTsdK-0001IZ-HH for linux-arm-kernel@lists.infradead.org; Mon, 03 Dec 2018 18:07:52 +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 496F0169E; Mon, 3 Dec 2018 10:07:48 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 792003F59C; Mon, 3 Dec 2018 10:07:45 -0800 (PST) From: James Morse To: linux-acpi@vger.kernel.org Subject: [PATCH v7 20/25] ACPI / APEI: Use separate fixmap pages for arm64 NMI-like notifications Date: Mon, 3 Dec 2018 18:06:08 +0000 Message-Id: <20181203180613.228133-21-james.morse@arm.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181203180613.228133-1-james.morse@arm.com> References: <20181203180613.228133-1-james.morse@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181203_180750_715003_5A4803D3 X-CRM114-Status: GOOD ( 12.56 ) 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 , Fan Wu , Xie XiuQi , Marc Zyngier , Catalin Marinas , Will Deacon , Christoffer Dall , 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 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 notification helpers provide the fixmap slots and take the lock themselves, multiple NMI-like notifications can be used on arm64. These should be named after their notification method as they can't all be called 'NMI'. 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}. Because all of ghes.c builds on both architectures, provide a constant for each fixmap entry that the architecture will never use. Signed-off-by: James Morse --- Changes since v6: * Added #ifdef definitions of each missing fixmap entry. Changes since v3: * idx/lock are now in a separate struct. * Add to the comment above ghes_fixmap_lock_irq so that it makes more sense in isolation. fixup for split fixmap --- arch/arm64/include/asm/fixmap.h | 2 +- drivers/acpi/apei/ghes.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h index ec1e6d6fa14c..966dd4bb23f2 100644 --- a/arch/arm64/include/asm/fixmap.h +++ b/arch/arm64/include/asm/fixmap.h @@ -55,7 +55,7 @@ enum fixed_addresses { #ifdef CONFIG_ACPI_APEI_GHES /* Used for GHES mapping from assorted contexts */ FIX_APEI_GHES_IRQ, - FIX_APEI_GHES_NMI, + FIX_APEI_GHES_SEA, #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 849da0d43a21..6cbf9471b2a2 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -85,6 +85,14 @@ ((struct acpi_hest_generic_status *) \ ((struct ghes_estatus_node *)(estatus_node) + 1)) +/* NMI-like notifications vary by architecture. Fill in the fixmap gaps */ +#ifndef CONFIG_HAVE_ACPI_APEI_NMI +#define FIX_APEI_GHES_NMI -1 +#endif +#ifndef CONFIG_ACPI_APEI_SEA +#define FIX_APEI_GHES_SEA -1 +#endif + static inline bool is_hest_type_generic_v2(struct ghes *ghes) { return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2; @@ -954,7 +962,7 @@ int ghes_notify_sea(void) int rv; raw_spin_lock(&ghes_notify_lock_sea); - rv = ghes_estatus_queue_notified(&ghes_sea, FIX_APEI_GHES_NMI); + rv = ghes_estatus_queue_notified(&ghes_sea, FIX_APEI_GHES_SEA); raw_spin_unlock(&ghes_notify_lock_sea); return rv;