From patchwork Tue Jun 26 17:01:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10489595 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 8944D60532 for ; Tue, 26 Jun 2018 17:04:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 751EB28647 for ; Tue, 26 Jun 2018 17:04:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 648032863F; Tue, 26 Jun 2018 17:04:00 +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=ham 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 BFE49287B7 for ; Tue, 26 Jun 2018 17:02:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FEFD6B0270; Tue, 26 Jun 2018 13:02:13 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4AD466B0271; Tue, 26 Jun 2018 13:02:13 -0400 (EDT) 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 375BE6B0273; Tue, 26 Jun 2018 13:02:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot0-f198.google.com (mail-ot0-f198.google.com [74.125.82.198]) by kanga.kvack.org (Postfix) with ESMTP id 0A6C66B0270 for ; Tue, 26 Jun 2018 13:02:13 -0400 (EDT) Received: by mail-ot0-f198.google.com with SMTP id w25-v6so11822537otj.18 for ; Tue, 26 Jun 2018 10:02:13 -0700 (PDT) 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; bh=uH+y7UR5GRDzlN9QWuD55tt2KdtGYnlZ1Xn88vR+PeI=; b=n4Zc66Vq+mDXNIomRbTpejjSybu6ebPeup21lDoecZO2PHOcVhF45pluoO24Y2aHES 7P+lDqVMESfcz2ScvTpq5DpEPSH0GaM6aRSbYXRVIUqSyfFLSKazFV14VDJBP/vMDa9F P74aNlxj5kA3VbNf4QtRPSqeZhaQLTI3OMxeMNSsxD0CMjvId//aefvwzIOBbfufuIky mlSXw/fj7FfoxQbyN4LAkZmASBq7ZGuJHZGa0TqKt3L3Dt5ddY1TL4z/PO78weJNv/0J ABCpchvemLgNxNRZIvIK9EWZ5mGXUbsYjUy6pgI4c/kAus5Ay5NroyG6629sc0Mgytnr Dn8A== 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: APt69E0tscSdj5byFclOCDYwQyPNInZ8VORhuYyji2/ztVXXKaAyKots 79IaunF2cA1nInE1E8klESeyuW3fdLU5NEe1DQ6zNEvMw2vBpwivvfX6CddELWjSSUpNQBORXn4 4w6JX5OQGKkSSCXPutUTeyIuNm4BCVp/5F75hkyct7ygVWog6Mfb872e254E/allfNg== X-Received: by 2002:aca:6144:: with SMTP id v65-v6mr1419980oib.147.1530032532807; Tue, 26 Jun 2018 10:02:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVjFc7LkarXlEjMbSWQq0VwwEoY4rjhu1/ukIaszNP6oyogsIydvdLHZAfcSGtZ/XX4QkW X-Received: by 2002:aca:6144:: with SMTP id v65-v6mr1419926oib.147.1530032531676; Tue, 26 Jun 2018 10:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530032531; cv=none; d=google.com; s=arc-20160816; b=mxmmHupHIYao9IQxaWac0wr/UZS+Tlu8ZV1pQNwDJO0D/iquPSP9PPQ1yQAh/tpoWR +W7WWWUmu31IB5xevTXhxmwyEbSJeTJP0CrdPl2ry+C53OdRRy9ZHJA09Pu9FuFgmP3c 7O64udJdspKSZilPBBEyGEkM+/AMMiHB7SGAoWXtQs8XJ0V0SE25RmStEWwEKRvJxXqi 3QhRMUK2UkHp7YxY3MX5r/LPrFUNlIFrVWYjzgVzQeKbRdx3Mn9BS9tqGTvxTDiZ/sq+ OaDfNClE67PgWQhcafJ0hCVR7AuehdCQ05IcjasAjluilXuC3vS0KBKY02d0T8nyNeku lqMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uH+y7UR5GRDzlN9QWuD55tt2KdtGYnlZ1Xn88vR+PeI=; b=cMA21r1cG2S/ZAo/QxIyMKudz9paXQe2sRapg3GvayZEHTMiya45x0UfiyOLaU9Avu 52YamhuEyu1nsc8PChzuAnQm4X3dk0/DeMjBF5HbPOvkiAVyp0grcP6PFMY1W/6/y5vQ wV20sew263i/5Z68Z0EVS0cMXn64dBKsdz9b+wAuNxgNjq5atcCvQ7kwQIlw/De6V7qq KtJaUe7hjEz2JsMDex3JIGH2InV/JRtNoVLiWSkCT4LYUm3YauUzhHn2jrs0HMThm0eM MtDE/tsPYlrnBvkxGdDHQi6Iy0W2aVnxH6rvclMcVFdmNryd09j+sBIZVAL65X+4p1wy wTkw== 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 (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id m63-v6si460578oig.38.2018.06.26.10.02.11 for ; Tue, 26 Jun 2018 10:02:11 -0700 (PDT) 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 327257A9; Tue, 26 Jun 2018 10:02:11 -0700 (PDT) Received: from melchizedek.cambridge.arm.com (melchizedek.cambridge.arm.com [10.1.206.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1E01A3F318; Tue, 26 Jun 2018 10:02:07 -0700 (PDT) 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 , Tyler Baicar , Dongjiu Geng , Xie XiuQi , Punit Agrawal , jonathan.zhang@cavium.com, James Morse Subject: [PATCH v5 05/20] ACPI / APEI: Make estatus queue a Kconfig symbol Date: Tue, 26 Jun 2018 18:01:01 +0100 Message-Id: <20180626170116.25825-6-james.morse@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626170116.25825-1-james.morse@arm.com> References: <20180626170116.25825-1-james.morse@arm.com> 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 there are two users of the estatus queue, and likely to be more, make it a Kconfig symbol selected by the appropriate notification. We can move the ARCH_HAVE_NMI_SAFE_CMPXCHG checks in here too. Signed-off-by: James Morse --- drivers/acpi/apei/Kconfig | 6 ++++++ drivers/acpi/apei/ghes.c | 12 +++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 52ae5438edeb..2b191e09b647 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -4,6 +4,7 @@ config HAVE_ACPI_APEI config HAVE_ACPI_APEI_NMI bool + select ACPI_APEI_GHES_ESTATUS_QUEUE config ACPI_APEI bool "ACPI Platform Error Interface (APEI)" @@ -33,6 +34,10 @@ config ACPI_APEI_GHES by firmware to produce more valuable hardware error information for Linux. +config ACPI_APEI_GHES_ESTATUS_QUEUE + bool + depends on ACPI_APEI_GHES && ARCH_HAVE_NMI_SAFE_CMPXCHG + config ACPI_APEI_PCIEAER bool "APEI PCIe AER logging/recovering support" depends on ACPI_APEI && PCIEAER @@ -43,6 +48,7 @@ config ACPI_APEI_PCIEAER config ACPI_APEI_SEA bool "APEI Synchronous External Abort logging/recovering support" depends on ARM64 && ACPI_APEI_GHES + select ACPI_APEI_GHES_ESTATUS_QUEUE default y help This option should be enabled if the system supports diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 150fb184c7cb..2880547e13b8 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -58,10 +58,6 @@ #define GHES_PFX "GHES: " -#if defined(CONFIG_HAVE_ACPI_APEI_NMI) || defined(CONFIG_ACPI_APEI_SEA) -#define WANT_NMI_ESTATUS_QUEUE 1 -#endif - #define GHES_ESTATUS_MAX_SIZE 65536 #define GHES_ESOURCE_PREALLOC_MAX_SIZE 65536 @@ -685,7 +681,7 @@ static void ghes_estatus_cache_add( rcu_read_unlock(); } -#ifdef WANT_NMI_ESTATUS_QUEUE +#ifdef CONFIG_ACPI_APEI_GHES_ESTATUS_QUEUE /* * Handlers for CPER records may not be NMI safe. For example, * memory_failure_queue() takes spinlocks and calls schedule_work_on(). @@ -727,7 +723,6 @@ static void ghes_print_queued_estatus(void) /* Save estatus for further processing in IRQ context */ static void __process_error(struct ghes *ghes) { -#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG u32 len, node_len; struct ghes_estatus_node *estatus_node; struct acpi_hest_generic_status *estatus; @@ -747,7 +742,6 @@ static void __process_error(struct ghes *ghes) estatus = GHES_ESTATUS_FROM_NODE(estatus_node); memcpy(estatus, ghes->estatus, len); llist_add(&estatus_node->llnode, &ghes_estatus_llist); -#endif } static int _in_nmi_notify_one(struct ghes *ghes) @@ -786,7 +780,7 @@ static int ghes_estatus_queue_notified(struct list_head *rcu_list) } rcu_read_unlock(); - if (IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) && !ret) + if (!ret) irq_work_queue(&ghes_proc_irq_work); return ret; @@ -865,7 +859,7 @@ static void ghes_nmi_init_cxt(void) #else static inline void ghes_nmi_init_cxt(void) { } -#endif /* WANT_NMI_ESTATUS_QUEUE */ +#endif /* CONFIG_ACPI_APEI_GHES_ESTATUS_QUEUE */ static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2) {