Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2105805ioo; Mon, 23 May 2022 10:10:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhy7ezQ9nKFifkWawi+u33Q2XXnm2N6xVIPoG2frls1yyaNysXJ6n4pfTYlsQdJDwwLa18 X-Received: by 2002:a17:90b:4f82:b0:1e0:4852:bc5d with SMTP id qe2-20020a17090b4f8200b001e04852bc5dmr45533pjb.64.1653325850748; Mon, 23 May 2022 10:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653325850; cv=none; d=google.com; s=arc-20160816; b=sbJGdh5GCZZZNnflQ90esLqDUW5Wm7Ridks4yZszHdVsdsgXs54cXaAnagetv6rwFI EA0QrwUyDFHL3jlPWcY30cZPtnAkOw7C4DOVO5HDfka2C1Z+LltXUBiMa7XR1XdC4KIR /Oab6i6hMXbtie5H55srQ0wwaUh5csjEHyu+dbpMl3uOhpICaBYLPe0GhSgZaSUCptw8 VyGLLi/3cN2PBciO4p6w3T79JBN8JJdwiiNpCmHHSOe3t0kQqqmAhRGXd8o3/BXE+dmR 9+0NRXPjlQVUVdAmHeVaI7sAh3akFJUQAPKpHg6qM1xVeDmVgh9P9LvcCv2xSq6sap7r 62gw== 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=R0JhL55W2mi+esWe4Kd+W4r65PdsOUdCLjwtMFs0Fps=; b=px8tAPEtS5vtaS4YSiWMId+R0h8OsQSuJL53MVhgZxITLLfmfzM8yVZkhAcabNbC5E XsJeD1kE536py46jEDob9pkmHzDEMFrdpqfAbm7gvvxJdMWlpWrWn3fCqZ/AKf741tMx DBy22gU9+QZcTu1sP7Ut6RDNft/IV+j2UaXXWC0hvYPWBBdsvBE0WhKZipXg0gVj0427 VOeuoarlfzTpNHWe19m4vb/XsPgBcwq4URxJ43mwZo409hM/nkL8cYifr0JvMQ5bLBgE C4p1VDDFwycHvlymf1/tGjIusDYYkRWzruTdlzdRe1KAdYdsJya0K/nyNn1V2Ue6Opvc 6RyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dfuZxxs/"; 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 v135-20020a63618d000000b003fa218db292si194396pgb.682.2022.05.23.10.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:10:50 -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="dfuZxxs/"; 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 AEAD66B678; Mon, 23 May 2022 10:10:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239508AbiEWRJj (ORCPT + 99 others); Mon, 23 May 2022 13:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239687AbiEWRJR (ORCPT ); Mon, 23 May 2022 13:09:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80CAB6C0DE; Mon, 23 May 2022 10:08:46 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2FC2FB811FB; Mon, 23 May 2022 17:08:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35143C385A9; Mon, 23 May 2022 17:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325717; bh=3ygoNkuaHAaO3mdp7qZ88N7lGbtS08g8u+DlH8TMkBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dfuZxxs/CkiSNcXtkVdtseAcWmD+roMvcrc1O/+lnSxSJ/L+vigOUPjvm/1FByuEa +YEyGjVeLCmbnwaY6TkIuQ80DP6aWeVhctGtj5tSa+Fe1HRClWS4OsBjEw7H+DDG1Y HCCMLbxY6rKicW8cXlhJJHqZKtvvoSMtwpah+0OY= 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 4.14 21/33] ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2 Date: Mon, 23 May 2022 19:05:10 +0200 Message-Id: <20220523165751.599994602@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@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 b54084f9b77a..e1b3c5c96560 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1071,7 +1071,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