From patchwork Thu Jul 27 15:31:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13330310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37707C001DC for ; Thu, 27 Jul 2023 15:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ijdLL4Y8qfgTuiEVA6R9OFwwRQO0/g+xEMYv7U8vqM8=; b=3xyWU4DtTk0b1K BgGUdsCXg21Lr6Kgg2rP49zf2gaL5sr0CI9PNqXjqZ3QmDlK2ohfdtcPRIgsAjiBLlVwR+TX/QRAp nZgJekYvXOBuLcnUZBMi9Zb1GVS8nCXVxx0cIVew4MeNe9uo5HSPIworMUI1budoPIi4veiT+f/3O +RD9qeX/s285g8pMunQuMBH7NYCtJQuQmsRhHyAzPxrdPWH2lrDfBwhku8+7QWB9cIr3OB0zYAl7u LrlVIik2NRSaFjAR/ohHwV2wYDqTzHSvLS2fPhXx0+rLU3riXSQPklGwNS55okzoVfaQIhYpwHojV Zmf1AdO2c41a/1BaRUnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP2yZ-00FwAc-1w; Thu, 27 Jul 2023 15:32:28 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP2xT-00FvBS-1o for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 15:31:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=O8C+AYuO0MXUP+rSaG3vZziyS5K9WEK8DFQRI0HoQTM=; b=QpNqHg33/nSRYUppQOova0LMuW y5Y/SAexjVbIBofZdKr9YlJVhmIfWHc9qFk2ymCGCtCuuPSDAPb98qON9aLA4LDBXiEmoEjc8lH2G jU8UWvrHzVjpkF93e8h127BcTIu2wR8C6duoyN/2uh9hZFQQiDZeyMhBqx89R8qzYrBK7UoOW0aLa MFoDfEdqsxqjShNm/9F5gDQIW+2n1M1attR0h5h5puiGaFA0ngx0pB8gpuE7nmftFdmfGIZtEvSK7 gIQR0E82idk55OaCnlAVqUjsgcqewidj/hVjVCpHQZo+8L7pwC+b9Z3D5GnPi9RBJ6cPFO+lE8I+z FzA6uI1A==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:40264 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qP2xR-00065U-2R; Thu, 27 Jul 2023 16:31:17 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qP2xR-001CYS-Ti; Thu, 27 Jul 2023 16:31:17 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Catalin Marinas , Jonathan Corbet , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: [PATCH v2 16/16] arm64: text replication: add Kconfig MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 27 Jul 2023 16:31:17 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_083119_619477_F70BCC5B X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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) --- 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