1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Interface for managing mitigations for Spectre vulnerabilities.
5 * Copyright (C) 2020 Google LLC
6 * Author: Will Deacon <will@kernel.org>
9 #ifndef __ASM_SPECTRE_H
10 #define __ASM_SPECTRE_H
12 #include <asm/cpufeature.h>
14 /* Watch out, ordering is important here. */
15 enum mitigation_state {
23 enum mitigation_state arm64_get_spectre_v2_state(void);
24 bool has_spectre_v2(const struct arm64_cpu_capabilities *cap, int scope);
25 void spectre_v2_enable_mitigation(const struct arm64_cpu_capabilities *__unused);
27 enum mitigation_state arm64_get_spectre_v4_state(void);
28 bool has_spectre_v4(const struct arm64_cpu_capabilities *cap, int scope);
29 void spectre_v4_enable_mitigation(const struct arm64_cpu_capabilities *__unused);
30 void spectre_v4_enable_task_mitigation(struct task_struct *tsk);
32 #endif /* __ASM_SPECTRE_H */