From patchwork Thu May 31 12:41:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10440255 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 B8E4B6035E for ; Thu, 31 May 2018 04:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8B67292AB for ; Thu, 31 May 2018 04:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D1E92940C; Thu, 31 May 2018 04:36:54 +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.0 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, MAILING_LIST_MULTI,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 3A97B292AB for ; Thu, 31 May 2018 04:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753881AbeEaEgb (ORCPT ); Thu, 31 May 2018 00:36:31 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43427 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751989AbeEaEga (ORCPT ); Thu, 31 May 2018 00:36:30 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 365031364B369; Thu, 31 May 2018 12:36:26 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.382.0; Thu, 31 May 2018 12:36:19 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , , Subject: [PATCH v1 2/2] arm64: handle NOTIFY_SEI notification by the APEI driver Date: Thu, 31 May 2018 20:41:46 +0800 Message-ID: <1527770506-8076-3-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527770506-8076-1-git-send-email-gengdongjiu@huawei.com> References: <1527770506-8076-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected 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 When kernel or KVM gets the NOTIFY_SEI notification, it firstly calls the APEI driver to handle this notification. Signed-off-by: Dongjiu Geng --- arch/arm64/kernel/traps.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- change since https://www.spinics.net/lists/kvm/msg168919.html 1. Remove the handle_guest_sei() helper diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 8bbdc17..676e40c 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -50,6 +50,7 @@ #include #include #include +#include static const char *handler[]= { "Synchronous Abort", @@ -701,6 +702,20 @@ void __noreturn arm64_serror_panic(struct pt_regs *regs, u32 esr) bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr) { u32 aet = arm64_ras_serror_get_severity(esr); + int ret = -ENOENT; + + if (IS_ENABLED(CONFIG_ACPI_APEI_SEI)) { + if (interrupts_enabled(regs)) + nmi_enter(); + + ret = ghes_notify_sei(); + + if (interrupts_enabled(regs)) + nmi_exit(); + + if (!ret) + return false; + } switch (aet) { case ESR_ELx_AET_CE: /* corrected error */