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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84836C2D0A3 for ; Thu, 29 Oct 2020 12:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26F3720809 for ; Thu, 29 Oct 2020 12:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603974973; bh=MA6Bn8xQ0PsDfZanLfhk1M5WmJQ3gIByJZiw9k1v3pA=; h=Subject:To:Cc:From:Date:List-ID:From; b=z6eWcS1xWxwWn0pY0FqhfEclFypqvRARGG9R48SzKTrg4w2w8IiYj5AACdNhf5VYu VNVce4l/wC/5Z35BOQsqt0dw9yD3BTpFMleFQuBzxg3DJ4Lr9IgRK7T1SwzL55s9+3 gsy6nCy+EKwMnWjPT+8VzXH5gJWBL9fAtrmdn9eI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725771AbgJ2MgM (ORCPT ); Thu, 29 Oct 2020 08:36:12 -0400 Received: from wforward1-smtp.messagingengine.com ([64.147.123.30]:41389 "EHLO wforward1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgJ2MgM (ORCPT ); Thu, 29 Oct 2020 08:36:12 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.west.internal (Postfix) with ESMTP id 689BB7ED; Thu, 29 Oct 2020 08:36:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 29 Oct 2020 08:36:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=jZHK0j A7OuAsqc0fN0QrX1xaNqj+wP7Uxr5LfNMMELg=; b=CIwccuqwHZbijtXDStkm6U pat7DpAsMCiQ8MOxrZCqO6+dopblFUmLJxByEKiPjWswp06cwS9qOLFzvKf/ZhF4 MpmPU9nKdgh00Zp3pLMBrUTTjjl0HXrL/SJXaIw56qYtQd+6slp+rq6N9A5BlY4F lKwo+j0w9aIiH9LXziQbicnYodM68J56t/fWgfOm5Iy/+VWk75xqIXxbIduoQj1b jMzBsc/afC/zV4Ix7CZ1D4DWXQV8/9YN1XBHN5JEmyrp617wMAlwHULPoUrofK6s GmnIFbqjmMC4/ugPArz/kfPvzPFGPL3LMvTz9Em+ZtFxwJtWEXJwhlh0Kvv4eMZw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleefgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucggtffrrghtthgvrhhnpeeiteevheeuvdfhtdfgvdeiieehheefleevveehjedute evueevledujeejgfetheenucfkphepkeefrdekiedrjeegrdeigeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtg homh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 8829D3280060; Thu, 29 Oct 2020 08:36:10 -0400 (EDT) Subject: FAILED: patch "[PATCH] arm64: Run ARCH_WORKAROUND_1 enabling code on all CPUs" failed to apply to 4.14-stable tree To: maz@kernel.org, stable@vger.kernel.org, suzuki.poulose@arm.com, will@kernel.org Cc: From: Date: Thu, 29 Oct 2020 13:37:00 +0100 Message-ID: <160397502015568@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 18fce56134c987e5b4eceddafdbe4b00c07e2ae1 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Thu, 16 Jul 2020 17:11:09 +0100 Subject: [PATCH] arm64: Run ARCH_WORKAROUND_1 enabling code on all CPUs Commit 73f381660959 ("arm64: Advertise mitigation of Spectre-v2, or lack thereof") changed the way we deal with ARCH_WORKAROUND_1, by moving most of the enabling code to the .matches() callback. This has the unfortunate effect that the workaround gets only enabled on the first affected CPU, and no other. In order to address this, forcefully call the .matches() callback from a .cpu_enable() callback, which brings us back to the original behaviour. Fixes: 73f381660959 ("arm64: Advertise mitigation of Spectre-v2, or lack thereof") Cc: Reviewed-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 88966496806a..3fe64bf5a58d 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -599,6 +599,12 @@ check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope) return (need_wa > 0); } +static void +cpu_enable_branch_predictor_hardening(const struct arm64_cpu_capabilities *cap) +{ + cap->matches(cap, SCOPE_LOCAL_CPU); +} + static const __maybe_unused struct midr_range tx2_family_cpus[] = { MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2), @@ -890,9 +896,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = { }, #endif { + .desc = "Branch predictor hardening", .capability = ARM64_HARDEN_BRANCH_PREDICTOR, .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = check_branch_predictor, + .cpu_enable = cpu_enable_branch_predictor_hardening, }, #ifdef CONFIG_RANDOMIZE_BASE {