Skip to content

Commit 165eb13

Browse files
fltowilldeacon
authored andcommitted
arm64: proton-pack: Fix hard lockup when !MITIGATE_SPECTRE_BRANCH_HISTORY
The "drop print" commit removed the whole branch and not just the print. For some ARM64 cpus, this leads to hard lockup when CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY is not enabled. Fixes: 62e7246 ("arm64: proton-pack: Drop print when !CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY") Signed-off-by: Jonathan Marek <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 7c16c02 commit 165eb13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/kernel/proton-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)
10321032

10331033
if (arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE) {
10341034
/* No point mitigating Spectre-BHB alone. */
1035+
} else if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY)) {
1036+
/* Do nothing */
10351037
} else if (supports_ecbhb(SCOPE_LOCAL_CPU)) {
10361038
state = SPECTRE_MITIGATED;
10371039
set_bit(BHB_HW, &system_bhb_mitigations);

0 commit comments

Comments
 (0)