From patchwork Mon Dec 11 09:14:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13486889 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 AB036C4167B for ; Mon, 11 Dec 2023 09:15:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.651527.1017211 (Exim 4.92) (envelope-from ) id 1rCcN6-00026R-7j; Mon, 11 Dec 2023 09:14:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 651527.1017211; Mon, 11 Dec 2023 09:14:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rCcN6-00026K-5G; Mon, 11 Dec 2023 09:14:40 +0000 Received: by outflank-mailman (input) for mailman id 651527; Mon, 11 Dec 2023 09:14:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rCcN4-0001ce-UI for xen-devel@lists.xenproject.org; Mon, 11 Dec 2023 09:14:38 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b5729684-9805-11ee-98e8-6d05b1d4d9a1; Mon, 11 Dec 2023 10:14:38 +0100 (CET) Received: from nico.bugseng.com (unknown [147.123.100.131]) by support.bugseng.com (Postfix) with ESMTPSA id 88D164EE0741; Mon, 11 Dec 2023 10:14:36 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b5729684-9805-11ee-98e8-6d05b1d4d9a1 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Nicola Vetrini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio Subject: [XEN PATCH v3 3/3] xen/mm: add declaration for first_valid_mfn Date: Mon, 11 Dec 2023 10:14:29 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Such declaration is needed because a compatible declaration is not visible in xen/common/page_alloc.c, where the variable is defined. That variable can't yet be static because of the lack of support from ARM and PPC for NUMA. On the occasion, use drop a use of u8. No functional change. Signed-off-by: Nicola Vetrini --- Having this declaration essentially sidesteps the current impossibility of having a static variable, as described in the comments in ARM and PCC's asm/numa.h. Changes in v3: - Drop redundant declarations of first_valid_mfn in asm/numa.h for Arm and PPC. --- xen/arch/arm/include/asm/numa.h | 8 ++++---- xen/arch/ppc/include/asm/numa.h | 7 +++---- xen/include/xen/mm.h | 2 ++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index e2bee2bd8223..44b689f67db8 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -2,8 +2,9 @@ #define __ARCH_ARM_NUMA_H #include +#include -typedef u8 nodeid_t; +typedef uint8_t nodeid_t; #ifndef CONFIG_NUMA @@ -12,10 +13,9 @@ typedef u8 nodeid_t; #define node_to_cpumask(node) (cpu_online_map) /* - * TODO: make first_valid_mfn static when NUMA is supported on Arm, this - * is required because the dummy helpers are using it. + * TODO: define here first_valid_mfn as static when NUMA is supported on Arm, + * this is required because the dummy helpers are using it. */ -extern mfn_t first_valid_mfn; /* XXX: implement NUMA support */ #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn)) diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/numa.h index 7fdf66c3da74..152305ebe446 100644 --- a/xen/arch/ppc/include/asm/numa.h +++ b/xen/arch/ppc/include/asm/numa.h @@ -1,8 +1,8 @@ #ifndef __ASM_PPC_NUMA_H__ #define __ASM_PPC_NUMA_H__ -#include #include +#include typedef uint8_t nodeid_t; @@ -11,10 +11,9 @@ typedef uint8_t nodeid_t; #define node_to_cpumask(node) (cpu_online_map) /* - * TODO: make first_valid_mfn static when NUMA is supported on PPC, this - * is required because the dummy helpers are using it. + * TODO: define here first_valid_mfn as static when NUMA is supported on PPC, + * this is required because the dummy helpers are using it. */ -extern mfn_t first_valid_mfn; /* XXX: implement NUMA support */ #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn)) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 3d9b2d05a5c8..a13a9a46ced7 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -118,6 +118,8 @@ int destroy_xen_mappings(unsigned long s, unsigned long e); /* Retrieve the MFN mapped by VA in Xen virtual address space. */ mfn_t xen_map_to_mfn(unsigned long va); +extern mfn_t first_valid_mfn; + /* * Create only non-leaf page table entries for the * page range in Xen virtual address space.