-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64: entry: Add vectors that have the bhb mitigation sequences
Some CPUs affected by Spectre-BHB need a sequence of branches, or a firmware call to be run before any indirect branch. This needs to go in the vectors. No CPU needs both. While this can be patched in, it would run on all CPUs as there is a single set of vectors. If only one part of a big/little combination is affected, the unaffected CPUs have to run the mitigation too. Create extra vectors that include the sequence. Subsequent patches will allow affected CPUs to select this set of vectors. Later patches will modify the loop count to match what the CPU requires. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: James Morse <james.morse@arm.com>
- Loading branch information
James Morse
committed
Feb 16, 2022
1 parent
aff6539
commit ba26892
Showing
5 changed files
with
123 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (C) 2022 ARM Ltd. | ||
*/ | ||
#ifndef __ASM_VECTORS_H | ||
#define __ASM_VECTORS_H | ||
|
||
/* | ||
* Note: the order of this enum corresponds to two arrays in entry.S: | ||
* tramp_vecs and __bp_harden_el1_vectors. By default the canonical | ||
* 'full fat' vectors are used directly. | ||
*/ | ||
enum arm64_bp_harden_el1_vectors { | ||
#ifdef CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY | ||
/* | ||
* Perform the BHB loop mitigation, before branching to the canonical | ||
* vectors. | ||
*/ | ||
EL1_VECTOR_BHB_LOOP, | ||
|
||
/* | ||
* Make the SMC call for firmware mitigation, before branching to the | ||
* canonical vectors. | ||
*/ | ||
EL1_VECTOR_BHB_FW, | ||
#endif /* CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY */ | ||
|
||
/* | ||
* Remap the kernel before branching to the canonical vectors. | ||
*/ | ||
EL1_VECTOR_KPTI, | ||
+}; | ||
|
||
#endif /* __ASM_VECTORS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters