From patchwork Mon Dec 3 18:06:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10710243 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 231F11057 for ; Mon, 3 Dec 2018 18:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1830B2B47E for ; Mon, 3 Dec 2018 18:07:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C0052B495; Mon, 3 Dec 2018 18:07:29 +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 8C0632B487 for ; Mon, 3 Dec 2018 18:07:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E2646B6A7F; Mon, 3 Dec 2018 13:07:21 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 999456B6A80; Mon, 3 Dec 2018 13:07:21 -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 85D9D6B6A81; Mon, 3 Dec 2018 13:07:21 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 556546B6A7F for ; Mon, 3 Dec 2018 13:07:21 -0500 (EST) Received: by mail-ot1-f72.google.com with SMTP id c26so5971829otl.19 for ; Mon, 03 Dec 2018 10:07:21 -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=og/HhddhQV4kd5weptQo3NtZBBhCvSV4v/gbtQSKrLY=; b=kTFWdZpD+z+xPyw/ln0zZz57Ax4/w0vE9VA9JuELg/qhtBYhAx59sqQXynCrm7fpT3 tk4mURjB3K6Xtk3So2YTN5JVYx13xFS+e9DgmKd72pNsc7J8hHbAxZGv2xqZQ98ASMEA eoZi2g01PTSgA6kZiz9LLdxC65rWgnzeBJINt5ClOkR4g5EUBoEsKNm6pHdwCQNtyJU+ yNkg77ztyuiglbXMXduk0PES30Yqjqu2aoeVKsfVmMOSsJL5wpVQdL4P5Gro3LLeUAyo jCIk9bHOXI61Du6YgCpbrDiiTjjrhscEM/mM2xLzlDtwpuNDzO48NR6Hr3C7zl70WwI8 x5FA== 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+aEWbJJJH0dCmuLOaIvwezbJ7Bq/hcyRj04BzAQ5RWDjy5sfIdklHr 0L1Ne3UXs4rAi0sHVkZY786rItHG1lwTWP3BrgQPyanltRbpH0mXyk4+MuYZVFljtkHzyNBkEeO S82vdZCvkKOQgFId0cUytGKNtP2/Mn3qeSAdStKgszMTSNg5S/YtM9Yn52/HsfgHgqA== X-Received: by 2002:a9d:5f4:: with SMTP id 107mr11492521otd.102.1543860441094; Mon, 03 Dec 2018 10:07:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/VKws/BFIGMoNsoEA+zOfzgm7WX5qMVRTZcX9arDzT2i2SCzPgcVJHkf+Ky6nF2i82d+1s8 X-Received: by 2002:a9d:5f4:: with SMTP id 107mr11492476otd.102.1543860440211; Mon, 03 Dec 2018 10:07:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543860440; cv=none; d=google.com; s=arc-20160816; b=GECYcpo37UO9j1Fj4TldinDj+eSE0k2cHz+mKh3qiAuVlbOJqXQSoDjC+ulBCdW/AR i/PL1l2SsaFH1ebMNJ9pSs/o6B5CVcFdAMCvgDjnCxQT8Pkr5JHigMbiEbMBySB4JYtf ENN5saDvv4/AXhDZivfKuWUrSe3ptHw9tkv7hKg2HtZT8QyqUucYOlvGL7lH7CHt32K/ d1emmiErxPtZddtJ0JjBpbHeot8JL/zv5qjaK/Nlze5cGEbKIb68cQzoT6Ubddukd6xn njPqs41h0dVWmo2EsBg1X/DB48xL2l74U5/2v3mlqGp4RGug856CTyAtK/979Ox7nhqD rTxQ== 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=og/HhddhQV4kd5weptQo3NtZBBhCvSV4v/gbtQSKrLY=; b=pNL/ZqwdtRVIRcIzLjuNs2Y9hH5UdfqImTcSSgWz/C6fVk+M+aOfLyBw/D22nW2eqv ZX7kQu1L9dBYaygr9HKQdtpZScPG9DGiTqry/C3ZI6Uh/+fzAygTpvaYO7Dzqri3LmRa lBcHQScMdbHDzMKgPzVSDJj4MYVO4B4gqxKXCcjtQ7WZpmMrxPAzksb4TgVrvv60Dk2r aBDaNcUULZ3L0E9BYhv0AX9sKnFd+W8dn9+KAkSM2wwx6Kc5Yg5GnZtG4xdIAUDfvOc2 pPMdg5mohrcyUUW7zAXxx3hX22WFZIoS2DlqaSV++jxA+0YFefPs7S4Hi2+1zY5i3AYF vzng== 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 4si6455839otq.38.2018.12.03.10.07.19 for ; Mon, 03 Dec 2018 10:07:20 -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 A28C61682; Mon, 3 Dec 2018 10:07:19 -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 CFF173F59C; Mon, 3 Dec 2018 10:07:16 -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 12/25] ACPI / APEI: Switch NOTIFY_SEA to use the estatus queue Date: Mon, 3 Dec 2018 18:06:00 +0000 Message-Id: <20181203180613.228133-13-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 the estatus queue can be used by more than one notification method, we can move notifications that have NMI-like behaviour over. Switch NOTIFY_SEA over to use the estatus queue. This makes it behave in the same way as x86's NOTIFY_NMI. Remove Kconfig's ability to turn ACPI_APEI_SEA off if ACPI_APEI_GHES is selected. This roughly matches the x86 NOTIFY_NMI behaviour, and means each architecture has at least one user of the estatus-queue, meaning it doesn't need guarding with ifdef. Signed-off-by: James Morse --- Changes since v6: * Lost all the pool grow/shrink stuff, * Changed Kconfig so this can't be turned off to avoid kconfig complexity: * Dropped Tyler's tested-by. * For now we need #ifdef around the SEA code as the arch code assumes its there. * Removed Punit's reviewed-by due to the swirling #ifdeffery --- drivers/acpi/apei/Kconfig | 12 +----------- drivers/acpi/apei/ghes.c | 22 +++++----------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 52ae5438edeb..6b18f8bc7be3 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -41,19 +41,9 @@ config ACPI_APEI_PCIEAER Turn on this option to enable the corresponding support. config ACPI_APEI_SEA - bool "APEI Synchronous External Abort logging/recovering support" + bool depends on ARM64 && ACPI_APEI_GHES default y - help - This option should be enabled if the system supports - firmware first handling of SEA (Synchronous External Abort). - SEA happens with certain faults of data abort or instruction - abort synchronous exceptions on ARMv8 systems. If a system - supports firmware first handling of SEA, the platform analyzes - and handles hardware error notifications from SEA, and it may then - form a HW error record for the OS to parse and handle. This - option allows the OS to look for such hardware error record, and - take appropriate action. config ACPI_APEI_MEMORY_FAILURE bool "APEI memory error recovering support" diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 00fe4785e469..4b33fa562e32 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -765,7 +765,6 @@ static struct notifier_block ghes_notifier_hed = { .notifier_call = ghes_notify_hed, }; -#ifdef CONFIG_HAVE_ACPI_APEI_NMI /* * Handlers for CPER records may not be NMI safe. For example, * memory_failure_queue() takes spinlocks and calls schedule_work_on(). @@ -905,7 +904,6 @@ static int ghes_estatus_queue_notified(struct list_head *rcu_list) return ret; } -#endif /* CONFIG_HAVE_ACPI_APEI_NMI */ #ifdef CONFIG_ACPI_APEI_SEA static LIST_HEAD(ghes_sea); @@ -916,16 +914,7 @@ static LIST_HEAD(ghes_sea); */ int ghes_notify_sea(void) { - struct ghes *ghes; - int ret = -ENOENT; - - rcu_read_lock(); - list_for_each_entry_rcu(ghes, &ghes_sea, list) { - if (!ghes_proc(ghes)) - ret = 0; - } - rcu_read_unlock(); - return ret; + return ghes_estatus_queue_notified(&ghes_sea); } static void ghes_sea_add(struct ghes *ghes) @@ -992,16 +981,15 @@ static void ghes_nmi_remove(struct ghes *ghes) */ synchronize_rcu(); } +#else /* CONFIG_HAVE_ACPI_APEI_NMI */ +static inline void ghes_nmi_add(struct ghes *ghes) { } +static inline void ghes_nmi_remove(struct ghes *ghes) { } +#endif /* CONFIG_HAVE_ACPI_APEI_NMI */ static void ghes_nmi_init_cxt(void) { init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); } -#else /* CONFIG_HAVE_ACPI_APEI_NMI */ -static inline void ghes_nmi_add(struct ghes *ghes) { } -static inline void ghes_nmi_remove(struct ghes *ghes) { } -static inline void ghes_nmi_init_cxt(void) { } -#endif /* CONFIG_HAVE_ACPI_APEI_NMI */ static int ghes_probe(struct platform_device *ghes_dev) {