Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2113083ioo; Mon, 23 May 2022 10:19:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQdTAAKaVJRnI1qNeZM0et+e8/X8J8pYiPx9lFc2qg5DWDxqItdxw8wVqURFxqe3o9MEj6 X-Received: by 2002:a63:2209:0:b0:3ab:113b:9a2b with SMTP id i9-20020a632209000000b003ab113b9a2bmr21253428pgi.235.1653326383144; Mon, 23 May 2022 10:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326383; cv=none; d=google.com; s=arc-20160816; b=mVOsj4bWBaGvHrD5Da3S+giVy2eqyiVU9gw+QgFNw8hDQatYaZ3G6mOu39fy6N6atY wT+I4b0Vai0faBX6+wuDWJNbQS5GNtwbnWARItZHYMy5VwNjmhk/kSJAG9/uZ59TNtvL Op3nP4jyydAGrggj+3+mQ9i7EpxLTUb9Z/DuDPJqh73n2dF1Syszh9wzJFd19ISmaMty fTmYLm2Xf9quaIGV/zYpesUCsvZc0CpIggdoMLubnk65N+RumyzL+jGrkHW6SrW703XT jv4cNDg242rjm3sjcciEEWCJ1UGo2ytELp+uw2Dbo86Y8sJqiyWg310EhXIXlZKFCSmd Aszw== 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=fBTNahGeMN5dt91/bhTQdVZLWRVYSw+BRAaKSNtmH94=; b=jCkii2qMrqqYdvlheHhipAnN1Nafk6fM6vSUNIc0kUhbFCpflVmIAb2EvVbqBWZ4PX 66heZT6mc9pHyv2k3QB0G5bYXHf2tykwO8FLu7UtIuMfhNQYF+0jMZY9jNQmdB30FyWB 614fmBsvzEm93Vbe713zablfSa0f+757B4SX2UNuJtO8Ui4ENV4+PlfbvlUjCoenMImm YYzPqaniKekGbD+UiPyZhPWCL27chGtws//srIoSgaHbmhg5Ap77f+FZsIfL+Ozm+K4D 3AtMCX9Q7nF65R29XD4S3gWyYh4WpBU/ALV2XCsk0uKRVTFgdBSX1HegGKcGfR8hKVC1 up9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CL3obSWX; 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 r23-20020a170902ea5700b0016229a39343si3881031plg.115.2022.05.23.10.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:19:43 -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=CL3obSWX; 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 BF56A6B642; Mon, 23 May 2022 10:19:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240511AbiEWRQY (ORCPT + 99 others); Mon, 23 May 2022 13:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240772AbiEWRMi (ORCPT ); Mon, 23 May 2022 13:12:38 -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 AFA526B7EB; Mon, 23 May 2022 10:12:05 -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 9FDA0B8120C; Mon, 23 May 2022 17:10:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCBE3C34116; Mon, 23 May 2022 17:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325854; bh=r+YoF+Jk1Ur3+B15L67bp8ae8bJEZ2yCMEZHlxk8IZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CL3obSWXshk2TgfDNmAmArd4MSZPbZe4JVtrchx7ca0ctLWkVfQs+6L5B6ejOFTdP nwqaUgod/OEe6iRUg5P7vThC26eTRYv2TedvwIMLYiTc2lq8n0NlAdyNxTNGkSHpNm Jxq6tozXw4SSp6m9x0TUusgUemWXDMKyjex9tGKs= 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.19 31/44] ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2 Date: Mon, 23 May 2022 19:05:15 +0200 Message-Id: <20220523165758.790815379@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 a929b6acb149..d779cd1a3b0c 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1067,7 +1067,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