All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip: x86/apic] smp: Provide 'setup_max_cpus' definition on UP too
@ 2024-02-26 11:48 tip-bot2 for Ingo Molnar
  2024-02-26 15:02 ` Borislav Petkov
  2024-02-26 18:19 ` Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2024-02-26 11:48 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Thomas Gleixner, linux-kernel, Ingo Molnar, x86

The following commit has been merged into the x86/apic branch of tip:

Commit-ID:     429bb0269058e2e1f4ab69a0d33d374933aa15b9
Gitweb:        https://git.kernel.org/tip/429bb0269058e2e1f4ab69a0d33d374933aa15b9
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Mon, 26 Feb 2024 12:07:31 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 26 Feb 2024 12:13:40 +01:00

smp: Provide 'setup_max_cpus' definition on UP too

This was already defined locally by init/main.c, but let's make
it generic, as arch/x86/kernel/cpu/topology.c is going to make
use of it to have more uniform code.

[ Keep it a C variable, not a define, because there's
  some namespace overlap for the 'setup_max_cpus' token
  in existing function argument names. ]

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
--
---
 include/linux/smp.h | 2 ++
 init/main.c         | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index e87520d..5a5985f 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -218,6 +218,8 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
 static inline void kick_all_cpus_sync(void) {  }
 static inline void wake_up_all_idle_cpus(void) {  }
 
+static const unsigned int setup_max_cpus = 0;
+
 #ifdef CONFIG_UP_LATE_INIT
 extern void __init up_late_init(void);
 static inline void smp_init(void) { up_late_init(); }
diff --git a/init/main.c b/init/main.c
index e24b078..5644bb1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -603,7 +603,6 @@ static int __init rdinit_setup(char *str)
 __setup("rdinit=", rdinit_setup);
 
 #ifndef CONFIG_SMP
-static const unsigned int setup_max_cpus = NR_CPUS;
 static inline void setup_nr_cpu_ids(void) { }
 static inline void smp_prepare_cpus(unsigned int maxcpus) { }
 #endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [tip: x86/apic] smp: Provide 'setup_max_cpus' definition on UP too
@ 2024-02-27  9:17 tip-bot2 for Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Ingo Molnar @ 2024-02-27  9:17 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Thomas Gleixner, linux-kernel, Ingo Molnar, x86

The following commit has been merged into the x86/apic branch of tip:

Commit-ID:     3c2f8859ae1ce53f2a89c8e4ca4092101afbff67
Gitweb:        https://git.kernel.org/tip/3c2f8859ae1ce53f2a89c8e4ca4092101afbff67
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Mon, 26 Feb 2024 12:07:31 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 27 Feb 2024 10:05:41 +01:00

smp: Provide 'setup_max_cpus' definition on UP too

This was already defined locally by init/main.c, but let's make
it generic, as arch/x86/kernel/cpu/topology.c is going to make
use of it to have more uniform code.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/smp.h | 2 ++
 init/main.c         | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index e87520d..7a83fd2 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -218,6 +218,8 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
 static inline void kick_all_cpus_sync(void) {  }
 static inline void wake_up_all_idle_cpus(void) {  }
 
+#define setup_max_cpus 0
+
 #ifdef CONFIG_UP_LATE_INIT
 extern void __init up_late_init(void);
 static inline void smp_init(void) { up_late_init(); }
diff --git a/init/main.c b/init/main.c
index e24b078..5644bb1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -603,7 +603,6 @@ static int __init rdinit_setup(char *str)
 __setup("rdinit=", rdinit_setup);
 
 #ifndef CONFIG_SMP
-static const unsigned int setup_max_cpus = NR_CPUS;
 static inline void setup_nr_cpu_ids(void) { }
 static inline void smp_prepare_cpus(unsigned int maxcpus) { }
 #endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-27  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 11:48 [tip: x86/apic] smp: Provide 'setup_max_cpus' definition on UP too tip-bot2 for Ingo Molnar
2024-02-26 15:02 ` Borislav Petkov
2024-02-27  9:19   ` Ingo Molnar
2024-02-26 18:19 ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2024-02-27  9:17 tip-bot2 for Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.