aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/proton-pack.c
diff options
context:
space:
mode:
authorD Scott Phillips <scott@os.amperecomputing.com>2022-10-10 19:21:40 -0700
committerCatalin Marinas <catalin.marinas@arm.com>2022-10-12 17:36:06 +0100
commit0e5d5ae837c8ce04d2ddb874ec5f920118bd9d31 (patch)
tree9551dd36a66919bbadd41c4f07deb1c59de5168e /arch/arm64/kernel/proton-pack.c
parentarm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored (diff)
downloadlinux-dev-0e5d5ae837c8ce04d2ddb874ec5f920118bd9d31.tar.xz
linux-dev-0e5d5ae837c8ce04d2ddb874ec5f920118bd9d31.zip
arm64: Add AMPERE1 to the Spectre-BHB affected list
Per AmpereOne erratum AC03_CPU_12, "Branch history may allow control of speculative execution across software contexts," the AMPERE1 core needs the bhb clearing loop to mitigate Spectre-BHB, with a loop iteration count of 11. Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com> Link: https://lore.kernel.org/r/20221011022140.432370-1-scott@os.amperecomputing.com Reviewed-by: James Morse <james.morse@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to '')
-rw-r--r--arch/arm64/kernel/proton-pack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index a8ea1637b137..bfce41c2a53b 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -868,6 +868,10 @@ u8 spectre_bhb_loop_affected(int scope)
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
{},
};
+ static const struct midr_range spectre_bhb_k11_list[] = {
+ MIDR_ALL_VERSIONS(MIDR_AMPERE1),
+ {},
+ };
static const struct midr_range spectre_bhb_k8_list[] = {
MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
MIDR_ALL_VERSIONS(MIDR_CORTEX_A57),
@@ -878,6 +882,8 @@ u8 spectre_bhb_loop_affected(int scope)
k = 32;
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k24_list))
k = 24;
+ else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k11_list))
+ k = 11;
else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k8_list))
k = 8;