diff options
author | Will Deacon <will.deacon@arm.com> | 2019-05-01 15:34:56 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-05-01 15:34:56 +0100 |
commit | 50abbe19623e08e2aa34e0e526bd6115569f3dc3 (patch) | |
tree | ecaddb898d671847f70c40fcab5fd115dacc1a1e /include | |
parent | 9431ac2bf6b742d87cdac051adc1976308070110 (diff) | |
parent | 4ad499c94264a2ee05aacc518b9bde658318e510 (diff) | |
download | linux-50abbe19623e08e2aa34e0e526bd6115569f3dc3.tar.bz2 |
Merge branch 'for-next/mitigations' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux into for-next/core
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpu.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 5041357d0297..2d9c6f4b78f5 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -187,4 +187,28 @@ static inline void cpu_smt_disable(bool force) { } static inline void cpu_smt_check_topology(void) { } #endif +/* + * These are used for a global "mitigations=" cmdline option for toggling + * optional CPU mitigations. + */ +enum cpu_mitigations { + CPU_MITIGATIONS_OFF, + CPU_MITIGATIONS_AUTO, + CPU_MITIGATIONS_AUTO_NOSMT, +}; + +extern enum cpu_mitigations cpu_mitigations; + +/* mitigations=off */ +static inline bool cpu_mitigations_off(void) +{ + return cpu_mitigations == CPU_MITIGATIONS_OFF; +} + +/* mitigations=auto,nosmt */ +static inline bool cpu_mitigations_auto_nosmt(void) +{ + return cpu_mitigations == CPU_MITIGATIONS_AUTO_NOSMT; +} + #endif /* _LINUX_CPU_H_ */ |