diff options
author | Will Deacon <will.deacon@arm.com> | 2019-04-26 13:32:20 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-04-26 13:32:20 +0100 |
commit | cbafee55b5a0ec47baac622bce6b4d19afe45576 (patch) | |
tree | 714c9c15ac2c507e7e3789bd20d95c62aa11ae99 /kernel | |
parent | 79a3aaa7b82e3106be97842dedfd8429248896e6 (diff) | |
parent | 0336e04a6520bdaefdb0769d2a70084fa52e81ed (diff) |
Merge branch 'core/speculation' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into for-next/mitigations
Pull in core support for the "mitigations=" cmdline option from Thomas
Gleixner via -tip, which we can build on top of when we expose our
mitigation state via sysfs.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpu.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 6754f3ecfd94..43e741e88691 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2304,3 +2304,18 @@ void __init boot_cpu_hotplug_init(void) #endif this_cpu_write(cpuhp_state.state, CPUHP_ONLINE); } + +enum cpu_mitigations cpu_mitigations __ro_after_init = CPU_MITIGATIONS_AUTO; + +static int __init mitigations_parse_cmdline(char *arg) +{ + if (!strcmp(arg, "off")) + cpu_mitigations = CPU_MITIGATIONS_OFF; + else if (!strcmp(arg, "auto")) + cpu_mitigations = CPU_MITIGATIONS_AUTO; + else if (!strcmp(arg, "auto,nosmt")) + cpu_mitigations = CPU_MITIGATIONS_AUTO_NOSMT; + + return 0; +} +early_param("mitigations", mitigations_parse_cmdline); |