Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1984833pxx; Sat, 31 Oct 2020 04:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV9cK5TXRz36FK2W7HRCAqBWGL4joFEyt6zj8ywKZwt3dATH7IPrcmAtcPn+I+hZnGN6MI X-Received: by 2002:a17:907:70cb:: with SMTP id yk11mr6815272ejb.122.1604145111916; Sat, 31 Oct 2020 04:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604145111; cv=none; d=google.com; s=arc-20160816; b=D7DrmoEFm14IdTWECEiZEb8gVleAaVl40p2/775NZI4e43+z4NfXGpyIQEmp4zY+7A lyHIuBULA7HYd7XvoCb4cV+N2LzbmCovNl4ZdNfOkbKraWH/5gyNRHRj926a7Q7uNHEP G/JaBvY1PS3TuG3byQmmKvW3ZmrABxOLLSYF8gi+r/UgsEOoU3vSnBsSdI33lod2E6Sx uPEZcrSB9z72+7QKxtFLT6q/RGs7anzIoN1ZNi3qRNII1M0VL3hxo1RO/mYbFgZKtbQ7 /xFKvC9JRUFTaO0Z/ZNHG5CPytrssNeFWGageVSY5Q2zxViYRsn83QsEenPVcb/6Aig1 Yu7w== 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=zwnFq5IAH/crqx0l8tvlnCyn9+slNxtZJPumvXPtMCc=; b=wiVm2e+itfcNyaiQ15waajRkD3nYCMDcZyYDeQ9O7Xkiq+0+LVVuI5LqTvzPjfC1P6 P6+OUpaqqTD+nBb5E//k6Lfv71St9Orh85+8XmkaUNyQ/jTRIANR0GgXNtWzCELDMqHK k3jQE5e3a6mFZ0Oh0l1NaAQc5s6RrPVoNOfzxBWyP+rmLw2n5D3L0JDGcxrE3wXpmIT8 UCWpEoFWFYY2l1Q/xv8I2wIokToQ3+ItD0J/1S4mrPR8A1rFnmIvQljdYM6FUNCz3OvI nGjRvsSSdXrosyWx8Q9JLYzMc8Sslry7BXJYr+EHMImILt4oVuKSxLmFuKJ57XWBrIqE Ovdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=op4+otEp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p3si8883870edd.200.2020.10.31.04.51.29; Sat, 31 Oct 2020 04:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=op4+otEp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbgJaLtt (ORCPT + 99 others); Sat, 31 Oct 2020 07:49:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:41302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgJaLl6 (ORCPT ); Sat, 31 Oct 2020 07:41:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34BF12074F; Sat, 31 Oct 2020 11:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144517; bh=4ozeNlVICQObkOWpxcFFcUdPW/bi0sqYkQWFx7KvbwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=op4+otEpCj8u9GuCUSn4xV8djZnbdCqG3ZA0kfuSkX72mSfZCUtBWxIsYRiYxokA5 gf9i9aBFJgXHamVS/3R7IXHHLmRk5XSHg2eAulJQju0TNhCzvM14stLtuqqUv2IVAH bR9wYbFmVWmg2HZa3HrtrotaFLf2r5l+oVRAMIMg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suzuki K Poulose , Marc Zyngier , Will Deacon Subject: [PATCH 5.8 21/70] arm64: Run ARCH_WORKAROUND_2 enabling code on all CPUs Date: Sat, 31 Oct 2020 12:35:53 +0100 Message-Id: <20201031113500.519853045@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier commit 39533e12063be7f55e3d6ae21ffe067799d542a4 upstream. Commit 606f8e7b27bf ("arm64: capabilities: Use linear array for detection and verification") changed the way we deal with per-CPU errata by only calling the .matches() callback until one CPU is found to be affected. At this point, .matches() stop being called, and .cpu_enable() will be called on all CPUs. This breaks the ARCH_WORKAROUND_2 handling, as only a single CPU will be mitigated. In order to address this, forcefully call the .matches() callback from a .cpu_enable() callback, which brings us back to the original behaviour. Fixes: 606f8e7b27bf ("arm64: capabilities: Use linear array for detection and verification") Cc: Reviewed-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpu_errata.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -457,6 +457,12 @@ out_printmsg: return required; } +static void cpu_enable_ssbd_mitigation(const struct arm64_cpu_capabilities *cap) +{ + if (ssbd_state != ARM64_SSBD_FORCE_DISABLE) + cap->matches(cap, SCOPE_LOCAL_CPU); +} + /* known invulnerable cores */ static const struct midr_range arm64_ssb_cpus[] = { MIDR_ALL_VERSIONS(MIDR_CORTEX_A35), @@ -914,6 +920,7 @@ const struct arm64_cpu_capabilities arm6 .capability = ARM64_SSBD, .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = has_ssbd_mitigation, + .cpu_enable = cpu_enable_ssbd_mitigation, .midr_range_list = arm64_ssb_cpus, }, #ifdef CONFIG_ARM64_ERRATUM_1418040