diff options
author | Martin Schwidefsky | 2018-03-20 16:33:43 +0100 |
---|---|---|
committer | Martin Schwidefsky | 2018-03-28 08:38:25 +0200 |
commit | bc035599718412cfba9249aa713f90ef13f13ee9 (patch) | |
tree | bc2927c397cf3515ace21876a1e829100e67eb90 /arch/s390 | |
parent | 6e179d64126b909f0b288fa63cdbf07c531e9b1d (diff) |
s390: report spectre mitigation via syslog
Add a boot message if either of the spectre defenses is active.
The message is
"Spectre V2 mitigation: execute trampolines."
or "Spectre V2 mitigation: limited branch prediction."
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/nospec-branch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/s390/kernel/nospec-branch.c b/arch/s390/kernel/nospec-branch.c index 192e633a79d8..adec38c5f53b 100644 --- a/arch/s390/kernel/nospec-branch.c +++ b/arch/s390/kernel/nospec-branch.c @@ -32,6 +32,16 @@ static int __init nospec_setup_early(char *str) } early_param("nospec", nospec_setup_early); +static int __init nospec_report(void) +{ + if (IS_ENABLED(CC_USING_EXPOLINE) && !nospec_disable) + pr_info("Spectre V2 mitigation: execute trampolines.\n"); + if (__test_facility(82, S390_lowcore.alt_stfle_fac_list)) + pr_info("Spectre V2 mitigation: limited branch prediction.\n"); + return 0; +} +arch_initcall(nospec_report); + #ifdef CONFIG_EXPOLINE int nospec_disable = IS_ENABLED(CONFIG_EXPOLINE_OFF); |