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.
Unified · Split
| @@ -2514,7 +2514,7 @@ · 2513 unmodified lines | |||
| 2514 | http://repo.or.cz/w/linux-2.6/mini2440.git | 2514 | http://repo.or.cz/w/linux-2.6/mini2440.git |
| 2515 | 2515 | ||
| 2516 | mitigations= | 2516 | mitigations= |
| 2517 | [X86,PPC] Control optional mitigations for CPU | 2517 | [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 an | 2519 | 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] |
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // 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 | ||
| 6 | static int __init nobp_setup_early(char *str) | 7 | static int __init nobp_setup_early(char *str) |
| @@ -58,7 +59,7 @@ early_param("nospectre_v2", nospectre_v2_setup_early); · 51 unmodified lines | |||
| 58 | 59 | ||
| 59 | void __init nospec_auto_detect(void) | 60 | void __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. |