From patchwork Thu Sep 28 12:41:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 9975889 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 9F3306037E for ; Thu, 28 Sep 2017 12:19:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 913C91FF13 for ; Thu, 28 Sep 2017 12:19:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 859622958E; Thu, 28 Sep 2017 12:19:35 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 056E41FF13 for ; Thu, 28 Sep 2017 12:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752994AbdI1MTc (ORCPT ); Thu, 28 Sep 2017 08:19:32 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7064 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbdI1MTa (ORCPT ); Thu, 28 Sep 2017 08:19:30 -0400 Received: from 172.30.72.59 (EHLO DGGEMS402-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DIE85786; Thu, 28 Sep 2017 20:19:05 +0800 (CST) Received: from linux.huawei.com (10.67.187.203) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.301.0; Thu, 28 Sep 2017 20:18:54 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , , , , , CC: , Subject: [PATCH v3 1/2] acpi: apei: remove the unused dead-code for SEA notification type Date: Thu, 28 Sep 2017 20:41:37 +0800 Message-ID: <1506602498-25752-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.7.7 MIME-Version: 1.0 X-Originating-IP: [10.67.187.203] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59CCE8BA.0199, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 136ad9e033488077f69706c94e078303 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In current code logic, the two functions ghes_sea_add() and ghes_sea_remove() are only called when CONFIG_ACPI_APEI_SEA is defined. If not, it will return errors in the ghes_probe() and not continue. If the probe is failed, the ghes_sea_remove() also has no chance to be called. Hence, remove the unnecessary handling when CONFIG_ACPI_APEI_SEA is not defined. In the firmware-first RAS solution, the IPA fault address recorded by hpfar_el2 may be UNKNOWN, and also current code does not use it, so remove it. Cc: Stephen Boyd Cc: James Morse Cc: Tyler Baicar Signed-off-by: Dongjiu Geng --- v2->v3: 1. remove the fault_ipa address If ESR_ELx.DFSC is Synchronous External Abort on memory access(0b010000), the hpfar_el2's value will be UNKNOWN, so this value is not accurate. It is ever discussed here: https://lkml.org/lkml/2017/9/8/623 --- arch/arm/include/asm/system_misc.h | 2 +- arch/arm64/include/asm/system_misc.h | 2 +- arch/arm64/mm/fault.c | 2 +- drivers/acpi/apei/ghes.c | 14 -------------- virt/kvm/arm/mmu.c | 2 +- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/arch/arm/include/asm/system_misc.h b/arch/arm/include/asm/system_misc.h index 8c4a89f..5b53a1c 100644 --- a/arch/arm/include/asm/system_misc.h +++ b/arch/arm/include/asm/system_misc.h @@ -22,7 +22,7 @@ extern void (*arm_pm_idle)(void); extern unsigned int user_debug; -static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr) +static inline int handle_guest_sea(unsigned int esr) { return -1; } diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h index 07aa8e3..3f0d0a8 100644 --- a/arch/arm64/include/asm/system_misc.h +++ b/arch/arm64/include/asm/system_misc.h @@ -56,7 +56,7 @@ extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); __show_ratelimited; \ }) -int handle_guest_sea(phys_addr_t addr, unsigned int esr); +int handle_guest_sea(unsigned int esr); #endif /* __ASSEMBLY__ */ diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 2509e4f..13391f4 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -677,7 +677,7 @@ static const struct fault_info fault_info[] = { * and non-zero if there was an error processing the error or there was * no error to process. */ -int handle_guest_sea(phys_addr_t addr, unsigned int esr) +int handle_guest_sea(unsigned int esr) { int ret = -ENOENT; diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d661d45..c15a08d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -813,7 +813,6 @@ static struct notifier_block ghes_notifier_hed = { .notifier_call = ghes_notify_hed, }; -#ifdef CONFIG_ACPI_APEI_SEA static LIST_HEAD(ghes_sea); /* @@ -848,19 +847,6 @@ static void ghes_sea_remove(struct ghes *ghes) mutex_unlock(&ghes_list_mutex); synchronize_rcu(); } -#else /* CONFIG_ACPI_APEI_SEA */ -static inline void ghes_sea_add(struct ghes *ghes) -{ - pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n", - ghes->generic->header.source_id); -} - -static inline void ghes_sea_remove(struct ghes *ghes) -{ - pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n", - ghes->generic->header.source_id); -} -#endif /* CONFIG_ACPI_APEI_SEA */ #ifdef CONFIG_HAVE_ACPI_APEI_NMI /* diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 2ea21da..07636c2 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1504,7 +1504,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run) * is no need to pass the error into the guest. */ if (is_abort_sea(fault_status)) { - if (!handle_guest_sea(fault_ipa, kvm_vcpu_get_hsr(vcpu))) + if (!handle_guest_sea(kvm_vcpu_get_hsr(vcpu))) return 1; }