Commit 0ccd5c2c authored by Marc Zyngier's avatar Marc Zyngier Committed by Greg Kroah-Hartman
Browse files

arm64: Run ARCH_WORKAROUND_1 enabling code on all CPUs

commit 18fce56134c987e5b4eceddafdbe4b00c07e2ae1 upstream.

Commit 73f38166 ("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: 73f38166

 ("arm64: Advertise mitigation of Spectre-v2, or lack thereof")
Cc: <>
Reviewed-by: default avatarSuzuki K Poulose <>
Signed-off-by: default avatarMarc Zyngier <>
Signed-off-by: default avatarWill Deacon <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 4720b25e
......@@ -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[] = {
......@@ -890,9 +896,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
.desc = "Branch predictor hardening",
.matches = check_branch_predictor,
.cpu_enable = cpu_enable_branch_predictor_hardening,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment