ARM64/errata: Check `arm64_psci_bp_harden_cpus` list too for `is_spectrev2_safe()`
If PSCI_BP_HARDENING is set, Kryo 2xx/3xx Gold targets will be on this list
instead of the default arm64_bp_harden_smccc_cpus list.
Signed-off-by: Albert I <kras@raphielgang.org>
Change-Id: Ida0d3720fb76e02ac0774719fa002c17abc86173
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 01855e9..140f643 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -879,8 +879,16 @@ static void kvm_setup_bhb_slot(const char *hyp_vecs_start) { };
static bool is_spectrev2_safe(void)
{
+ static const struct midr_range arm64_psci_bp_harden_cpus[] = {
+ MIDR_ALL_VERSIONS(MIDR_KRYO3G),
+ MIDR_ALL_VERSIONS(MIDR_KRYO2XX_GOLD),
+ {},
+ };
+
return !is_midr_in_range_list(read_cpuid_id(),
- arm64_bp_harden_smccc_cpus);
+ arm64_bp_harden_smccc_cpus) ||
+ !is_midr_in_range_list(read_cpuid_id(),
+ arm64_psci_bp_harden_cpus);
}
void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)