From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6707C433EF for ; Mon, 28 Mar 2022 13:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nkPDVACU+pUfI/XdO83Yd/1WUQOI3+Vopguzvl/kTGM=; b=jX8gQPaa6QfK52 wKGCZAPQItoLt7sIcMdwycPNtgBKI1bEQkBenXLzGTtpKAueJXh9NiuS8V56YD9jfPu8UlcMQsGfX pmv5KQCsnlZkuwQEKRCHohcHbF4bS0Ivlg8KfupCOQTKO+0DlSSNnZo1mBSLvI+2UDa1au2GND2Bv RSdJ94fBZD8IpQO63E5OkSaVi8fBss1HQp3KWf/fC3cpT6Yxpkprx//+U+mTY+KKabNtiJOHdoiz3 PGvy5XGgELEW7qZFDfN72xaY88huQrHCQHFX9hRxsqsA2dwYFit8yPTKbqgJKPIzAc7ZMI8gpcwyz TKKq+sTEC9Idw37T0YsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYpnu-008vfP-4C; Mon, 28 Mar 2022 13:53:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYpiW-008tXa-Vq for linux-arm-kernel@lists.infradead.org; Mon, 28 Mar 2022 13:47:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 20BB3611A9; Mon, 28 Mar 2022 13:47:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C162C3410F; Mon, 28 Mar 2022 13:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648475251; bh=0AlyggzXAhlI+wH9IIAwzKQ/h4pIx2o5Tv9llkEQJZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gL2pIPV47NbG6RBGYoNHOvi7LtZE8CuL4Qi/2cUUHC3xnpdw1sbaTLp6UorYn9x/x AwR78fQAGs5/OuK7c1ixwkoqRqEOMovR+h4aDFt0PPppdCzCyqGIZ3kcHufuQIc10B odw5KHTDdyJ0YnDRn5LOGR+4CtX65I6+2Q59n+1vkyXnnBr+HwIkteXaV3HYamAG4L FtAyJibJX3csfwFgqaurewwT6HZm17wyYWIJFj5/y2qtDCLFpmGUDWwdhCVmF3xKT9 akijh33AaxUiyJoqj5s72RX5PE4fmj/BVd6euZGlnhiUGFRDkrdTaci58xpsVXizRz IK5uuHGJBOa7Q== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: arnd@arndb.de, linus.walleij@linaro.org, Ard Biesheuvel Subject: [PATCH 4/6] ARM: spectre-bhb: use local DSB and elide ISB in loop8 sequence Date: Mon, 28 Mar 2022 15:47:12 +0200 Message-Id: <20220328134714.205342-5-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220328134714.205342-1-ardb@kernel.org> References: <20220328134714.205342-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1320; h=from:subject; bh=0AlyggzXAhlI+wH9IIAwzKQ/h4pIx2o5Tv9llkEQJZY=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBiQbxe2sLHmUMzokOfQNZPcka5qq4q1+t0xVleJ2Zx DKOMq7uJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYkG8XgAKCRDDTyI5ktmPJIx6C/ wPjDe3QByu6uVup36ffnBYT6nqVZL/Uht+Af5/S1wLJVSQHKSFfcZlZ43VzDjV12iyVkaREtsbrl8c DN4xcc/uusgRt2J2T6j5P66Z5LZ2xLiYf7wnl1y+rvKfF3n/raH9rSGliM07WbKzCJQMvQrbaWM8K6 jT1XlhRoTZmmN2XIYX12pHQVA4jRm9ssKB2/vDKgFSLxKeeWKWktCsIVW0473up1FVSohY5csW/xgC h1Sfa9M0VWrKNX9rnECgXCZ56YqHgx5LHfyv+ierSj1BmZpoisdCHftxJnpJHaATCA5fk/LkNgWU85 pNccqJ/O+wVJoKb/1cQYzcG82bzSyOXBejXoLQbXnKDXCHX/tyA0R9etC2C59qBm7KeJJtoFDQ08Xw k7Ab1OUEHZQBCzYelzzUhf9nGtq+/VEAoDdyAtOV7yaR2fjos8m+Pj7R8Us8dzMSVUoCAZIiEstOkp vlqGzn2RSB1gChdG1jZFS5fv0yjPPbrJPA6TI/vebonzc= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220328_064733_125033_569E4AF5 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The loop8 mitigation for Spectre-BHB only requires a CPU local DSB rather than a systemwide one, which is much more costly. And by the same reasoning as why it is justified to omit the ISB after BPIALL, we can also elide the ISB and rely on the exception return for the context synchronization. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/entry-armv.S | 5 +++-- arch/arm/kernel/entry-common.S | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a5725e82addc..3a62ee790b5e 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1049,8 +1049,9 @@ vector_bhb_loop8_\name: 3: W(b) . + 4 subs r0, r0, #1 bne 3b - dsb - isb + dsb nsh + @ isb not needed due to "movs pc, lr" in the vector stub + @ which gives a "context synchronisation". b 2b ENDPROC(vector_bhb_loop8_\name) .previous diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index dbc1913ee30b..96016a5ad72f 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -162,7 +162,7 @@ ENTRY(vector_bhb_loop8_swi) 1: b 2f 2: subs r8, r8, #1 bne 1b - dsb + dsb nsh isb b 3f ENDPROC(vector_bhb_loop8_swi) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel