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: 10710281 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 EB98C15A6 for ; Mon, 3 Dec 2018 18:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1BEF2B495 for ; Mon, 3 Dec 2018 18:08:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D66712B49D; Mon, 3 Dec 2018 18:08:06 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52C732B47E for ; Mon, 3 Dec 2018 18:08:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8F4F6B6A8C; Mon, 3 Dec 2018 13:07:49 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CEE926B6A8D; Mon, 3 Dec 2018 13:07:49 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDD1D6B6A8E; Mon, 3 Dec 2018 13:07:49 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by kanga.kvack.org (Postfix) with ESMTP id 8E6C36B6A8C for ; Mon, 3 Dec 2018 13:07:49 -0500 (EST) Received: by mail-ot1-f69.google.com with SMTP id q23so5964608otn.3 for ; Mon, 03 Dec 2018 10:07:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JjFMpXuQdPX46XYZAzvi+XQG8d/WswNsuRYargo7X0o=; b=NfwFhAOLHU3Pg7bQasICU9Y43WcafyZ8UsbYH7IQK2tmJSElfjx7goNKuQVo0JaD7u JxkppuMSQG+lccxizV4+0SO1ELvpwxZQWk+jXUumEVxYNqlrAbs4iL9OiWShfrL3s3+w E9LSRrtBP/LHvFiGTg+E3kRcPeqJj4PN41WxtPvIrW7xZmxqeMkE6hRBVRf0oo27tmUP k2qRB6X6i2eUy4Ef1b2Wlq0Cj37A2QPpTFpsS6rsgz4dYhdAOfUZgjHFvVAzdk7d6CbA 18HvnS2gMWri2NUZcP5CRt6wsUHBJOwDFbiB+Q1NkTUp7czu1Wo+b8/jlYXRizuUVBpK SOpg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com X-Gm-Message-State: AA+aEWZGd2v3dGtzL9QLnV9aV8VvVvc/WrhyiROdHHq2CaNn5Px4+0zF 2GhMqOi92VW+Wl2BcRM2UDzTH4ys2LaT/MuJG838YOGSVVZxYFtc2VNYVTh/J0FoybrT0uDOoF6 4keHrUw34XdBtJmIsgiSzxqG+A05NM//a6uUxzYXdnAB9Hj/PIIU9KTkqlpGr1e2QHg== X-Received: by 2002:aca:2807:: with SMTP id 7mr10770282oix.7.1543860469343; Mon, 03 Dec 2018 10:07:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/UWDTQjn7ffEQ66dWd0BAFIeXBivKDCPLs6DEjM7u7seU/fXdcdg6MdPCg7O6WqJnPjlOja X-Received: by 2002:aca:2807:: with SMTP id 7mr10770253oix.7.1543860468687; Mon, 03 Dec 2018 10:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543860468; cv=none; d=google.com; s=arc-20160816; b=qhEaAgvenYDHJFadt1Mo0ORtnPLHFBSqrC2dmK2lYSHnJ+RPxjejugT0a3S418yS2w 1OEieoTegZsQkmu+gOLHiSWSwTGkgt513qfXBwxvUVrOkL827srWQeikyPxqG77pyzYu IDLSOMRtshz2AE+yXveufQcgwTsthOCgpIKuOaQXVevLXnlxehr65xqDTxZX9QFlCOvE iXw1k84eQCj90WIPB8EvvcCGxOsyYPRRJbzeGQAD2I5uohOyc5B81TvKM94b/vNmjClU GO27AxcG2a2ZrxWj7S8mTmBKx9YrultlFKQh4XR4+25I+qBc90GyElbHuGB+V8HPlICW /O2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=JjFMpXuQdPX46XYZAzvi+XQG8d/WswNsuRYargo7X0o=; b=sdllIGKtGjKfYrTN3vTxZjewE3w2PBzug55TzrnKENwgDZPh4KIytAQLJbX0yOfeg8 3tLi49dxMGi5ksulJ837BDeAvFaondXNqukGGzjNdXHmoGqZcIWmlhS2t3gq75rtjeUb jxs3EeWoeh9ZC3diIe6S9anjxpegzF9enXlWmhHeGTWI2KP7lAoWQ2KHoNojdqSrLcX9 ZDSrhNohznJk5fzMByjTMGuYZAoUPdKL6xIIF7wyrNKWVYSaxs7NPQASb0y4dZysh0s1 Qgz4TKyTYp4+xa0y5Z1sFPlrgJa/9VkwKbSRjxMZw3Jvkfb12FzB/bm3xlz4ZL0oIuc3 2wrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id t3si6495635otq.54.2018.12.03.10.07.48 for ; Mon, 03 Dec 2018 10:07:48 -0800 (PST) Received-SPF: pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com 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 Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Borislav Petkov , Marc Zyngier , Christoffer Dall , Will Deacon , Catalin Marinas , Naoya Horiguchi , Rafael Wysocki , Len Brown , Tony Luck , Dongjiu Geng , Xie XiuQi , Fan Wu , James Morse 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;