From patchwork Wed Nov 1 19:14:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10036237 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 CC0AB6032D for ; Wed, 1 Nov 2017 11:10:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFD882843B for ; Wed, 1 Nov 2017 11:10:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C312A28B6F; Wed, 1 Nov 2017 11:10:10 +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=-2.3 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED 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 22D4C2843B for ; Wed, 1 Nov 2017 11:10:08 +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:References:In-Reply-To: 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: List-Owner; bh=FGhmv+bH+m9Ez3djdJsdf9SsPHm9vvsHwuneXTrJLms=; b=k61KfTzmTXDh3W SP8t5Afa0SMzP0Nt0idkG1/KXpEwkUu56B0CMdkTykxMfDHRv7+oB8Xj5x0mWfDTaR+OgxijoEU0M /p1yXSgHv+h92yls326+bra1LvLPQ0mqE2TtDeLBMTt8qdipc7XOM5xLqc66sUg7naD4VvskbVFU8 1peGWJMBU70Sj2EF6B6FFt3tud+pn0byLA8P2c68FFzSqJPc07fuoN/vCmZWYzTvU1IWkAb28RF1H InnVYzOu9dvgIk7iyWkluYTjy6/e2+4CwRDyvyFEBVeJU5aAkt50hfJ54Pzdiy630iDnMF5cLuHLd LSX16dX1hOkpzaiIfTjQ==; 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 1e9quN-0007H1-Cc; Wed, 01 Nov 2017 11:10:07 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9quG-0006zZ-J6 for linux-arm-kernel@lists.infradead.org; Wed, 01 Nov 2017 11:10:03 +0000 Received: from 172.30.72.59 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKC78229; Wed, 01 Nov 2017 19:09:16 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Wed, 1 Nov 2017 19:08:57 +0800 From: Dongjiu Geng To: , , , , , , , , , , , , , , Subject: [PATCH v1 1/3] arm64: add a macro for SError synchronization Date: Thu, 2 Nov 2017 03:14:55 +0800 Message-ID: <1509563697-6359-2-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509563697-6359-1-git-send-email-gengdongjiu@huawei.com> References: <1509563697-6359-1-git-send-email-gengdongjiu@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.59F9AB5D.0033, 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: 028dbbd3b497c63accbfed8ca528feb2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171101_041001_075342_DE4CD555 X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. 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 ARMv8.2 adds a control bit to each SCTLR_ELx to insert implicit Error Synchronization Barrier(IESB) operations at exception handler entry and exit. But not all hardware platform which support RAS Extension can support IESB. So for this case, software needs to manually insert Error Synchronization Barrier(ESB) operations. In this macros, if system supports RAS Extensdddon instead of IESB, it will insert an ESB instruction. Signed-off-by: Dongjiu Geng --- arch/arm64/include/asm/assembler.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index d4c0adf..e6c79c4 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -517,4 +517,13 @@ #endif .endm + .macro error_synchronize +alternative_if ARM64_HAS_IESB + b 1f +alternative_else_nop_endif +alternative_if ARM64_HAS_RAS_EXTN + esb +alternative_else_nop_endif +1: + .endm #endif /* __ASM_ASSEMBLER_H */