From patchwork Thu Mar 30 10:31:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie XiuQi X-Patchwork-Id: 9653801 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 34A416034C for ; Thu, 30 Mar 2017 10:44:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21A2622B1F for ; Thu, 30 Mar 2017 10:44:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1626A28579; Thu, 30 Mar 2017 10:44:16 +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=unavailable 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 CAB4C22B1F for ; Thu, 30 Mar 2017 10:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933253AbdC3Kep (ORCPT ); Thu, 30 Mar 2017 06:34:45 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4848 "EHLO dggrg02-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754034AbdC3Kel (ORCPT ); Thu, 30 Mar 2017 06:34:41 -0400 Received: from 172.30.72.53 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.53]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AKU60982; Thu, 30 Mar 2017 18:34:34 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server id 14.3.301.0; Thu, 30 Mar 2017 18:34:24 +0800 From: Xie XiuQi To: , , , , , , , , CC: , , , , , , , , , Subject: [PATCH v3 3/8] arm64: apei: add a per-cpu variable to indecate sei is processing Date: Thu, 30 Mar 2017 18:31:03 +0800 Message-ID: <1490869877-118713-4-git-send-email-xiexiuqi@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490869877-118713-1-git-send-email-xiexiuqi@huawei.com> References: <1490869877-118713-1-git-send-email-xiexiuqi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.58DCDF3C.005B, 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: e803fc4edd06bfed8ad982a04eff0114 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a per-cpu variable to indicate sei is processing, with which we could use to reserve a separate virtual space address page for sei in next patch Signed-off-by: Xie XiuQi --- arch/arm64/kernel/traps.c | 4 ++++ include/acpi/ghes.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 53710a2..955dc8c 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -615,6 +615,8 @@ const char *esr_get_class_string(u32 esr) return esr_class_str[ESR_ELx_EC(esr)]; } +DEFINE_PER_CPU(int, sei_in_process); + /* * bad_mode handles the impossible case in the exception vector. This is always * fatal. @@ -632,7 +634,9 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) * of cper records at a time. There is no risk for one cpu to parse ghes table. */ if (IS_ENABLED(CONFIG_ACPI_APEI_SEI) && ESR_ELx_EC(esr) == ESR_ELx_EC_SERROR) { + this_cpu_inc(sei_in_process); ghes_notify_sei(); + this_cpu_dec(sei_in_process); } die("Oops - bad mode", regs, 0); diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 10d752e..eed79ea 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -102,4 +102,6 @@ static inline void *acpi_hest_generic_data_payload(struct acpi_hest_generic_data int ghes_notify_sea(void); int ghes_notify_sei(void); +DECLARE_PER_CPU(int, sei_in_process); + #endif /* GHES_H */