diff options
author | Linus Torvalds | 2019-05-06 22:01:16 +0200 |
---|---|---|
committer | Linus Torvalds | 2019-05-06 22:01:16 +0200 |
commit | 0a499fc5c37e6db096969a83534fd98a2bf2b36c (patch) | |
tree | 682875f57706b1e28bfe579372a465bd778ce3dc /kernel/cpu.c | |
parent | Merge branch 'core-rseq-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
parent | s390/speculation: Support 'mitigations=' cmdline option (diff) | |
download | kernel-qcow2-linux-0a499fc5c37e6db096969a83534fd98a2bf2b36c.tar.gz kernel-qcow2-linux-0a499fc5c37e6db096969a83534fd98a2bf2b36c.tar.xz kernel-qcow2-linux-0a499fc5c37e6db096969a83534fd98a2bf2b36c.zip |
Merge branch 'core-speculation-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull speculation mitigation update from Ingo Molnar:
"This adds the "mitigations=" bootline option, which offers a
cross-arch set of options that will work on x86, PowerPC and s390 that
will map to the arch specific option internally"
* 'core-speculation-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
s390/speculation: Support 'mitigations=' cmdline option
powerpc/speculation: Support 'mitigations=' cmdline option
x86/speculation: Support 'mitigations=' cmdline option
cpu/speculation: Add 'mitigations=' cmdline option
Diffstat (limited to 'kernel/cpu.c')
-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); |