Skip to content

Commit a595138

Browse files
diandersctmarinas
authored andcommitted
arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() lists
When comparing to the ARM list [1], it appears that several ARM cores were missing from the lists in spectre_bhb_loop_affected(). Add them. NOTE: for some of these cores it may not matter since other ways of clearing the BHB may be used (like the CLRBHB instruction or ECBHB), but it still seems good to have all the info from ARM's whitepaper included. [1] https://developer.arm.com/Arm%20Security%20Center/Spectre-BHB Fixes: 558c303 ("arm64: Mitigate spectre style branch history side channels") Cc: [email protected] Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: James Morse <[email protected]> Link: https://lore.kernel.org/r/20250107120555.v4.5.I4a9a527e03f663040721c5401c41de587d015c82@changeid Signed-off-by: Catalin Marinas <[email protected]>
1 parent a9b5bd8 commit a595138

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

arch/arm64/kernel/proton-pack.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,14 @@ static u8 spectre_bhb_loop_affected(void)
876876
{
877877
u8 k = 0;
878878

879+
static const struct midr_range spectre_bhb_k132_list[] = {
880+
MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
881+
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
882+
};
883+
static const struct midr_range spectre_bhb_k38_list[] = {
884+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
885+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
886+
};
879887
static const struct midr_range spectre_bhb_k32_list[] = {
880888
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
881889
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78AE),
@@ -889,6 +897,7 @@ static u8 spectre_bhb_loop_affected(void)
889897
};
890898
static const struct midr_range spectre_bhb_k24_list[] = {
891899
MIDR_ALL_VERSIONS(MIDR_CORTEX_A76),
900+
MIDR_ALL_VERSIONS(MIDR_CORTEX_A76AE),
892901
MIDR_ALL_VERSIONS(MIDR_CORTEX_A77),
893902
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
894903
MIDR_ALL_VERSIONS(MIDR_QCOM_KRYO_4XX_GOLD),
@@ -904,7 +913,11 @@ static u8 spectre_bhb_loop_affected(void)
904913
{},
905914
};
906915

907-
if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k32_list))
916+
if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k132_list))
917+
k = 132;
918+
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k38_list))
919+
k = 38;
920+
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k32_list))
908921
k = 32;
909922
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k24_list))
910923
k = 24;

0 commit comments

Comments
 (0)