From patchwork Thu Jul 26 21:01:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10545913 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 0E9B314BC for ; Thu, 26 Jul 2018 13:40:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F41062B2DF for ; Thu, 26 Jul 2018 13:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E861E2B329; Thu, 26 Jul 2018 13:40:51 +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=-1.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham 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 7F4E52B2DF for ; Thu, 26 Jul 2018 13:40:51 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cwhhBEk5mIxmucnlnX1XTypxEZhqbTXtmlotnAfyMFg=; b=tOEqd9YfPnJTPJ lmxVFGRNa/ikBqHa6SeXzo0RdOX5MJjft4gCUkYDy2phNRlFrRYlRBPZCu0pA7uex2dUh3UJgMSHx q/K9fSiG3P1Lr6nP2iCh1ntQUaz818et7PfL8Ant4Kv6Cna3kH0vXRoyEwGpxYM0QM8wPf9mTnKkP GhHDUJd47YQQBzZiwEiSCh/uiJvGJ3DTGQ8AaQUCJtrYHBo32Cmi4MkEo2lQh2GjXaRe97JZEpzHV ey/koHZY+8HxScmLr0Bsand1yyIVHngfv1K3YPqB1MLTLzEqxo1Z+G4AeGUJ6xFUkOiiuhvkrQOZN cU89AuqRCbIwlUq9L2Dw==; 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 1figVc-00040m-0K; Thu, 26 Jul 2018 13:40:48 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1figVM-0003lT-Qx for linux-arm-kernel@bombadil.infradead.org; Thu, 26 Jul 2018 13:40:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=z99dZwkPhYSHRZO7cqgHpQsasvUqlmXmBtmrMZeDfrw=; b=vbFGtXgTASGQT3VZ4wl2MMjTr3 mVBXjL7atnOK8pb8686+LQJwCZfPJbs0Rj8sSRIIcYoTO/IhecwgeGN8ZtN4EGBl0nR/qpMhM8r7Y xnfFPUZCu1kyGHCFRPEPVxZb1vcKYdjtnjY6orP23WSxvtaDD6xK1MG+/SiiKH/LDUEGQT12kTnYf o1h93hIY/CjrBdqAC6B3s9pomhbRrG8TbIL8eJVVZL3qA+kkzSIkiXM5ABsnMpJME6vfaCFLW8c/T XdIy8oD8bIr2Vz26AGfiPuxAwhgmI9/k0MvuYBTTv16N8sfc+4Ts2EJCXiq6+7s4x0Ws179fDpr0j FQv2uwxA==; Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fifpH-00039C-Ch for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2018 12:57:04 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6328DBFF2DA0D; Thu, 26 Jul 2018 20:56:41 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Thu, 26 Jul 2018 20:56:32 +0800 From: Dongjiu Geng To: , , , , , , , , , , , Subject: [PATCH] arm64: clean the additional checks before calling ghes_notify_sea() Date: Thu, 26 Jul 2018 17:01:47 -0400 Message-ID: <1532638907-46129-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180726_085703_702013_D5F18B74 X-CRM114-Status: GOOD ( 10.60 ) 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: , 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 In order to remove the additional check before calling the ghes_notify_sea(), make stub definition when !CONFIG_ACPI_APEI_SEA. Signed-off-by: Dongjiu Geng Acked-by: Will Deacon --- This cleanup is ever mentioned by Mark Rutland in [1] [1]: https://lkml.org/lkml/2018/5/31/289 --- arch/arm64/mm/fault.c | 7 +------ include/acpi/ghes.h | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index b8eecc7..9ffe01d 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -727,12 +727,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) int handle_guest_sea(phys_addr_t addr, unsigned int esr) { - int ret = -ENOENT; - - if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) - ret = ghes_notify_sea(); - - return ret; + return ghes_notify_sea(); } asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr, diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 1624e2b..82cb4eb 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -118,6 +118,10 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata) (void *)section - (void *)(estatus + 1) < estatus->data_length; \ section = acpi_hest_get_next(section)) +#ifdef CONFIG_ACPI_APEI_SEA int ghes_notify_sea(void); +#else +static inline int ghes_notify_sea(void) { return -ENOENT; } +#endif #endif /* GHES_H */