Skip to content

Commit 0c4636d

Browse files
Marc Zyngiergregkh
authored andcommitted
arm64: Run ARCH_WORKAROUND_2 enabling code on all CPUs
commit 39533e1 upstream. Commit 606f8e7 ("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: 606f8e7 ("arm64: capabilities: Use linear array for detection and verification") Cc: <stable@vger.kernel.org> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 32b38af commit 0c4636d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

arch/arm64/kernel/cpu_errata.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
457457
return required;
458458
}
459459

460+
static void cpu_enable_ssbd_mitigation(const struct arm64_cpu_capabilities *cap)
461+
{
462+
if (ssbd_state != ARM64_SSBD_FORCE_DISABLE)
463+
cap->matches(cap, SCOPE_LOCAL_CPU);
464+
}
465+
460466
/* known invulnerable cores */
461467
static const struct midr_range arm64_ssb_cpus[] = {
462468
MIDR_ALL_VERSIONS(MIDR_CORTEX_A35),
@@ -914,6 +920,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
914920
.capability = ARM64_SSBD,
915921
.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
916922
.matches = has_ssbd_mitigation,
923+
.cpu_enable = cpu_enable_ssbd_mitigation,
917924
.midr_range_list = arm64_ssb_cpus,
918925
},
919926
#ifdef CONFIG_ARM64_ERRATUM_1418040

0 commit comments

Comments
 (0)