diff mbox series

[15/37] xen/x86: rename acpi_scan_nodes to numa_scan_nodes

Message ID 20210923120236.3692135-16-wei.chen@arm.com (mailing list archive)
State New, archived
Headers show
Series Add device tree based NUMA support to Arm | expand

Commit Message

Wei Chen Sept. 23, 2021, 12:02 p.m. UTC
The most code in acpi_scan_nodes can be reused by other NUMA
implementation. Rename acpi_scan_nodes to a more generic name
numa_scan_nodes, and replace BIOS to Firmware in print message,
as BIOS is x86 specific name.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
 xen/arch/x86/numa.c        | 2 +-
 xen/arch/x86/srat.c        | 4 ++--
 xen/include/asm-x86/acpi.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Stefano Stabellini Sept. 24, 2021, 12:40 a.m. UTC | #1
+x86 maintainers


On Thu, 23 Sep 2021, Wei Chen wrote:
> The most code in acpi_scan_nodes can be reused by other NUMA
> implementation. Rename acpi_scan_nodes to a more generic name
> numa_scan_nodes, and replace BIOS to Firmware in print message,
> as BIOS is x86 specific name.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
>  xen/arch/x86/numa.c        | 2 +-
>  xen/arch/x86/srat.c        | 4 ++--
>  xen/include/asm-x86/acpi.h | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
> index 2ef385ae3f..8a4710df39 100644
> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -261,7 +261,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
>      end = pfn_to_paddr(end_pfn);
>  
>  #ifdef CONFIG_ACPI_NUMA
> -    if ( !numa_off && !acpi_scan_nodes(start, end) )
> +    if ( !numa_off && !numa_scan_nodes(start, end) )
>          return;
>  #endif
>  
> diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
> index 4921830f94..0b8b0b0c95 100644
> --- a/xen/arch/x86/srat.c
> +++ b/xen/arch/x86/srat.c
> @@ -512,7 +512,7 @@ void __init srat_parse_regions(paddr_t addr)
>  }
>  
>  /* Use the information discovered above to actually set up the nodes. */
> -int __init acpi_scan_nodes(paddr_t start, paddr_t end)
> +int __init numa_scan_nodes(paddr_t start, paddr_t end)
>  {
>  	int i;
>  	nodemask_t all_nodes_parsed;
> @@ -547,7 +547,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end)
>  		paddr_t size = nodes[i].end - nodes[i].start;
>  		if ( size == 0 )
>  			printk(KERN_WARNING "SRAT: Node %u has no memory. "
> -			       "BIOS Bug or mis-configured hardware?\n", i);
> +			       "Firmware Bug or mis-configured hardware?\n", i);
>  
>  		setup_node_bootmem(i, nodes[i].start, nodes[i].end);
>  	}
> diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h
> index 83be71fec3..2add971072 100644
> --- a/xen/include/asm-x86/acpi.h
> +++ b/xen/include/asm-x86/acpi.h
> @@ -102,7 +102,7 @@ extern unsigned long acpi_wakeup_address;
>  #define ARCH_HAS_POWER_INIT	1
>  
>  extern s8 fw_numa;
> -extern int acpi_scan_nodes(u64 start, u64 end);
> +extern int numa_scan_nodes(u64 start, u64 end);
>  #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
>  
>  extern struct acpi_sleep_info acpi_sinfo;
> -- 
> 2.25.1
>
Jan Beulich Jan. 25, 2022, 10:17 a.m. UTC | #2
On 23.09.2021 14:02, Wei Chen wrote:
> --- a/xen/arch/x86/srat.c
> +++ b/xen/arch/x86/srat.c
> @@ -512,7 +512,7 @@ void __init srat_parse_regions(paddr_t addr)
>  }
>  
>  /* Use the information discovered above to actually set up the nodes. */
> -int __init acpi_scan_nodes(paddr_t start, paddr_t end)
> +int __init numa_scan_nodes(paddr_t start, paddr_t end)
>  {
>  	int i;
>  	nodemask_t all_nodes_parsed;
> @@ -547,7 +547,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end)
>  		paddr_t size = nodes[i].end - nodes[i].start;
>  		if ( size == 0 )
>  			printk(KERN_WARNING "SRAT: Node %u has no memory. "
> -			       "BIOS Bug or mis-configured hardware?\n", i);
> +			       "Firmware Bug or mis-configured hardware?\n", i);

Besides the prior theme of in-place renames not making clear why the
rename is being done (by deferring to future patches then moving the
code) I'm puzzled by you replacing "BIOS" but leaving "SRAT" in place.

Jan
Wei Chen Jan. 27, 2022, 8:14 a.m. UTC | #3
Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: 2022年1月25日 18:18
> To: Wei Chen <Wei.Chen@arm.com>
> Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>; xen-
> devel@lists.xenproject.org; sstabellini@kernel.org; julien@xen.org
> Subject: Re: [PATCH 15/37] xen/x86: rename acpi_scan_nodes to
> numa_scan_nodes
> 
> On 23.09.2021 14:02, Wei Chen wrote:
> > --- a/xen/arch/x86/srat.c
> > +++ b/xen/arch/x86/srat.c
> > @@ -512,7 +512,7 @@ void __init srat_parse_regions(paddr_t addr)
> >  }
> >
> >  /* Use the information discovered above to actually set up the nodes.
> */
> > -int __init acpi_scan_nodes(paddr_t start, paddr_t end)
> > +int __init numa_scan_nodes(paddr_t start, paddr_t end)
> >  {
> >  	int i;
> >  	nodemask_t all_nodes_parsed;
> > @@ -547,7 +547,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t
> end)
> >  		paddr_t size = nodes[i].end - nodes[i].start;
> >  		if ( size == 0 )
> >  			printk(KERN_WARNING "SRAT: Node %u has no memory. "
> > -			       "BIOS Bug or mis-configured hardware?\n", i);
> > +			       "Firmware Bug or mis-configured hardware?\n", i);
> 
> Besides the prior theme of in-place renames not making clear why the
> rename is being done (by deferring to future patches then moving the
> code) I'm puzzled by you replacing "BIOS" but leaving "SRAT" in place.
> 

The reason is the same as I said in previous patch. At that time, I
want to treat device tree as another static resource table. I would change
"SRAT" to "NUMA". And I will try to merge this rename patch with the
actual affected patch.

> Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index 2ef385ae3f..8a4710df39 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -261,7 +261,7 @@  void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
     end = pfn_to_paddr(end_pfn);
 
 #ifdef CONFIG_ACPI_NUMA
-    if ( !numa_off && !acpi_scan_nodes(start, end) )
+    if ( !numa_off && !numa_scan_nodes(start, end) )
         return;
 #endif
 
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index 4921830f94..0b8b0b0c95 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -512,7 +512,7 @@  void __init srat_parse_regions(paddr_t addr)
 }
 
 /* Use the information discovered above to actually set up the nodes. */
-int __init acpi_scan_nodes(paddr_t start, paddr_t end)
+int __init numa_scan_nodes(paddr_t start, paddr_t end)
 {
 	int i;
 	nodemask_t all_nodes_parsed;
@@ -547,7 +547,7 @@  int __init acpi_scan_nodes(paddr_t start, paddr_t end)
 		paddr_t size = nodes[i].end - nodes[i].start;
 		if ( size == 0 )
 			printk(KERN_WARNING "SRAT: Node %u has no memory. "
-			       "BIOS Bug or mis-configured hardware?\n", i);
+			       "Firmware Bug or mis-configured hardware?\n", i);
 
 		setup_node_bootmem(i, nodes[i].start, nodes[i].end);
 	}
diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h
index 83be71fec3..2add971072 100644
--- a/xen/include/asm-x86/acpi.h
+++ b/xen/include/asm-x86/acpi.h
@@ -102,7 +102,7 @@  extern unsigned long acpi_wakeup_address;
 #define ARCH_HAS_POWER_INIT	1
 
 extern s8 fw_numa;
-extern int acpi_scan_nodes(u64 start, u64 end);
+extern int numa_scan_nodes(u64 start, u64 end);
 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
 
 extern struct acpi_sleep_info acpi_sinfo;