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 4EF1EC47088 for ; Sat, 3 Dec 2022 13:56:01 +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:Message-ID:In-Reply-To: Date:From:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=KAoiUbxJZLQi35LPI0rdGBHVcEY4gSwIgbIVROphXN8=; b=Q5BOXGFzpEndeM qmN+B+hkVubiT65HjgzWreMitVnXRxynlcyrdduJ0itf4E/8GNGkAwnIdnpMozbNR1XiWYJrGDmZs BGNBdUu/6pO67lFuChwgJTuiaWkx9Yf4e6SA/q+hRph6jBi0CuFQNKj1o35YLdT3D287qP4Xws2xQ 6tQAx0HdzHG8x5yoeztf/TOW84fpuw2wnmAZw0q/WVbeIzshZBsEBDeq3z8kQWElyEnD3Syj6CFaq 3zAbIOv2rch3uKEiW8hEIXTwVDx4uYiZilWkByhjZ3sYvczVr89UOPGjoO914w5cYJ3M+bu8FOatm XRJwGXA5tlBEYEUPig9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Syf-003foH-FH; Sat, 03 Dec 2022 13:54:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1Syc-003fnx-6V for linux-arm-kernel@lists.infradead.org; Sat, 03 Dec 2022 13:54:47 +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 1D75460B1F; Sat, 3 Dec 2022 13:54:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CD3FC433D6; Sat, 3 Dec 2022 13:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670075684; bh=kpvzNgDKgiAD4EBkZaocIXVlQc6obIhMQf2KUkdagPE=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=djBQp1E9JChvxbQs+R+dKsevH3IUtCgkj4j52KNGetea1VgDkgP5tD+SIcvC3iYKq piIyRCURqRtD13Ln8DxEkkG3dgFPCXtwySCeDQ6GrsR3fnOJ37U/2Qs2QhaZ00s0Rj g9ThT2Jr4h22eKvGsqIViDaMKIOJdBQvM19s3iVg= Subject: Patch "arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72" has been added to the 4.9-stable tree To: catalin.marinas@arm.com,gregkh@linuxfoundation.org,james.morse@arm.com,linux-arm-kernel@lists.infradead.org Cc: From: Date: Sat, 03 Dec 2022 14:54:41 +0100 In-Reply-To: <20221130182956.739350-3-james.morse@arm.com> Message-ID: <16700756812144@kroah.com> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221203_055446_377037_857F4ECF X-CRM114-Status: GOOD ( 18.36 ) 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 This is a note to let you know that I've just added the patch titled arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72 to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm64-errata-fix-kvm-spectre-v2-mitigation-selection-for-cortex-a57-a72.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sat Dec 3 02:32:26 PM CET 2022 From: James Morse Date: Wed, 30 Nov 2022 18:29:56 +0000 Subject: arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72 To: stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , James Morse Message-ID: <20221130182956.739350-3-james.morse@arm.com> From: James Morse Both the Spectre-v2 and Spectre-BHB mitigations involve running a sequence immediately after exiting a guest, before any branches. In the stable kernels these sequences are built by copying templates into an empty vector slot. For Spectre-BHB, Cortex-A57 and A72 require the branchy loop with k=8. If Spectre-v2 needs mitigating at the same time, a firmware call to EL3 is needed. The work EL3 does at this point is also enough to mitigate Spectre-BHB. When enabling the Spectre-BHB mitigation, spectre_bhb_enable_mitigation() should check if a slot has already been allocated for Spectre-v2, meaning no work is needed for Spectre-BHB. This check was missed in the earlier backport, add it. Fixes: 4dd8aae585a5 ("arm64: Mitigate spectre style branch history side channels") Signed-off-by: James Morse Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpu_errata.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -876,7 +876,13 @@ void spectre_bhb_enable_mitigation(const } else if (spectre_bhb_loop_affected(SCOPE_LOCAL_CPU)) { switch (spectre_bhb_loop_affected(SCOPE_SYSTEM)) { case 8: - kvm_setup_bhb_slot(__spectre_bhb_loop_k8_start); + /* + * A57/A72-r0 will already have selected the + * spectre-indirect vector, which is sufficient + * for BHB too. + */ + if (!__this_cpu_read(bp_hardening_data.fn)) + kvm_setup_bhb_slot(__spectre_bhb_loop_k8_start); break; case 24: kvm_setup_bhb_slot(__spectre_bhb_loop_k24_start); Patches currently in stable-queue which might be from james.morse@arm.com are queue-4.9/arm64-errata-fix-kvm-spectre-v2-mitigation-selection-for-cortex-a57-a72.patch queue-4.9/arm64-fix-panic-when-spectre-v2-causes-spectre-bhb-to-re-allocate-kvm-vectors.patch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel