diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/nospec-branch.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/s390/kernel/nospec-branch.c b/arch/s390/kernel/nospec-branch.c index d5eed651b5ab..83e597688562 100644 --- a/arch/s390/kernel/nospec-branch.c +++ b/arch/s390/kernel/nospec-branch.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/module.h> #include <linux/device.h> +#include <linux/cpu.h> #include <asm/facility.h> #include <asm/nospec-branch.h> @@ -55,8 +56,16 @@ static int __init nospectre_v2_setup_early(char *str) } early_param("nospectre_v2", nospectre_v2_setup_early); + void __init nospec_auto_detect(void) { + if (cpu_mitigations_off()) { + /* + * Disable expolines and disable nobp. + */ + if (IS_ENABLED(CC_USING_EXPOLINE)) + nospec_disable = 1; + __clear_facility(82, S390_lowcore.alt_stfle_fac_list); if (IS_ENABLED(CC_USING_EXPOLINE)) { /* * The kernel has been compiled with expolines. |