Commit 1fd6c022 authored by Michael Ellerman's avatar Michael Ellerman

powerpc/mm: Add a CONFIG option to choose if radix is used by default

Currently if the hardware supports the radix MMU we will use
it, *unless* "disable_radix" is passed on the kernel command line.

However some users would like the reverse semantics. ie. The kernel
uses the hash MMU by default, unless radix is explicitly requested on
the command line.

So add a CONFIG option to choose whether we use radix by default or
not, and expand the disable_radix command line option to allow
"disable_radix=no" which *enables* radix.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 4e003747
...@@ -368,10 +368,19 @@ EXPORT_SYMBOL_GPL(realmode_pfn_to_page); ...@@ -368,10 +368,19 @@ EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
#endif /* CONFIG_SPARSEMEM_VMEMMAP */ #endif /* CONFIG_SPARSEMEM_VMEMMAP */
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
static bool disable_radix; static bool disable_radix = !IS_ENABLED(CONFIG_PPC_RADIX_MMU_DEFAULT);
static int __init parse_disable_radix(char *p) static int __init parse_disable_radix(char *p)
{ {
disable_radix = true; bool val;
if (strlen(p) == 0)
val = true;
else if (kstrtobool(p, &val))
return -EINVAL;
disable_radix = val;
return 0; return 0;
} }
early_param("disable_radix", parse_disable_radix); early_param("disable_radix", parse_disable_radix);
......
...@@ -304,6 +304,19 @@ config PPC_RADIX_MMU ...@@ -304,6 +304,19 @@ config PPC_RADIX_MMU
is only implemented by IBM Power9 CPUs, if you don't have one of them is only implemented by IBM Power9 CPUs, if you don't have one of them
you can probably disable this. you can probably disable this.
config PPC_RADIX_MMU_DEFAULT
bool "Default to using the Radix MMU when possible"
depends on PPC_RADIX_MMU
default y
help
When the hardware supports the Radix MMU, default to using it unless
"disable_radix[=yes]" is specified on the kernel command line.
If this option is disabled, the Hash MMU will be used by default,
unless "disable_radix=no" is specified on the kernel command line.
If you're unsure, say Y.
config ARCH_ENABLE_HUGEPAGE_MIGRATION config ARCH_ENABLE_HUGEPAGE_MIGRATION
def_bool y def_bool y
depends on PPC_BOOK3S_64 && HUGETLB_PAGE && MIGRATION depends on PPC_BOOK3S_64 && HUGETLB_PAGE && MIGRATION
......
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