-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64: Rewrite Spectre-v2 mitigation code
The Spectre-v2 mitigation code is pretty unwieldy and hard to maintain. This is largely due to it being written hastily, without much clue as to how things would pan out, and also because it ends up mixing policy and state in such a way that it is very difficult to figure out what's going on. Rewrite the Spectre-v2 mitigation so that it clearly separates state from policy and follows a more structured approach to handling the mitigation. Signed-off-by: Will Deacon <will@kernel.org>
- Loading branch information
1 parent
455697a
commit d4647f0
Showing
8 changed files
with
327 additions
and
264 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
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,27 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Interface for managing mitigations for Spectre vulnerabilities. | ||
* | ||
* Copyright (C) 2020 Google LLC | ||
* Author: Will Deacon <will@kernel.org> | ||
*/ | ||
|
||
#ifndef __ASM_SPECTRE_H | ||
#define __ASM_SPECTRE_H | ||
|
||
#include <asm/cpufeature.h> | ||
|
||
/* Watch out, ordering is important here. */ | ||
enum mitigation_state { | ||
SPECTRE_UNAFFECTED, | ||
SPECTRE_MITIGATED, | ||
SPECTRE_VULNERABLE, | ||
}; | ||
|
||
struct task_struct; | ||
|
||
enum mitigation_state arm64_get_spectre_v2_state(void); | ||
bool has_spectre_v2(const struct arm64_cpu_capabilities *cap, int scope); | ||
void spectre_v2_enable_mitigation(const struct arm64_cpu_capabilities *__unused); | ||
|
||
#endif /* __ASM_SPECTRE_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
Oops, something went wrong.