[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240907090142.2938-1-ffmancera@riseup.net>
Date: Sat, 7 Sep 2024 11:01:38 +0200
From: Fernando Fernandez Mancera <ffmancera@...eup.net>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de,
x86@...nel.org,
Fernando Fernandez Mancera <ffmancera@...eup.net>
Subject: [PATCH] x86/cpu/topology: remove limit of CPUs due to noapic on x86_64
On x86_64 the command line parameter "noapic" should not limit the
number of possible CPUs, as it only limits the use of IRQ sharing or
device IRQ remapping. Only on x86_32 the command line parameter
"nolapic" limits the number of possible CPUs to one. This restores the
behavior previous to the rework of possible CPU management.
Fixes: 7c0edad3643f ("x86/cpu/topology: Rework possible CPU management")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@...eup.net>
---
arch/x86/kernel/cpu/topology.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c
index 621a151ccf7d..5f10a010e35a 100644
--- a/arch/x86/kernel/cpu/topology.c
+++ b/arch/x86/kernel/cpu/topology.c
@@ -428,10 +428,16 @@ void __init topology_apply_cmdline_limits_early(void)
{
unsigned int possible = nr_cpu_ids;
- /* 'maxcpus=0' 'nosmp' 'nolapic' 'disableapic' 'noapic' */
- if (!setup_max_cpus || ioapic_is_disabled || apic_is_disabled)
+ /* 'maxcpus=0' 'nosmp' */
+ if (!setup_max_cpus)
possible = 1;
+#if defined(CONFIG_X86_32)
+ /* 'nolapic' 'disableapic' 'noapic' */
+ if (apic_is_disabled || ioapic_is_disabled)
+ possible = 1;
+#endif
+
/* 'possible_cpus=N' */
possible = min_t(unsigned int, max_possible_cpus, possible);
@@ -443,8 +449,14 @@ void __init topology_apply_cmdline_limits_early(void)
static __init bool restrict_to_up(void)
{
- if (!smp_found_config || ioapic_is_disabled)
+ if (!smp_found_config)
return true;
+
+#if defined(CONFIG_X86_32)
+ if (ioapic_is_disabled)
+ return true;
+#endif
+
/*
* XEN PV is special as it does not advertise the local APIC
* properly, but provides a fake topology for it so that the
--
2.46.0
Powered by blists - more mailing lists