aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/setup_64.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 96163f4c3673..491be4179ddd 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -805,8 +805,29 @@ early_initcall(disable_hardlockup_detector);
805#ifdef CONFIG_PPC_BOOK3S_64 805#ifdef CONFIG_PPC_BOOK3S_64
806static enum l1d_flush_type enabled_flush_types; 806static enum l1d_flush_type enabled_flush_types;
807static void *l1d_flush_fallback_area; 807static void *l1d_flush_fallback_area;
808static bool no_rfi_flush;
808bool rfi_flush; 809bool rfi_flush;
809 810
811static int __init handle_no_rfi_flush(char *p)
812{
813 pr_info("rfi-flush: disabled on command line.");
814 no_rfi_flush = true;
815 return 0;
816}
817early_param("no_rfi_flush", handle_no_rfi_flush);
818
819/*
820 * The RFI flush is not KPTI, but because users will see doco that says to use
821 * nopti we hijack that option here to also disable the RFI flush.
822 */
823static int __init handle_no_pti(char *p)
824{
825 pr_info("rfi-flush: disabling due to 'nopti' on command line.\n");
826 handle_no_rfi_flush(NULL);
827 return 0;
828}
829early_param("nopti", handle_no_pti);
830
810static void do_nothing(void *unused) 831static void do_nothing(void *unused)
811{ 832{
812 /* 833 /*
@@ -877,6 +898,7 @@ void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
877 898
878 enabled_flush_types = types; 899 enabled_flush_types = types;
879 900
880 rfi_flush_enable(enable); 901 if (!no_rfi_flush)
902 rfi_flush_enable(enable);
881} 903}
882#endif /* CONFIG_PPC_BOOK3S_64 */ 904#endif /* CONFIG_PPC_BOOK3S_64 */