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: 9653889 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 A6A7560349 for ; Thu, 30 Mar 2017 11:06:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B8162857B for ; Thu, 30 Mar 2017 11:06:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9013428583; Thu, 30 Mar 2017 11:06:13 +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 2B20D2857B for ; Thu, 30 Mar 2017 11:06:13 +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=Nwxd0Ta/Uc5qQ8 V5YYTSOiFoO5fIRa/5B+weuFuQt00Nb0AL55kk/3UFQjdbdz+UbjbUimKjIhGle9KMmDF61AGFjwY 78DxP9O/F6x2ISWvKQoAy2G/CKqrWqvcZ/+vvaZqgqckWIL4oEpTw3o+OTa+61ROHQm6pFSbVZFjQ iRvt1d/h2qhs8AwBnLlPK9nr/DZXzZZwJFSncCXWbFpAzpf201ABcSmYVeoc8NIzHEBBSD6ZxQIDi a8uFcY6oWBhv6WjAzZhwxTS2L8iXOMXlqevoZ2IH5r7pOUKAFQCRjAMRYvfxqpNZuHDMosYV5n6VA 7STtiM914zbvbbdYgEpA==; 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 1ctXu6-0000Tl-Eo; Thu, 30 Mar 2017 11:06:10 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctXgD-0001Lb-1F for linux-arm-kernel@bombadil.infradead.org; Thu, 30 Mar 2017 10:51:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FaYPELPb6bAT7gFT0QUAAUu6EnDLAvb4b8YILhUqWHI=; b=XwrBgpmJV5vEhkWj+kiLBwQPu JJsg5YAOa6AODq/7s+6Aq1xxr7r4dyTi39RAjpEJicayJ3JZiJtkq36alVADTijSWOX7m5/ocRyuq KXJKuykB/7dZh4bqjRmAdMozYDODgoc5A/cOx6cbgJ04G+vvc+stwHEPjMvxs/GhpQQNlLvgn1/G/ 6vpK2eR3uglh3Tu+VF9PTr4po+yVls0d0VVpbMU/4NLGew2xQLX8TzrQSQHfuPf4o93JFLBG4LBbT HhoPSwjvzjMz4U1Ry4kqHlUdvW/HPspokM62/0BWmLK3eve2SPXpVgQlKpjQ8p1RwCzUdCNsyURqE LKuPYOK5Q==; Received: from [45.249.212.188] (helo=dggrg02-dlp.huawei.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctXSg-0000rr-GO for linux-arm-kernel@lists.infradead.org; Thu, 30 Mar 2017 10:37:52 +0000 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: , , , , , , , , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170330_113751_243260_AF2B0D06 X-CRM114-Status: GOOD ( 13.03 ) 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 */