From patchwork Thu Aug 1 06:08:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13749748 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 892BAC3DA4A for ; Thu, 1 Aug 2024 06:11:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CC6F6B00AE; Thu, 1 Aug 2024 02:11:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1558B6B00B0; Thu, 1 Aug 2024 02:11:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEB7F6B00B1; Thu, 1 Aug 2024 02:11:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C9F956B00AE for ; Thu, 1 Aug 2024 02:11:45 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 8BA9E1C3192 for ; Thu, 1 Aug 2024 06:11:45 +0000 (UTC) X-FDA: 82402655370.14.EB26CB6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id D8F7B1C0005 for ; Thu, 1 Aug 2024 06:11:43 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cc4WvpYS; spf=pass (imf18.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492675; a=rsa-sha256; cv=none; b=Fm4mqvKCZU3fztYNn3SH+y7/G56o1znqJSXDxZNMXos84lKJaL3sZqPv0LJBOEeNZEiB66 r/Rk6Yf/LK9yoP7qjX/yS5pjrea3KgzCXiURlJ7oB5s8VIoewbAerMoW1vrjsscmjieCkm JWJSl73GpkPMuwxi6xLYgtKby0LBCW0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cc4WvpYS; spf=pass (imf18.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722492675; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ldvHts8Cfvhr+UDdgvxO/yzMODWtjFIQBYUtdNuGiEw=; b=bCquCG4B73IH75Tli2CQVw4ueyCgBXBZYZ6ez+1ZD8eW574lTTXtijKryfShc2kcRlwIh6 i/pxIsBamUrk5m1YFdPhMasMu9Rg6dThSKs1tGm7c7HWzOnP9hvoJxXULcyITNcR9bl8A3 nceCSaeZIZb/QAInkRIvkUCj+9ZPjCc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 18C616263A; Thu, 1 Aug 2024 06:11:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83720C4AF09; Thu, 1 Aug 2024 06:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492702; bh=a5wWvXp5sZfTjfQzLNJ+a5bJ5ZJPXICMVCqsCnclVEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cc4WvpYSk2IgT7M8f19PtLCANZs9ejYsgNz/cO/n9jZN8qc0EaFo0hFRtACL2ndu9 6mQNevH4Cv97QgSeWny58SoJTelXG7+q/yupDHNjypMc9KfJSvH9dJkMYoPTVHXTFt qOV8qLNBVKP+KQ0TDEb4IxRQJnulZa3OTDwTCKv2ZaDrPMf/7n9eMwLrQ+9DBTKaQ2 CscX8zJ0BsTHTjThMBHjRi6ejLjZ0Khv97xgxfXs5HKaUT5vo9NA59YW7rniE33hCD LqVJKeLyrOjDdwbfYs2UANWDOREYQ7kpVO/8B3QyCKE+mrBu4NqR3hacT/uObjnyRS Fd/de2lMyOA4Q== From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Andreas Larsson , Andrew Morton , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dan Williams , Dave Hansen , David Hildenbrand , "David S. Miller" , Davidlohr Bueso , Greg Kroah-Hartman , Heiko Carstens , Huacai Chen , Ingo Molnar , Jiaxun Yang , John Paul Adrian Glaubitz , Jonathan Cameron , Jonathan Corbet , Michael Ellerman , Mike Rapoport , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Will Deacon , Zi Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, nvdimm@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org, Jonathan Cameron Subject: [PATCH v3 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN Date: Thu, 1 Aug 2024 09:08:15 +0300 Message-ID: <20240801060826.559858-16-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240801060826.559858-1-rppt@kernel.org> References: <20240801060826.559858-1-rppt@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 5x4g9f7d1jaadhencqakw3iwn7ywkgb6 X-Rspamd-Queue-Id: D8F7B1C0005 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722492703-910976 X-HE-Meta: U2FsdGVkX1/weeAL/GsJnXCsxKqz8rxPWVQbxnoDUkdWZD95FAtdZVfU+XywlWNbeFxqwhUqOO9wtWBcLZ5AgOLnTDUJT5tUXS71DBMruV0lh3vg7MNtlBxZTHiEdcMpju34RTEB1bRsajtCOu/0J4rdsxn3B0rih6jGN9tMZY7/+dfrg6Kxc4oFyonJRBjm6ik01yPoM0zx3CKUTTeSJMOFqgpWFdeQXsABR41JYAGXF26pDI9heC6DVZsOMHUkPL33ITinj5Lp4G4z4RSr+IU1jiJPby/6oPDTWrMdhLFx9jaH5xhwrHkqpnr40bmtsmaMiUytGVzeJXKCx0X/QwZWVSa9Ot8aNkCL7u+XmZe3+D2QWNCzKMLDqsz0500e5FJcE4jTaJsPOykF0WqKvXiJQeneTpRcnGJGj+KYL+3zDTlxN/ARCvkPCOuCGjkOu34icqgn2oPdSYnwldjvb72TQnQ7WBiwFNWxIzA5Qw64gntnQJ9KXEoUbS+WR8B2OJw3UFcgFe2nAhHbNgMmqz6R066GKwnvZTdPBXGqvNAM3c9uXYGkJVkbhHi3GUK20Z54vH1y2lwg0qf0Edxlo8b1Tb3mdDMF0OaAys/nu0mdivUcjbYkcTDvi50GNar3jSUlUnmjZ9NnhSubldKfSGWqCBqFRYA8AgKtvlOTIrPTWGo/fgrrmQNJuyCkJ4hiESwdJDkLY7xJ8BtdxEIjAzcVqGGWznK0iW9IuavXTWU4Rn5C/LHlJ18iuJcBDUXPiqRElY3rYaqStlqLfzdrXrrAo867jjgLdlSTCJ3UUlFhX4IdhvGb8V52wxCKMYa8jnZHrEu2m0EDr8aUlGKsEk2bcu872UhkKcpjqzkB9W54+Mt6u7KN9EKKrJls+v9v0vZeX6xZiHThjTbwI/gPKYeWbI8ILxmj7dofXT0ANQySfcMTsgrnIHDVCvLxa2I5PIQplDzs48AL+sRUUCI A0iAytQi JBEMOsGWXKkDAf0sOp9AZoSzehSpoAJGUjy8MYzZoADiQo88M3FleCkg+ZxCI6onnThL6J2K42gNoiaN2i/39R0CCd6DdWUTYXcA1ogiqtdZ3FxboHjg+I+QC87lDqkaJ/NtT5QHr7ZrGDQSZCu1lcbCQVwr63wqTnNWf6GARx3qJ7KesGB2Jz50j7H0pGF70zMz2E4xQ6InCvnYSr6XqdM7k4H7uB1EeU9GOlRmN7Xks3fDcVpFVulioHW0RM3PsIFWqiP5GfMhyLbhx3UFJw4YsIq+9OWNQLVWdkTfkEcy1AgZcLceihjMJTGaNmlfbLr8UsC06R1jbuJZ+rxOdxjbKd73IZe/LI284IQ/JTVbHoskLpR1F6DIT8g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Yan # for x86_64 and arm64 Acked-by: David Hildenbrand --- arch/x86/include/asm/numa.h | 1 + arch/x86/mm/numa.c | 5 +++++ arch/x86/mm/numa_emulation.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 7017d540894a..b22c85c1ef18 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -74,6 +74,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable); int numa_emu_cmdline(char *str); void __init numa_emu_update_cpu_to_node(int *emu_nid_to_phys, unsigned int nr_emu_nids); +u64 __init numa_emu_dma_end(void); #else /* CONFIG_NUMA_EMU */ static inline int numa_emu_cmdline(char *str) { diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 9180d524cfe4..8b7c6580d268 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -868,6 +868,11 @@ void __init numa_emu_update_cpu_to_node(int *emu_nid_to_phys, __apicid_to_node[i] = j < nr_emu_nids ? j : 0; } } + +u64 __init numa_emu_dma_end(void) +{ + return PFN_PHYS(MAX_DMA32_PFN); +} #endif /* CONFIG_NUMA_EMU */ #ifdef CONFIG_NUMA_KEEP_MEMINFO diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c index f2746e52ab93..fb4814497446 100644 --- a/arch/x86/mm/numa_emulation.c +++ b/arch/x86/mm/numa_emulation.c @@ -128,7 +128,7 @@ static int __init split_nodes_interleave(struct numa_meminfo *ei, */ while (!nodes_empty(physnode_mask)) { for_each_node_mask(i, physnode_mask) { - u64 dma32_end = PFN_PHYS(MAX_DMA32_PFN); + u64 dma32_end = numa_emu_dma_end(); u64 start, limit, end; int phys_blk; @@ -275,7 +275,7 @@ static int __init split_nodes_size_interleave_uniform(struct numa_meminfo *ei, */ while (!nodes_empty(physnode_mask)) { for_each_node_mask(i, physnode_mask) { - u64 dma32_end = PFN_PHYS(MAX_DMA32_PFN); + u64 dma32_end = numa_emu_dma_end(); u64 start, limit, end; int phys_blk;