From patchwork Thu Mar 30 10:31:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie XiuQi X-Patchwork-Id: 9653709 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 C128860113 for ; Thu, 30 Mar 2017 10:37:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB3D728581 for ; Thu, 30 Mar 2017 10:37:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FB2528583; Thu, 30 Mar 2017 10:37:46 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 47C5728581 for ; Thu, 30 Mar 2017 10:37:46 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oq1gvWlNQzLEv5VMGp1HOw6cj3XdneWwXE9LD2JMmaM=; b=btjDFSPy1feWhD 6BIiyV+ff955iDlYe7H88M3VFvAr41vXDoisg2NPsv99hVMMMu8IkCVKTInOHmokPThcn+LanoR2L i8zCIDp9M1fa4ujjxsK4/p9zUx5NkMW2XGEsRVP5rgaOSJ+lYknbl/PgsarOrtihArf3kCNsohm3P 0ZwiDZFpKl5J32vdPlSHUxInLnd6kITud1fx5M68MVGobojPItKBE1Qfs5eKEAfuR78klY4yjRykX t1wsMhzeidFtJbMU5PO1KKhSIoaCDYjRgo72hE2VFpK60irs4SbeDBY4D//I9w3lcODCqD+bBh9aA bIOCSR4FW/PqJdww8RCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ctXSb-0001I8-V0; Thu, 30 Mar 2017 10:37:45 +0000 Received: from [45.249.212.189] (helo=dggrg03-dlp.huawei.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctXSS-0001CF-VO for linux-arm-kernel@lists.infradead.org; Thu, 30 Mar 2017 10:37:38 +0000 Received: from 172.30.72.55 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.55]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AKX60250; Thu, 30 Mar 2017 18:34:43 +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:33 +0800 From: Xie XiuQi To: , , , , , , , , Subject: [PATCH v3 3/8] arm64: apei: add a per-cpu variable to indecate sei is processing Date: Thu, 30 Mar 2017 18:31:12 +0800 Message-ID: <1490869877-118713-13-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.0A090202.58DCDF43.00EB, 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: d6a0965cb71f7b080e4bc9779bb2aa7e X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170330_033737_607687_701FCE88 X-CRM114-Status: GOOD ( 10.82 ) 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: , Cc: wuquanming@huawei.com, kvm@vger.kernel.org, xiexiuqi@huawei.com, linux-kernel@vger.kernel.org, gengdongjiu@huawei.com, wangxiongfeng2@huawei.com, linux-acpi@vger.kernel.org, zhengqiang10@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 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 */