All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Nicola Vetrini <nicola.vetrini@bugseng.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [XEN PATCH v3 3/3] xen/mm: add declaration for first_valid_mfn
Date: Mon, 11 Dec 2023 10:14:29 +0100	[thread overview]
Message-ID: <d80309f31fea24ea75c4994e924da069472811fc.1702285639.git.nicola.vetrini@bugseng.com> (raw)
In-Reply-To: <cover.1702285639.git.nicola.vetrini@bugseng.com>

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 <nicola.vetrini@bugseng.com>
---
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 <xen/mm.h>
+#include <xen/types.h>
 
-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 <xen/types.h>
 #include <xen/mm.h>
+#include <xen/types.h>
 
 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.
-- 
2.34.1


  parent reply	other threads:[~2023-12-11  9:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  9:14 [XEN PATCH v3 0/3] address some violations of MISRA C Rule 8.4 Nicola Vetrini
2023-12-11  9:14 ` [XEN PATCH v3 1/3] xen/x86: add missing instances of asmlinkage attributes Nicola Vetrini
2023-12-12  1:48   ` Stefano Stabellini
2023-12-18 14:03     ` Jan Beulich
2023-12-11  9:14 ` [XEN PATCH v3 2/3] x86/viridian: make build_assertions static Nicola Vetrini
2023-12-11  9:15   ` Durrant, Paul
2023-12-11  9:14 ` Nicola Vetrini [this message]
2023-12-12 23:24   ` [XEN PATCH v3 3/3] xen/mm: add declaration for first_valid_mfn Stefano Stabellini
2023-12-13  8:26   ` Jan Beulich
2023-12-14  2:05     ` Stefano Stabellini
2023-12-14  7:53       ` Jan Beulich
2023-12-14  8:32         ` Julien Grall
2023-12-14  8:51           ` Jan Beulich
2023-12-14 14:15             ` George Dunlap
2023-12-14 19:10               ` Julien Grall
2023-12-14 21:27                 ` Stefano Stabellini
2023-12-15  8:03                 ` Jan Beulich
2023-12-15  9:43                   ` Julien Grall
2023-12-15  9:59                     ` Nicola Vetrini
2023-12-15 10:06                       ` Julien Grall
2023-12-15 21:01                   ` Stefano Stabellini
2023-12-14  8:49         ` Nicola Vetrini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d80309f31fea24ea75c4994e924da069472811fc.1702285639.git.nicola.vetrini@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sanastasio@raptorengineering.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.