From patchwork Tue May 30 14:05:57 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: 13260157 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 18A51C77B73 for ; Tue, 30 May 2023 14:07:30 +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=Svi/XvEjUqJ9EGNKa6imy5lTrPkGiHbgmOxGXlhmOGU=; b=W1yTvRyjMToJ8s P7mgiXFYfLCr4l4sSJn4i3vXBcxYH2Up19HPVqBAiQGT+l9Actj478GBq/aGTPypgB0aJhsj43A7Q unudoIklvRx59FIvJJN3u63RJVf3pYmG47QRMsdtdGoIh7Mkmcm/2LtOeKeE4JexFkPsbxdJwEHXO vhN5itOCJo2FkSdoZCcQMGIw3wgjsQ5LP8WVHWFRRj33CkGSDpU95Qs/hjZRJlH6IZidGhcB+ZFWu ceQG0mz0clY697tNg23Qx9XnS0qCIASw0bXhpb4mBvjIW7zSreyFPTXDKaMTOc5pFvixaEV07HBvT wS6QXoyhHEs260AWxJhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q400C-00EAJl-0O; Tue, 30 May 2023 14:07:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3zz5-00E9ga-02 for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2023 14:06:00 +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=OfjrN2mAxyr/FD8uaYqIzLo8HjYikj9c1IOeRy2rdnM=; b=k7VHRF2fVnIQdmm1SN3wDo45Ci jdCwnzNmejTs9iyU2AB+hxqJ8UcV2dXOBDmrQxxoWkjDWLPY0zPXXMKt98lp9bCDml+/JCQIW0YRe alV+MH+UXZxil2+ZuCu2yil7Aip+5FYDHCUc7toTol7xgXL1w2N0JD7fM1eHIaL3L92dC3lEoS/Gi VRkUb9WF1ag6b7gGkb3EZfxZFLI5SXrvvkVv9kZO+F7gib6jxB1Sza3LDjCCgfZrrLcP0+ZVyyvif Hx04qEXBNPj0aWSx6J5/MclbsBlsCWrJb29RJKtIFGIvAqr5WjWfTKiPnfpwNhAz9QUMqA4k9hojo 6GzN3r3Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35060 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.94.2) (envelope-from ) id 1q3zz3-0002t9-Ip; Tue, 30 May 2023 15:05:57 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q3zz3-00A5M8-0M; Tue, 30 May 2023 15:05:57 +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 RFC 17/17] arm64: text replication: add Kconfig MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 30 May 2023 15:05:57 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_070559_048489_ABB992E9 X-CRM114-Status: GOOD ( 12.17 ) 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 b1201d25a8a4..e1120841e26e 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -159,7 +159,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) @@ -1400,6 +1400,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 @@ -2167,6 +2174,7 @@ config RELOCATABLE config RANDOMIZE_BASE bool "Randomize the address of the kernel image" + depends on !REPLICATE_KTEXT select ARM64_MODULE_PLTS if MODULES select RELOCATABLE help