diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-04-27 07:36:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-29 11:33:15 +0200 |
commit | 68cb884e12288cdbc044895affd528ceb98a815b (patch) | |
tree | 0c9155d3e432c4451f2722d98352dc1be993d385 | |
parent | 719b84c9aec27953da3da75838f50fd89ea950a2 (diff) | |
download | linux-stable-68cb884e12288cdbc044895affd528ceb98a815b.tar.gz linux-stable-68cb884e12288cdbc044895affd528ceb98a815b.tar.bz2 linux-stable-68cb884e12288cdbc044895affd528ceb98a815b.zip |
s390: report spectre mitigation via syslog
[ Upstream commit bc035599718412cfba9249aa713f90ef13f13ee9 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 daa36a38a8b7..7387ebace891 100644 --- a/arch/s390/kernel/nospec-branch.c +++ b/arch/s390/kernel/nospec-branch.c @@ -33,6 +33,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); |