All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Jonathan Corbet <corbet@lwn.net>, Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org
Subject: [PATCH v2 16/16] arm64: text replication: add Kconfig
Date: Thu, 27 Jul 2023 16:31:17 +0100	[thread overview]
Message-ID: <E1qP2xR-001CYS-Ti@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZMKNYEkM7YnrDtOt@shell.armlinux.org.uk>

Add the Kconfig symbol for kernel text replication. This unfortunately
requires KASAN and kernel text randomisation options to be disabled at
the moment.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 arch/arm64/Kconfig | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7856c3a3e35a..53143324c392 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -160,7 +160,7 @@ config ARM64
 	select HAVE_ARCH_HUGE_VMAP
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_JUMP_LABEL_RELATIVE
-	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
+	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48 && !REPLICATE_KTEXT)
 	select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
 	select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
 	select HAVE_ARCH_KASAN_HW_TAGS if (HAVE_ARCH_KASAN && ARM64_MTE)
@@ -1426,6 +1426,13 @@ config NODES_SHIFT
 	  Specify the maximum number of NUMA Nodes available on the target
 	  system.  Increases memory reserved to accommodate various tables.
 
+config REPLICATE_KTEXT
+	bool "Replicate kernel text across numa nodes"
+	depends on NUMA
+	help
+	  Say Y here to enable replicating the kernel text across multiple
+	  nodes in a NUMA cluster.  This trades memory for speed.
+
 source "kernel/Kconfig.hz"
 
 config ARCH_SPARSEMEM_ENABLE
@@ -2173,6 +2180,7 @@ config RELOCATABLE
 
 config RANDOMIZE_BASE
 	bool "Randomize the address of the kernel image"
+	depends on !REPLICATE_KTEXT
 	select RELOCATABLE
 	help
 	  Randomizes the virtual address at which the kernel image is
-- 
2.30.2


WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Jonathan Corbet <corbet@lwn.net>, Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org
Subject: [PATCH v2 16/16] arm64: text replication: add Kconfig
Date: Thu, 27 Jul 2023 16:31:17 +0100	[thread overview]
Message-ID: <E1qP2xR-001CYS-Ti@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZMKNYEkM7YnrDtOt@shell.armlinux.org.uk>

Add the Kconfig symbol for kernel text replication. This unfortunately
requires KASAN and kernel text randomisation options to be disabled at
the moment.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 arch/arm64/Kconfig | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7856c3a3e35a..53143324c392 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -160,7 +160,7 @@ config ARM64
 	select HAVE_ARCH_HUGE_VMAP
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_JUMP_LABEL_RELATIVE
-	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
+	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48 && !REPLICATE_KTEXT)
 	select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
 	select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
 	select HAVE_ARCH_KASAN_HW_TAGS if (HAVE_ARCH_KASAN && ARM64_MTE)
@@ -1426,6 +1426,13 @@ config NODES_SHIFT
 	  Specify the maximum number of NUMA Nodes available on the target
 	  system.  Increases memory reserved to accommodate various tables.
 
+config REPLICATE_KTEXT
+	bool "Replicate kernel text across numa nodes"
+	depends on NUMA
+	help
+	  Say Y here to enable replicating the kernel text across multiple
+	  nodes in a NUMA cluster.  This trades memory for speed.
+
 source "kernel/Kconfig.hz"
 
 config ARCH_SPARSEMEM_ENABLE
@@ -2173,6 +2180,7 @@ config RELOCATABLE
 
 config RANDOMIZE_BASE
 	bool "Randomize the address of the kernel image"
+	depends on !REPLICATE_KTEXT
 	select RELOCATABLE
 	help
 	  Randomizes the virtual address at which the kernel image is
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-07-27 15:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 15:29 [PATCH v2 00/17] arm64 kernel text replication Russell King (Oracle)
2023-07-27 15:29 ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 01/16] arm64: provide cpu_replace_ttbr1_phys() Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 02/16] arm64: make clean_dcache_range_nopatch() visible Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 03/16] arm64: place kernel in its own L0 page table entry Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 04/16] arm64: text replication: add init function Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 05/16] arm64: text replication: add sanity checks Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 06/16] arm64: text replication: copy initial kernel text Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 07/16] arm64: text replication: add node text patching Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 08/16] arm64: text replication: add node 0 page table definitions Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 09/16] arm64: text replication: add swapper page directory helpers Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 10/16] arm64: text replication: create per-node kernel page tables Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 11/16] arm64: text replication: boot secondary CPUs with appropriate TTBR1 Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:30 ` [PATCH v2 12/16] arm64: text replication: update cnp support Russell King (Oracle)
2023-07-27 15:30   ` Russell King (Oracle)
2023-07-27 15:31 ` [PATCH v2 13/16] arm64: text replication: setup page tables for copied kernel Russell King (Oracle)
2023-07-27 15:31   ` Russell King (Oracle)
2023-07-27 15:31 ` [PATCH v2 14/16] arm64: text replication: include most of read-only data as well Russell King (Oracle)
2023-07-27 15:31   ` Russell King (Oracle)
2023-07-27 15:31 ` [PATCH v2 15/16] arm64: text replication: early kernel option to enable replication Russell King (Oracle)
2023-07-27 15:31   ` Russell King (Oracle)
2023-07-27 15:31 ` Russell King (Oracle) [this message]
2023-07-27 15:31   ` [PATCH v2 16/16] arm64: text replication: add Kconfig Russell King (Oracle)
2023-07-27 15:36   ` Randy Dunlap
2023-07-27 15:36     ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1qP2xR-001CYS-Ti@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.