Skip to content

Commit 3d6e362

Browse files
krasCGQmikeNG
authored andcommitted
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
1 parent f3e28b8 commit 3d6e362

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

arch/arm64/kernel/cpu_errata.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,16 @@ static void kvm_setup_bhb_slot(const char *hyp_vecs_start) { };
885885

886886
static bool is_spectrev2_safe(void)
887887
{
888+
static const struct midr_range arm64_psci_bp_harden_cpus[] = {
889+
MIDR_ALL_VERSIONS(MIDR_KRYO3G),
890+
MIDR_ALL_VERSIONS(MIDR_KRYO2XX_GOLD),
891+
{},
892+
};
893+
888894
return !is_midr_in_range_list(read_cpuid_id(),
889-
arm64_bp_harden_smccc_cpus);
895+
arm64_bp_harden_smccc_cpus) ||
896+
!is_midr_in_range_list(read_cpuid_id(),
897+
arm64_psci_bp_harden_cpus);
890898
}
891899

892900
void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)

0 commit comments

Comments
 (0)