Commit 2d8d8a24 authored by Michael Ellerman's avatar Michael Ellerman Committed by Marcelo Henrique Cerri

UBUNTU: SAUCE: rfi-flush: Add no_rfi_flush and nopti comandline options

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772

We use the x86 'nopti' option because all the documenation on earth is
going to refer to that, and we can guess what users mean when they
specify that - they want to avoid any overhead due to Meltdown
mitigations.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
parent d275a2d6
...@@ -838,8 +838,29 @@ early_initcall(disable_hardlockup_detector); ...@@ -838,8 +838,29 @@ early_initcall(disable_hardlockup_detector);
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
static enum l1d_flush_type enabled_flush_types; static enum l1d_flush_type enabled_flush_types;
static void *l1d_flush_fallback_area; static void *l1d_flush_fallback_area;
static bool no_rfi_flush;
bool rfi_flush; bool rfi_flush;
static int __init handle_no_rfi_flush(char *p)
{
pr_info("rfi-flush: disabled on command line.");
no_rfi_flush = true;
return 0;
}
early_param("no_rfi_flush", handle_no_rfi_flush);
/*
* The RFI flush is not KPTI, but because users will see doco that says to use
* nopti we hijack that option here to also disable the RFI flush.
*/
static int __init handle_no_pti(char *p)
{
pr_info("rfi-flush: disabling due to 'nopti' on command line.\n");
handle_no_rfi_flush(NULL);
return 0;
}
early_param("nopti", handle_no_pti);
static void do_nothing(void *unused) static void do_nothing(void *unused)
{ {
/* /*
...@@ -905,6 +926,8 @@ void __init setup_rfi_flush(enum l1d_flush_type types, bool enable) ...@@ -905,6 +926,8 @@ void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
pr_info("rfi-fixups: Using mttrig type flush\n"); pr_info("rfi-fixups: Using mttrig type flush\n");
enabled_flush_types = types; enabled_flush_types = types;
rfi_flush_enable(enable);
if (!no_rfi_flush)
rfi_flush_enable(enable);
} }
#endif /* CONFIG_PPC_BOOK3S_64 */ #endif /* CONFIG_PPC_BOOK3S_64 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment