History

s390/speculation: Support 'mitigations=' cmdline option

Configure s390 runtime CPU speculation bug mitigations in accordance with the 'mitigations=' cmdline option. This affects Spectre v1 and Spectre v2. The default behavior is unchanged.

Josh Poimboeuf committed 7 years ago

Commit 0336e041 parent 782e69e2 files · +5 −3Browse files

Unified · Split

2 files
  1. Documentation/admin-guide/kernel-parameters.txt +3 −2
  2. arch/s390/kernel/nospec-branch.c +2 −1
Documentation/admin-guide/kernel-parameters.txt+3−2
@@ -2514,7 +2514,7 @@ · 2513 unmodified lines
25142514 http://repo.or.cz/w/linux-2.6/mini2440.git
25152515
25162516 mitigations=
2517− [X86,PPC] Control optional mitigations for CPU
2517+ [X86,PPC,S390] Control optional mitigations for CPU
25182518 vulnerabilities. This is a set of curated,
25192519 arch-independent options, each of which is an
25202520 aggregation of existing arch-specific options.
@@ -2525,7 +2525,8 @@ · 4 unmodified lines
25252525 expose users to several CPU vulnerabilities.
25262526 Equivalent to: nopti [X86,PPC]
25272527 nospectre_v1 [PPC]
2528− nospectre_v2 [X86,PPC]
2528+ nobp=0 [S390]
2529+ nospectre_v2 [X86,PPC,S390]
25292530 spectre_v2_user=off [X86]
25302531 spec_store_bypass_disable=off [X86,PPC]
25312532 l1tf=off [X86]
arch/s390/kernel/nospec-branch.c+2−1
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/module.h>
33 #include <linux/device.h>
4+#include <linux/cpu.h>
45 #include <asm/nospec-branch.h>
56
67 static int __init nobp_setup_early(char *str)
@@ -58,7 +59,7 @@ early_param("nospectre_v2", nospectre_v2_setup_early); · 51 unmodified lines
5859
5960 void __init nospec_auto_detect(void)
6061 {
61− if (test_facility(156)) {
62+ if (test_facility(156) || cpu_mitigations_off()) {
6263 /*
6364 * The machine supports etokens.
6465 * Disable expolines and disable nobp.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t