Hi Jan,

On 2022/4/26 17:11, Jan Beulich wrote:
On 18.04.2022 11:07, Wei Chen wrote:
v1 ->v2:
1. Drop useless cast.
2. Use initializers of the variables.

Would have been nice if this was extended to ...

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 680b7d9002..2b3a51afd0 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -162,12 +162,12 @@ int __init compute_hash_shift(struct node *nodes, int 
numnodes,
      return shift;
  }
  /* initialize NODE_DATA given nodeid and start/end */
-void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end)
-{
+void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end)
+{
      unsigned long start_pfn, end_pfn;
- start_pfn = start >> PAGE_SHIFT;
-    end_pfn = end >> PAGE_SHIFT;
+    start_pfn = paddr_to_pfn(start);
+    end_pfn = paddr_to_pfn(end);

... these as well.


Ok, I will do it.

@@ -218,9 +219,9 @@ static int __init numa_emulation(u64 start_pfn, u64 end_pfn)
      memset(&nodes,0,sizeof(nodes));
      for ( i = 0; i < numa_fake; i++ )
      {
-        nodes[i].start = (start_pfn<<PAGE_SHIFT) + i*sz;
+        nodes[i].start = pfn_to_paddr(start_pfn) + i*sz;

Please add the missing blanks around * while touching this line.


Ok.

@@ -489,7 +489,8 @@ int __init acpi_scan_nodes(u64 start, u64 end)
        /* Finally register nodes */
        for_each_node_mask(i, all_nodes_parsed)
        {
-               u64 size = nodes[i].end - nodes[i].start;
+               paddr_t size = nodes[i].end - nodes[i].start;

In numa_emulation() you use uint64_t for a size; here you use paddr_t.
Please be consistent.


Ok.

Jan


Reply via email to