Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3689220lfo; Mon, 23 May 2022 11:30:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2fRUK/hzk/QB3F3fQ4Eb4wXO5EvXL612MOZT3TQPEwOxBAnStA8zUGtQGFmiqepSmyvAi X-Received: by 2002:a17:902:6b41:b0:15f:2c60:2459 with SMTP id g1-20020a1709026b4100b0015f2c602459mr24100834plt.41.1653330658874; Mon, 23 May 2022 11:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330658; cv=none; d=google.com; s=arc-20160816; b=Gozg1iojfiiUslFDEJM5y4m/DSGlPMmfNBNRmla4f4D+AZ0NG6f+yEmIE0yOWGkdvs iA69uCGsD2Cdf5vVyEXFCWqXOJBfEoN4mczqNr/gTvhk7n7JEQCeCMyc7tke9vBVZS8d QDRcVvufHmS+qUQKxL00Jlh1rSg5786VAmaFgPQNzdwpTcVDqFNYAD2l8L7kgNwWdu7P /xmjQLtjv7eQNCnMFb7Isg4zqebQIfauftBXFKAz0GAOo8zsIgfT/NQgLlHxueHcQOQw UuOcbiRGBGqvgjc5ycf22lDoB2SBaVRDHJN7gK8yDR9zHVOoPV7PMmofCl1PUBvK8a0G yJfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+vVaKXIyEXR8eaqPhrBK9urrKQFuo3cxtn5W3OruaaI=; b=TqrLKGNrJjhYLaLdKkI1lnTrMLtTTgjlr8OdhOiGs5ISxQ83fc8nCSAWfF9VT2iAkP 2cz9W2bAj6CjF6QbxJvSvfdOQIa9EPCqNhqDrWrPYv+vH4olv6DWc/X5pa4yLY8vC0kw ZfQK432lb1+1hn1vkRS5zaMzVjYhIc8dq93JAkLBdaSKOH2CGXXNOxn43PZyrcW74SAr RVxPlFpXb9pZ0Y8p+Fbp9A+OQO2pe2+ThJJhFCgDFG8xUmYB0xno+thMSevV+5qhLuHw G0Z97KsdxyJybwLKaHC5SbLY84GnpdnhCtc8ICgMhAaLkO6SMo5D/dsi5ZSpyHxQTmul ZJdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mDa75c40; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o7-20020a170902bcc700b00161e89de8b3si10948604pls.5.2022.05.23.11.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mDa75c40; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 735B213FD4C; Mon, 23 May 2022 11:30:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243965AbiEWRnB (ORCPT + 99 others); Mon, 23 May 2022 13:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242597AbiEWR1s (ORCPT ); Mon, 23 May 2022 13:27:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8BDD7CDF3; Mon, 23 May 2022 10:23:51 -0700 (PDT) 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 C07346152D; Mon, 23 May 2022 17:14:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8B86C385AA; Mon, 23 May 2022 17:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326047; bh=T2Cjm9bkakNUw9hjDDr+pQFIxIEL7vSENcta9GlgXnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDa75c40gBsWpjGrTCE18EwI5QtmoWS351UCe0zVEi1p0RLkybiw8cDG6foZkeBp8 rzkgvd0Riu5wSlvSq7jwOZlBqMhMhiw6fDiuK0ryqJzG/1kGbGb7SHie6qfoHQlWca LfpU7VMG7tmk5YtbjQMnTfFmQSWgLv6oYP8qv5/I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , "Russell King (Oracle)" , Sasha Levin Subject: [PATCH 5.4 47/68] ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2 Date: Mon, 23 May 2022 19:05:14 +0200 Message-Id: <20220523165810.325794402@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 3cfb3019979666bdf33a1010147363cf05e0f17b ] In Thumb2, 'b . + 4' produces a branch instruction that uses a narrow encoding, and so it does not jump to the following instruction as expected. So use W(b) instead. Fixes: 6c7cb60bff7a ("ARM: fix Thumb2 regression with Spectre BHB") Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) Signed-off-by: Sasha Levin --- arch/arm/kernel/entry-armv.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 3d65fa56a0e5..8e8efe28d799 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1043,7 +1043,7 @@ vector_bhb_loop8_\name: @ bhb workaround mov r0, #8 -3: b . + 4 +3: W(b) . + 4 subs r0, r0, #1 bne 3b dsb -- 2.35.1