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
2514 http://repo.or.cz/w/linux-2.6/mini2440.git2514 http://repo.or.cz/w/linux-2.6/mini2440.git
2515 2515
2516 mitigations=2516 mitigations=
2517 [X86,PPC] Control optional mitigations for CPU2517 [X86,PPC,S390] Control optional mitigations for CPU
2518 vulnerabilities. This is a set of curated,2518 vulnerabilities. This is a set of curated,
2519 arch-independent options, each of which is an2519 arch-independent options, each of which is an
2520 aggregation of existing arch-specific options.2520 aggregation of existing arch-specific options.
@@ -2525,7 +2525,8 @@ · 4 unmodified lines
2525 expose users to several CPU vulnerabilities.2525 expose users to several CPU vulnerabilities.
2526 Equivalent to: nopti [X86,PPC]2526 Equivalent to: nopti [X86,PPC]
2527 nospectre_v1 [PPC]2527 nospectre_v1 [PPC]
2528 nospectre_v2 [X86,PPC]2528 nobp=0 [S390]
2529 nospectre_v2 [X86,PPC,S390]
2529 spectre_v2_user=off [X86]2530 spectre_v2_user=off [X86]
2530 spec_store_bypass_disable=off [X86,PPC]2531 spec_store_bypass_disable=off [X86,PPC]
2531 l1tf=off [X86]2532 l1tf=off [X86]
arch/s390/kernel/nospec-branch.c+2−1
@@ -1,6 +1,7 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#include <linux/module.h>2#include <linux/module.h>
3#include <linux/device.h>3#include <linux/device.h>
4#include <linux/cpu.h>
4#include <asm/nospec-branch.h>5#include <asm/nospec-branch.h>
5 6
6static int __init nobp_setup_early(char *str)7static int __init nobp_setup_early(char *str)
@@ -58,7 +59,7 @@ early_param("nospectre_v2", nospectre_v2_setup_early); · 51 unmodified lines
58 59
59void __init nospec_auto_detect(void)60void __init nospec_auto_detect(void)
60{61{
61 if (test_facility(156)) {62 if (test_facility(156) || cpu_mitigations_off()) {
62 /*63 /*
63 * The machine supports etokens.64 * The machine supports etokens.
64 * Disable expolines and disable nobp.65 * 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