diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-04-17 21:38:16 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-04-17 21:55:31 +0200 |
commit | e9fee6fe08eef51cd9a7455d18b9011f1e463f22 (patch) | |
tree | 12df824e278d3bf25644cbb1f680e69044b02d07 /include/linux/cpu.h | |
parent | e2c3c94788b08891dcf3dbe608f9880523ecd71b (diff) | |
parent | 0336e04a6520bdaefdb0769d2a70084fa52e81ed (diff) | |
download | lwn-e9fee6fe08eef51cd9a7455d18b9011f1e463f22.tar.gz lwn-e9fee6fe08eef51cd9a7455d18b9011f1e463f22.zip |
Merge branch 'core/speculation' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
Pull in the command line updates from the tip tree so the MDS parts can be
added.
Diffstat (limited to 'include/linux/cpu.h')
-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 3c87ad888ed3..57ae83c4d5f4 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -189,4 +189,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_ */ |