summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-04-05 11:41:41 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-10-11 18:15:51 +0100
commitc57d63b4afc98b3986b044324b4a44a3744ee94e (patch)
treecf812c02c94bb77821ecf9be7d5ce715e2b821c8
parenta636403b8228526061a73a46b2a89e2ce8f683e3 (diff)
arm64: text replication: add Kconfig for default state
Add a kernel configuration option to determine whether kernel text replication should default to being enabled or disabled at boot without a command line specifier. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm64/Kconfig7
-rw-r--r--arch/arm64/mm/ktext.c11
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 43b0af01ff04..9d7f0393ce97 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1435,6 +1435,13 @@ config REPLICATE_KTEXT
Say Y here to enable replicating the kernel text across multiple
nodes in a NUMA cluster. This trades memory for speed.
+config REPLICATE_KTEXT_DEFAULT
+ bool "Enable kernel text replication by default"
+ depends on REPLICATE_KTEXT
+ help
+ Determine whether kernel text replication is enabled at boot by
+ default.
+
source "kernel/Kconfig.hz"
config ARCH_SPARSEMEM_ENABLE
diff --git a/arch/arm64/mm/ktext.c b/arch/arm64/mm/ktext.c
index f55bfe29ad28..4ab04f531c81 100644
--- a/arch/arm64/mm/ktext.c
+++ b/arch/arm64/mm/ktext.c
@@ -119,18 +119,11 @@ void ktext_replication_patch_alternative(__le32 *src, int nr_inst)
}
}
-static bool ktext_enabled;
+static bool ktext_enabled = IS_ENABLED(CONFIG_REPLICATE_KTEXT_DEFAULT);
static int __init parse_ktext(char *str)
{
- bool enabled;
- int ret = strtobool(str, &enabled);
-
- if (ret)
- return ret;
-
- ktext_enabled = enabled;
- return 0;
+ return strtobool(str, &ktext_enabled);
}
early_param("ktext", parse_ktext);