* [PATCH] x86/numa: Add Devicetree support
@ 2023-06-27 7:28 Saurabh Sengar
2023-07-12 8:11 ` Saurabh Singh Sengar
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Saurabh Sengar @ 2023-06-27 7:28 UTC (permalink / raw)
To: tglx, mingo, bp, dave.hansen, x86, hpa, luto, peterz, mikelley,
linux-kernel
Cc: ssengar
Hyper-V has usecases where it need to fetch NUMA information from
Devicetree. Currently, it is not possible to extract the NUMA
information from Devicetree for x86 arch.
Add support for Devicetree in the x86_numa_init function, allowing
the retrieval of NUMA node information from the Devicetree.
Additionally, relocate the x86_dtb_init function before initmem_init
to ensure the Devicetree initialization prior to its utilization in
x86_numa_init.
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
arch/x86/Kconfig | 1 +
arch/x86/kernel/setup.c | 2 +-
arch/x86/mm/numa.c | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c531b16ee0bf..a2ada193b2d8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1567,6 +1567,7 @@ config NUMA
depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
default y if X86_BIGSMP
select USE_PERCPU_NUMA_NODE_ID
+ select OF_NUMA if OF
help
Enable NUMA (Non-Uniform Memory Access) support.
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index fd975a4a5200..940c92a6a5e9 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
early_acpi_boot_init();
+ x86_dtb_init();
initmem_init();
dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
@@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
* Read APIC and some other early information from ACPI tables.
*/
acpi_boot_init();
- x86_dtb_init();
/*
* get boot-time SMP configuration:
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 2aadb2019b4f..a6d3d331fda2 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -11,6 +11,7 @@
#include <linux/nodemask.h>
#include <linux/sched.h>
#include <linux/topology.h>
+#include <linux/of.h>
#include <asm/e820/api.h>
#include <asm/proto.h>
@@ -733,6 +734,8 @@ void __init x86_numa_init(void)
if (!numa_init(amd_numa_init))
return;
#endif
+ if (acpi_disabled && !numa_init(of_numa_init))
+ return;
}
numa_init(dummy_numa_init);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH] x86/numa: Add Devicetree support
2023-06-27 7:28 [PATCH] x86/numa: Add Devicetree support Saurabh Sengar
@ 2023-07-12 8:11 ` Saurabh Singh Sengar
2023-07-27 8:06 ` Saurabh Singh Sengar
2023-08-02 18:49 ` Michael Kelley (LINUX)
2023-08-24 15:28 ` Thomas Gleixner
2 siblings, 1 reply; 8+ messages in thread
From: Saurabh Singh Sengar @ 2023-07-12 8:11 UTC (permalink / raw)
To: Saurabh Sengar, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, luto@kernel.org, peterz@infradead.org,
Michael Kelley (LINUX), linux-kernel@vger.kernel.org,
Sharath George John
> -----Original Message-----
> From: Saurabh Sengar <ssengar@linux.microsoft.com>
> Sent: Tuesday, June 27, 2023 12:58 PM
> To: tglx@linutronix.de; mingo@redhat.com; bp@alien8.de;
> dave.hansen@linux.intel.com; x86@kernel.org; hpa@zytor.com;
> luto@kernel.org; peterz@infradead.org; Michael Kelley (LINUX)
> <mikelley@microsoft.com>; linux-kernel@vger.kernel.org
> Cc: ssengar@linux.microsoft.com
> Subject: [PATCH] x86/numa: Add Devicetree support
>
> Hyper-V has usecases where it need to fetch NUMA information from
> Devicetree. Currently, it is not possible to extract the NUMA
> information from Devicetree for x86 arch.
>
> Add support for Devicetree in the x86_numa_init function, allowing
> the retrieval of NUMA node information from the Devicetree.
>
> Additionally, relocate the x86_dtb_init function before initmem_init
> to ensure the Devicetree initialization prior to its utilization in
> x86_numa_init.
>
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/kernel/setup.c | 2 +-
> arch/x86/mm/numa.c | 3 +++
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index c531b16ee0bf..a2ada193b2d8 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1567,6 +1567,7 @@ config NUMA
> depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
> default y if X86_BIGSMP
> select USE_PERCPU_NUMA_NODE_ID
> + select OF_NUMA if OF
> help
> Enable NUMA (Non-Uniform Memory Access) support.
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index fd975a4a5200..940c92a6a5e9 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
>
> early_acpi_boot_init();
>
> + x86_dtb_init();
> initmem_init();
> dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
>
> @@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
> * Read APIC and some other early information from ACPI tables.
> */
> acpi_boot_init();
> - x86_dtb_init();
>
> /*
> * get boot-time SMP configuration:
> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> index 2aadb2019b4f..a6d3d331fda2 100644
> --- a/arch/x86/mm/numa.c
> +++ b/arch/x86/mm/numa.c
> @@ -11,6 +11,7 @@
> #include <linux/nodemask.h>
> #include <linux/sched.h>
> #include <linux/topology.h>
> +#include <linux/of.h>
>
> #include <asm/e820/api.h>
> #include <asm/proto.h>
> @@ -733,6 +734,8 @@ void __init x86_numa_init(void)
> if (!numa_init(amd_numa_init))
> return;
> #endif
> + if (acpi_disabled && !numa_init(of_numa_init))
> + return;
> }
>
> numa_init(dummy_numa_init);
> --
> 2.34.1
Hi x86 Maintainers,
May I get your feedback on this patch.
Regards,
Saurabh
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] x86/numa: Add Devicetree support
2023-07-12 8:11 ` Saurabh Singh Sengar
@ 2023-07-27 8:06 ` Saurabh Singh Sengar
0 siblings, 0 replies; 8+ messages in thread
From: Saurabh Singh Sengar @ 2023-07-27 8:06 UTC (permalink / raw)
To: Saurabh Singh Sengar, Saurabh Sengar, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
x86@kernel.org, hpa@zytor.com, luto@kernel.org,
peterz@infradead.org, Michael Kelley (LINUX),
linux-kernel@vger.kernel.org, Sharath George John
> -----Original Message-----
> From: Saurabh Singh Sengar <ssengar@microsoft.com>
> Sent: Wednesday, July 12, 2023 1:42 PM
> To: Saurabh Sengar <ssengar@linux.microsoft.com>; tglx@linutronix.de;
> mingo@redhat.com; bp@alien8.de; dave.hansen@linux.intel.com;
> x86@kernel.org; hpa@zytor.com; luto@kernel.org; peterz@infradead.org;
> Michael Kelley (LINUX) <mikelley@microsoft.com>; linux-
> kernel@vger.kernel.org; Sharath George John <sgeorgejohn@microsoft.com>
> Subject: [EXTERNAL] RE: [PATCH] x86/numa: Add Devicetree support
>
>
>
> > -----Original Message-----
> > From: Saurabh Sengar <ssengar@linux.microsoft.com>
> > Sent: Tuesday, June 27, 2023 12:58 PM
> > To: tglx@linutronix.de; mingo@redhat.com; bp@alien8.de;
> > dave.hansen@linux.intel.com; x86@kernel.org; hpa@zytor.com;
> > luto@kernel.org; peterz@infradead.org; Michael Kelley (LINUX)
> > <mikelley@microsoft.com>; linux-kernel@vger.kernel.org
> > Cc: ssengar@linux.microsoft.com
> > Subject: [PATCH] x86/numa: Add Devicetree support
> >
> > Hyper-V has usecases where it need to fetch NUMA information from
> > Devicetree. Currently, it is not possible to extract the NUMA
> > information from Devicetree for x86 arch.
> >
> > Add support for Devicetree in the x86_numa_init function, allowing the
> > retrieval of NUMA node information from the Devicetree.
> >
> > Additionally, relocate the x86_dtb_init function before initmem_init
> > to ensure the Devicetree initialization prior to its utilization in
> > x86_numa_init.
> >
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > arch/x86/Kconfig | 1 +
> > arch/x86/kernel/setup.c | 2 +-
> > arch/x86/mm/numa.c | 3 +++
> > 3 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index
> > c531b16ee0bf..a2ada193b2d8 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -1567,6 +1567,7 @@ config NUMA
> > depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
> > default y if X86_BIGSMP
> > select USE_PERCPU_NUMA_NODE_ID
> > + select OF_NUMA if OF
> > help
> > Enable NUMA (Non-Uniform Memory Access) support.
> >
> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index
> > fd975a4a5200..940c92a6a5e9 100644
> > --- a/arch/x86/kernel/setup.c
> > +++ b/arch/x86/kernel/setup.c
> > @@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
> >
> > early_acpi_boot_init();
> >
> > + x86_dtb_init();
> > initmem_init();
> > dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
> >
> > @@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
> > * Read APIC and some other early information from ACPI tables.
> > */
> > acpi_boot_init();
> > - x86_dtb_init();
> >
> > /*
> > * get boot-time SMP configuration:
> > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index
> > 2aadb2019b4f..a6d3d331fda2 100644
> > --- a/arch/x86/mm/numa.c
> > +++ b/arch/x86/mm/numa.c
> > @@ -11,6 +11,7 @@
> > #include <linux/nodemask.h>
> > #include <linux/sched.h>
> > #include <linux/topology.h>
> > +#include <linux/of.h>
> >
> > #include <asm/e820/api.h>
> > #include <asm/proto.h>
> > @@ -733,6 +734,8 @@ void __init x86_numa_init(void)
> > if (!numa_init(amd_numa_init))
> > return;
> > #endif
> > + if (acpi_disabled && !numa_init(of_numa_init))
> > + return;
> > }
> >
> > numa_init(dummy_numa_init);
> > --
> > 2.34.1
>
> Hi x86 Maintainers,
>
> May I get your feedback on this patch.
>
> Regards,
> Saurabh
Kind reminder to review this patch.
- Saurabh
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] x86/numa: Add Devicetree support
2023-06-27 7:28 [PATCH] x86/numa: Add Devicetree support Saurabh Sengar
2023-07-12 8:11 ` Saurabh Singh Sengar
@ 2023-08-02 18:49 ` Michael Kelley (LINUX)
2023-08-11 10:29 ` Saurabh Singh Sengar
2023-08-24 15:28 ` Thomas Gleixner
2 siblings, 1 reply; 8+ messages in thread
From: Michael Kelley (LINUX) @ 2023-08-02 18:49 UTC (permalink / raw)
To: Saurabh Sengar, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, luto@kernel.org, peterz@infradead.org,
linux-kernel@vger.kernel.org
From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Tuesday, June 27, 2023 12:28 AM
>
> Hyper-V has usecases where it need to fetch NUMA information from
> Devicetree. Currently, it is not possible to extract the NUMA
> information from Devicetree for x86 arch.
>
> Add support for Devicetree in the x86_numa_init function, allowing
> the retrieval of NUMA node information from the Devicetree.
>
> Additionally, relocate the x86_dtb_init function before initmem_init
> to ensure the Devicetree initialization prior to its utilization in
> x86_numa_init.
>
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/kernel/setup.c | 2 +-
> arch/x86/mm/numa.c | 3 +++
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index c531b16ee0bf..a2ada193b2d8 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1567,6 +1567,7 @@ config NUMA
> depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
> default y if X86_BIGSMP
> select USE_PERCPU_NUMA_NODE_ID
> + select OF_NUMA if OF
> help
> Enable NUMA (Non-Uniform Memory Access) support.
>
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index fd975a4a5200..940c92a6a5e9 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
>
> early_acpi_boot_init();
>
> + x86_dtb_init();
> initmem_init();
> dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
>
> @@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
> * Read APIC and some other early information from ACPI tables.
> */
> acpi_boot_init();
> - x86_dtb_init();
>
> /*
> * get boot-time SMP configuration:
> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> index 2aadb2019b4f..a6d3d331fda2 100644
> --- a/arch/x86/mm/numa.c
> +++ b/arch/x86/mm/numa.c
> @@ -11,6 +11,7 @@
> #include <linux/nodemask.h>
> #include <linux/sched.h>
> #include <linux/topology.h>
> +#include <linux/of.h>
>
> #include <asm/e820/api.h>
> #include <asm/proto.h>
> @@ -733,6 +734,8 @@ void __init x86_numa_init(void)
> if (!numa_init(amd_numa_init))
> return;
> #endif
> + if (acpi_disabled && !numa_init(of_numa_init))
> + return;
> }
>
> numa_init(dummy_numa_init);
> --
> 2.34.1
This looks good to me. I've looked and don't see any
obvious issues in moving x86_dtb_init() earlier in
setup_arch(). But I also know the setup ordering can
be very tricky to get working correctly with a wide
range of platforms, and I don't have that expertise.
But with those caveats,
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] x86/numa: Add Devicetree support
2023-08-02 18:49 ` Michael Kelley (LINUX)
@ 2023-08-11 10:29 ` Saurabh Singh Sengar
2023-08-24 5:16 ` Saurabh Singh Sengar
0 siblings, 1 reply; 8+ messages in thread
From: Saurabh Singh Sengar @ 2023-08-11 10:29 UTC (permalink / raw)
To: Michael Kelley (LINUX), Saurabh Sengar, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
x86@kernel.org, hpa@zytor.com, luto@kernel.org,
peterz@infradead.org, linux-kernel@vger.kernel.org
> -----Original Message-----
> From: Michael Kelley (LINUX) <mikelley@microsoft.com>
> Sent: Thursday, August 3, 2023 12:19 AM
> To: Saurabh Sengar <ssengar@linux.microsoft.com>; tglx@linutronix.de;
> mingo@redhat.com; bp@alien8.de; dave.hansen@linux.intel.com;
> x86@kernel.org; hpa@zytor.com; luto@kernel.org; peterz@infradead.org;
> linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] RE: [PATCH] x86/numa: Add Devicetree support
>
> From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Tuesday, June
> 27, 2023 12:28 AM
> >
> > Hyper-V has usecases where it need to fetch NUMA information from
> > Devicetree. Currently, it is not possible to extract the NUMA
> > information from Devicetree for x86 arch.
> >
> > Add support for Devicetree in the x86_numa_init function, allowing the
> > retrieval of NUMA node information from the Devicetree.
> >
> > Additionally, relocate the x86_dtb_init function before initmem_init
> > to ensure the Devicetree initialization prior to its utilization in
> > x86_numa_init.
> >
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > arch/x86/Kconfig | 1 +
> > arch/x86/kernel/setup.c | 2 +-
> > arch/x86/mm/numa.c | 3 +++
> > 3 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index
> > c531b16ee0bf..a2ada193b2d8 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -1567,6 +1567,7 @@ config NUMA
> > depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
> > default y if X86_BIGSMP
> > select USE_PERCPU_NUMA_NODE_ID
> > + select OF_NUMA if OF
> > help
> > Enable NUMA (Non-Uniform Memory Access) support.
> >
> > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index
> > fd975a4a5200..940c92a6a5e9 100644
> > --- a/arch/x86/kernel/setup.c
> > +++ b/arch/x86/kernel/setup.c
> > @@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
> >
> > early_acpi_boot_init();
> >
> > + x86_dtb_init();
> > initmem_init();
> > dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
> >
> > @@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
> > * Read APIC and some other early information from ACPI tables.
> > */
> > acpi_boot_init();
> > - x86_dtb_init();
> >
> > /*
> > * get boot-time SMP configuration:
> > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index
> > 2aadb2019b4f..a6d3d331fda2 100644
> > --- a/arch/x86/mm/numa.c
> > +++ b/arch/x86/mm/numa.c
> > @@ -11,6 +11,7 @@
> > #include <linux/nodemask.h>
> > #include <linux/sched.h>
> > #include <linux/topology.h>
> > +#include <linux/of.h>
> >
> > #include <asm/e820/api.h>
> > #include <asm/proto.h>
> > @@ -733,6 +734,8 @@ void __init x86_numa_init(void)
> > if (!numa_init(amd_numa_init))
> > return;
> > #endif
> > + if (acpi_disabled && !numa_init(of_numa_init))
> > + return;
> > }
> >
> > numa_init(dummy_numa_init);
> > --
> > 2.34.1
>
> This looks good to me. I've looked and don't see any obvious issues in
> moving x86_dtb_init() earlier in setup_arch(). But I also know the setup
> ordering can be very tricky to get working correctly with a wide range of
> platforms, and I don't have that expertise.
> But with those caveats,
>
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Hi X86 Maintainers,
Is this good to be accepted ?
- Saurabh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/numa: Add Devicetree support
2023-08-11 10:29 ` Saurabh Singh Sengar
@ 2023-08-24 5:16 ` Saurabh Singh Sengar
0 siblings, 0 replies; 8+ messages in thread
From: Saurabh Singh Sengar @ 2023-08-24 5:16 UTC (permalink / raw)
To: Saurabh Singh Sengar
Cc: Michael Kelley (LINUX), tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, luto@kernel.org, peterz@infradead.org,
linux-kernel@vger.kernel.org
On Fri, Aug 11, 2023 at 10:29:57AM +0000, Saurabh Singh Sengar wrote:
>
>
> > -----Original Message-----
> > From: Michael Kelley (LINUX) <mikelley@microsoft.com>
> > Sent: Thursday, August 3, 2023 12:19 AM
> > To: Saurabh Sengar <ssengar@linux.microsoft.com>; tglx@linutronix.de;
> > mingo@redhat.com; bp@alien8.de; dave.hansen@linux.intel.com;
> > x86@kernel.org; hpa@zytor.com; luto@kernel.org; peterz@infradead.org;
> > linux-kernel@vger.kernel.org
> > Subject: [EXTERNAL] RE: [PATCH] x86/numa: Add Devicetree support
> >
> > From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Tuesday, June
> > 27, 2023 12:28 AM
> > >
> > > Hyper-V has usecases where it need to fetch NUMA information from
> > > Devicetree. Currently, it is not possible to extract the NUMA
> > > information from Devicetree for x86 arch.
> > >
> > > Add support for Devicetree in the x86_numa_init function, allowing the
> > > retrieval of NUMA node information from the Devicetree.
> > >
> > > Additionally, relocate the x86_dtb_init function before initmem_init
> > > to ensure the Devicetree initialization prior to its utilization in
> > > x86_numa_init.
> > >
> > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > > ---
> > > arch/x86/Kconfig | 1 +
> > > arch/x86/kernel/setup.c | 2 +-
> > > arch/x86/mm/numa.c | 3 +++
> > > 3 files changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index
> > > c531b16ee0bf..a2ada193b2d8 100644
> > > --- a/arch/x86/Kconfig
> > > +++ b/arch/x86/Kconfig
> > > @@ -1567,6 +1567,7 @@ config NUMA
> > > depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
> > > default y if X86_BIGSMP
> > > select USE_PERCPU_NUMA_NODE_ID
> > > + select OF_NUMA if OF
> > > help
> > > Enable NUMA (Non-Uniform Memory Access) support.
> > >
> > > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index
> > > fd975a4a5200..940c92a6a5e9 100644
> > > --- a/arch/x86/kernel/setup.c
> > > +++ b/arch/x86/kernel/setup.c
> > > @@ -1220,6 +1220,7 @@ void __init setup_arch(char **cmdline_p)
> > >
> > > early_acpi_boot_init();
> > >
> > > + x86_dtb_init();
> > > initmem_init();
> > > dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
> > >
> > > @@ -1261,7 +1262,6 @@ void __init setup_arch(char **cmdline_p)
> > > * Read APIC and some other early information from ACPI tables.
> > > */
> > > acpi_boot_init();
> > > - x86_dtb_init();
> > >
> > > /*
> > > * get boot-time SMP configuration:
> > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index
> > > 2aadb2019b4f..a6d3d331fda2 100644
> > > --- a/arch/x86/mm/numa.c
> > > +++ b/arch/x86/mm/numa.c
> > > @@ -11,6 +11,7 @@
> > > #include <linux/nodemask.h>
> > > #include <linux/sched.h>
> > > #include <linux/topology.h>
> > > +#include <linux/of.h>
> > >
> > > #include <asm/e820/api.h>
> > > #include <asm/proto.h>
> > > @@ -733,6 +734,8 @@ void __init x86_numa_init(void)
> > > if (!numa_init(amd_numa_init))
> > > return;
> > > #endif
> > > + if (acpi_disabled && !numa_init(of_numa_init))
> > > + return;
> > > }
> > >
> > > numa_init(dummy_numa_init);
> > > --
> > > 2.34.1
> >
> > This looks good to me. I've looked and don't see any obvious issues in
> > moving x86_dtb_init() earlier in setup_arch(). But I also know the setup
> > ordering can be very tricky to get working correctly with a wide range of
> > platforms, and I don't have that expertise.
> > But with those caveats,
> >
> > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
>
> Hi X86 Maintainers,
>
> Is this good to be accepted ?
Thomas/Borislav,
Kind reminder to review this.
- Saurabh
>
> - Saurabh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/numa: Add Devicetree support
2023-06-27 7:28 [PATCH] x86/numa: Add Devicetree support Saurabh Sengar
2023-07-12 8:11 ` Saurabh Singh Sengar
2023-08-02 18:49 ` Michael Kelley (LINUX)
@ 2023-08-24 15:28 ` Thomas Gleixner
2023-08-24 15:59 ` Saurabh Singh Sengar
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2023-08-24 15:28 UTC (permalink / raw)
To: Saurabh Sengar, mingo, bp, dave.hansen, x86, hpa, luto, peterz,
mikelley, linux-kernel
Cc: ssengar
On Tue, Jun 27 2023 at 00:28, Saurabh Sengar wrote:
> Hyper-V has usecases where it need to fetch NUMA information from
> Devicetree. Currently, it is not possible to extract the NUMA
> information from Devicetree for x86 arch.
>
> Add support for Devicetree in the x86_numa_init function, allowing
> the retrieval of NUMA node information from the Devicetree.
>
> Additionally, relocate the x86_dtb_init function before initmem_init
> to ensure the Devicetree initialization prior to its utilization in
> x86_numa_init.
Moving dtb_init() is not really a good idea. The APIC/IO-APIC
enumeration is post initmem_init() on purpose and the ongoing rework of
the topology evaluation relies on that.
What you really want is to split dtb_init() into two parts:
1) x86_flattree_get_config() which can be invoked before initmem init
like ACPI has an early init part so SRAT parsing can be done in
the numa initialization.
2) The APIC/IOAPIC registration part, which stays where it is.
This split wants to be a seperate change.
Thanks,
tglx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/numa: Add Devicetree support
2023-08-24 15:28 ` Thomas Gleixner
@ 2023-08-24 15:59 ` Saurabh Singh Sengar
0 siblings, 0 replies; 8+ messages in thread
From: Saurabh Singh Sengar @ 2023-08-24 15:59 UTC (permalink / raw)
To: Thomas Gleixner
Cc: mingo, bp, dave.hansen, x86, hpa, luto, peterz, mikelley,
linux-kernel
On Thu, Aug 24, 2023 at 05:28:37PM +0200, Thomas Gleixner wrote:
> On Tue, Jun 27 2023 at 00:28, Saurabh Sengar wrote:
> > Hyper-V has usecases where it need to fetch NUMA information from
> > Devicetree. Currently, it is not possible to extract the NUMA
> > information from Devicetree for x86 arch.
> >
> > Add support for Devicetree in the x86_numa_init function, allowing
> > the retrieval of NUMA node information from the Devicetree.
> >
> > Additionally, relocate the x86_dtb_init function before initmem_init
> > to ensure the Devicetree initialization prior to its utilization in
> > x86_numa_init.
>
> Moving dtb_init() is not really a good idea. The APIC/IO-APIC
> enumeration is post initmem_init() on purpose and the ongoing rework of
> the topology evaluation relies on that.
>
> What you really want is to split dtb_init() into two parts:
>
> 1) x86_flattree_get_config() which can be invoked before initmem init
> like ACPI has an early init part so SRAT parsing can be done in
> the numa initialization.
>
> 2) The APIC/IOAPIC registration part, which stays where it is.
>
> This split wants to be a seperate change.
Thanks for the review, I will send the v2 with suggested modifications.
- Saurabh
>
> Thanks,
>
> tglx
>
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-08-24 16:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 7:28 [PATCH] x86/numa: Add Devicetree support Saurabh Sengar
2023-07-12 8:11 ` Saurabh Singh Sengar
2023-07-27 8:06 ` Saurabh Singh Sengar
2023-08-02 18:49 ` Michael Kelley (LINUX)
2023-08-11 10:29 ` Saurabh Singh Sengar
2023-08-24 5:16 ` Saurabh Singh Sengar
2023-08-24 15:28 ` Thomas Gleixner
2023-08-24 15:59 ` Saurabh Singh Sengar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox