diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-04-05 11:41:41 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-10-30 12:56:13 +0000 |
commit | 9ccc4b641f545790622f8fe2423989db463cdae8 (patch) | |
tree | 5b7a8c7bf38d6198f825207be9b5ec00cbcb503e | |
parent | ee65bfafd7096be61e4889bb3e6f4eb26bb1d740 (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/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm64/mm/ktext.c | 11 |
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 8848c0c86d44..82b10e9e72a8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1447,6 +1447,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); |