From patchwork Thu Jul 27 15:30:15 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: 13330296 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 195B2C001E0 for ; Thu, 27 Jul 2023 15:30: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=xKLw/FHXaEyvJFLKRDrV4MELJ3U+EDW77wg4FbO5Y4Q=; b=dqLujLpTZKarf5 4rAjoLs9c6k8fJqKZjyPE9qgqbTfdxMvpO3b2EiMntJ03k//GkjYkl0FiPLmDVxvYRbUpJE/WvZRD S1X/Lge5Va9eYXL8wpBXGOJeEEeH9/nOTPR2v8J8T280tJ5p1bNVaOk6OfJmyVCG/5gSiF162A2UA 2VMWO0CIkmJe+pI/CYAcN+P3e6eYEDWGMfnIC2aqEH8fCsH+cDG3kEDl76uiUwvqjG1ICRiNIVX42 hvsg22DsVGGuM2F7apsiqeyFlfb2X9wUeq5HHAE3Kci9mNuXSj9pXLV5kFoYjmy0bU49BDBnEQCh2 gHZqoz0voR88bZupeCEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP2wb-00FuPk-19; Thu, 27 Jul 2023 15:30:25 +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 1qP2wV-00FuJC-04 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 15:30: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=0W65xWM7Ob4dljZQ3ePDRFaG7Y0QsYhjSpbvt2L/B28=; b=a9ntwDIYuJlV5/RFq2KFwonAZ6 CNjzyu/7oJYgMvb/e49MK+k3UYihAZuRj/T1S5+YfAKbvcTZevMbbU4HreCpOlEbE06jAGtLvZ+hs CBisprgeaXHLt0PjocTpo4YTkfhiASSDmbLaOPvv769n2Zq0IoRdxJQE0BJNRkuMKrQiMiuTjPq9V DzC4PDZVCUh0Lturn3xTm7sLTIYn9d9jtoUbH7I7NkEl4pGYEi5VeRZfP3TmKnmfH8ENJO/x3BNi8 yictd2h0ORdUN7G9UxHWNeDugUP8z6rWxLr/LSNYRXoydCv7IfWvg2nwQG4E8S005Hf/a2hpr3g3u x3fBBYfA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:49430 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 1qP2wR-00062l-2E; Thu, 27 Jul 2023 16:30:15 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qP2wR-001CXE-Ro; Thu, 27 Jul 2023 16:30:15 +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 04/16] arm64: text replication: add init function MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 27 Jul 2023 16:30:15 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_083019_064549_4111A367 X-CRM114-Status: GOOD ( 15.55 ) 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 A simple patch that adds an empty function for kernel text replication initialisation and hooks it into the initialisation path. Signed-off-by: Russell King (Oracle) --- arch/arm64/include/asm/ktext.h | 20 ++++++++++++++++++++ arch/arm64/mm/Makefile | 2 ++ arch/arm64/mm/init.c | 3 +++ arch/arm64/mm/ktext.c | 8 ++++++++ 4 files changed, 33 insertions(+) create mode 100644 arch/arm64/include/asm/ktext.h create mode 100644 arch/arm64/mm/ktext.c diff --git a/arch/arm64/include/asm/ktext.h b/arch/arm64/include/asm/ktext.h new file mode 100644 index 000000000000..1a5f7452a3bf --- /dev/null +++ b/arch/arm64/include/asm/ktext.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2022, Oracle and/or its affiliates. + */ +#ifndef ASM_KTEXT_H +#define ASM_KTEXT_H + +#ifdef CONFIG_REPLICATE_KTEXT + +void ktext_replication_init(void); + +#else + +static inline void ktext_replication_init(void) +{ +} + +#endif + +#endif diff --git a/arch/arm64/mm/Makefile b/arch/arm64/mm/Makefile index dbd1bc95967d..41e705027c57 100644 --- a/arch/arm64/mm/Makefile +++ b/arch/arm64/mm/Makefile @@ -14,3 +14,5 @@ KASAN_SANITIZE_physaddr.o += n obj-$(CONFIG_KASAN) += kasan_init.o KASAN_SANITIZE_kasan_init.o := n + +obj-$(CONFIG_REPLICATE_KTEXT) += ktext.o diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d31c3a9290c5..df90738fd6bb 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -425,6 +426,8 @@ void __init bootmem_init(void) arch_numa_init(); + ktext_replication_init(); + /* * must be done after arch_numa_init() which calls numa_init() to * initialize node_online_map that gets used in hugetlb_cma_reserve() diff --git a/arch/arm64/mm/ktext.c b/arch/arm64/mm/ktext.c new file mode 100644 index 000000000000..3a8d37c9abc4 --- /dev/null +++ b/arch/arm64/mm/ktext.c @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2022, Oracle and/or its affiliates. + */ + +void __init ktext_replication_init(void) +{ +}