lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 25 Mar 2024 15:42:32 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Saurabh Singh Sengar <ssengar@...ux.microsoft.com>
Cc: dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
 mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
 linux-kernel@...r.kernel.org, ssengar@...rosoft.com,
 sgeorgejohn@...rosoft.com
Subject: Re: [PATCH] x86/numa: Map NUMA node to CPUs as per DeviceTree

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)
 {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ