From: Thomas Gleixner <tglx@linutronix.de>
To: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
Cc: dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, mingo@redhat.com, bp@alien8.de,
x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
ssengar@microsoft.com, sgeorgejohn@microsoft.com
Subject: Re: [PATCH] x86/numa: Map NUMA node to CPUs as per DeviceTree
Date: Mon, 25 Mar 2024 15:42:32 +0100 [thread overview]
Message-ID: <87jzlqfk4n.ffs@tglx> (raw)
In-Reply-To: <20240324162833.GA18417@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
On Sun, Mar 24 2024 at 09:28, Saurabh Singh Sengar wrote:
> I recognize that due to recent changes, each dtb platform will now need to set
> a pointer for x86_init.mpparse.early_parse_smp_cfg to get the dtb_cpu_setup
> executed.
No. DT does not need the early parse call. The early parse call _cannot_
enumerate APICs.
> This was not the requirement before because earlier x86_dtb_init was
> anyway getting called.
For the wrong reasons.
> Do you think we should improve this as well by setting
> x86_init.mpparse.early_parse_smp_cfg to x86_dtb_parse_smp_config for all the
> dtb platforms by default.
No.
> I see the ce4100 platform is setting the parse_smp_cfg, shouldn't the
> early_parse_smp_cfg be more accurate there ?
Again. No. Early is not the point where APICs can be enumerated.
What we can do is the below.
Thanks,
tglx
---
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -24,18 +24,15 @@ extern u64 initial_dtb;
extern void add_dtb(u64 data);
void x86_of_pci_init(void);
void x86_dtb_parse_smp_config(void);
+void x86_flattree_get_config(void);
#else
static inline void add_dtb(u64 data) { }
static inline void x86_of_pci_init(void) { }
static inline void x86_dtb_parse_smp_config(void) { }
+static inline void x86_flattree_get_config(void) { }
#define of_ioapic 0
#endif
-#ifdef CONFIG_OF_EARLY_FLATTREE
-void x86_flattree_get_config(void);
-#else
-static inline void x86_flattree_get_config(void) { }
-#endif
extern char cmd_line[COMMAND_LINE_SIZE];
#endif /* __ASSEMBLY__ */
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -277,9 +277,9 @@ static void __init dtb_apic_setup(void)
dtb_ioapic_setup();
}
-#ifdef CONFIG_OF_EARLY_FLATTREE
void __init x86_flattree_get_config(void)
{
+#ifdef CONFIG_OF_EARLY_FLATTREE
u32 size, map_len;
void *dt;
@@ -301,8 +301,10 @@ void __init x86_flattree_get_config(void
if (initial_dtb)
early_memunmap(dt, map_len);
-}
#endif
+ if (of_have_populated_dt())
+ x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
+}
void __init x86_dtb_parse_smp_config(void)
{
next prev parent reply other threads:[~2024-03-25 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 17:43 [PATCH] x86/numa: Map NUMA node to CPUs as per DeviceTree Saurabh Sengar
2024-03-24 14:59 ` Thomas Gleixner
2024-03-24 16:28 ` Saurabh Singh Sengar
2024-03-25 14:42 ` Thomas Gleixner [this message]
2024-03-25 16:24 ` Saurabh Singh Sengar
2024-03-26 0:14 ` Thomas Gleixner
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=87jzlqfk4n.ffs@tglx \
--to=tglx@linutronix.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sgeorgejohn@microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=ssengar@microsoft.com \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox