|
@@ -2,6 +2,31 @@
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <asm/nospec-branch.h>
|
|
#include <asm/nospec-branch.h>
|
|
|
|
|
|
|
|
+static int __init nobp_setup_early(char *str)
|
|
|
|
+{
|
|
|
|
+ bool enabled;
|
|
|
|
+ int rc;
|
|
|
|
+
|
|
|
|
+ rc = kstrtobool(str, &enabled);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
|
|
|
+ if (enabled && test_facility(82))
|
|
|
|
+ __set_facility(82, S390_lowcore.alt_stfle_fac_list);
|
|
|
|
+ else
|
|
|
|
+ __clear_facility(82, S390_lowcore.alt_stfle_fac_list);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+early_param("nobp", nobp_setup_early);
|
|
|
|
+
|
|
|
|
+static int __init nospec_setup_early(char *str)
|
|
|
|
+{
|
|
|
|
+ __clear_facility(82, S390_lowcore.alt_stfle_fac_list);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+early_param("nospec", nospec_setup_early);
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_EXPOLINE
|
|
|
|
+
|
|
int nospec_call_disable = IS_ENABLED(CONFIG_EXPOLINE_OFF);
|
|
int nospec_call_disable = IS_ENABLED(CONFIG_EXPOLINE_OFF);
|
|
int nospec_return_disable = !IS_ENABLED(CONFIG_EXPOLINE_FULL);
|
|
int nospec_return_disable = !IS_ENABLED(CONFIG_EXPOLINE_FULL);
|
|
|
|
|
|
@@ -98,3 +123,5 @@ void __init nospec_init_branches(void)
|
|
nospec_call_revert(__nospec_call_start, __nospec_call_end);
|
|
nospec_call_revert(__nospec_call_start, __nospec_call_end);
|
|
nospec_return_revert(__nospec_return_start, __nospec_return_end);
|
|
nospec_return_revert(__nospec_return_start, __nospec_return_end);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+#endif /* CONFIG_EXPOLINE */
|