Skip to content

Commit 6deba98

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 <[email protected]> Change-Id: Ida0d3720fb76e02ac0774719fa002c17abc86173
1 parent 5e35db7 commit 6deba98

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/arm64/kernel/cpu_errata.c

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

880880
static bool is_spectrev2_safe(void)
881881
{
882+
static const struct midr_range arm64_psci_bp_harden_cpus[] = {
883+
MIDR_ALL_VERSIONS(MIDR_KRYO3G),
884+
MIDR_ALL_VERSIONS(MIDR_KRYO2XX_GOLD),
885+
{},
886+
};
887+
882888
return !is_midr_in_range_list(read_cpuid_id(),
883-
arm64_bp_harden_smccc_cpus);
889+
arm64_bp_harden_smccc_cpus) ||
890+
!is_midr_in_range_list(read_cpuid_id(),
891+
arm64_psci_bp_harden_cpus);
884892
}
885893

886894
void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)

0 commit comments

Comments
 (0)