From: Thomas Gleixner <tglx@linutronix.de>
To: Fernando Fernandez Mancera <ffmancera@riseup.net>,
linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Fernando Fernandez Mancera <ffmancera@riseup.net>
Subject: Re: [PATCH RESEND] x86/cpu/topology: remove limit of CPUs due to noapic on x86_64
Date: Sun, 01 Dec 2024 14:56:24 +0100 [thread overview]
Message-ID: <87ttbnv75j.ffs@tglx> (raw)
In-Reply-To: <20241124174510.2561-1-ffmancera@riseup.net>
On Sun, Nov 24 2024 at 18:45, Fernando Fernandez Mancera wrote:
> 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@riseup.net>
> ---
> RESEND: original patch https://lkml.org/lkml/2024/9/7/160
Please use https://lore.kernel.org/all/$MSGID references.
> ---
> 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)
That's wrong. If the local APIC is disabled, SMP is not possible.
> possible = 1;
>
> +#if defined(CONFIG_X86_32)
> + /* 'nolapic' 'disableapic' 'noapic' */
> + if (apic_is_disabled || ioapic_is_disabled)
I double checked the original behaviour. A disabled IOAPIC did not
prevent SMP on 32bit either.
> + possible = 1;
> +#endif
So the condition wants to be:
if (!setup_max_cpus || apic_is_disabled)
> /* '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
That wants to go away too.
Thanks,
tglx
prev parent reply other threads:[~2024-12-01 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-24 17:45 [PATCH RESEND] x86/cpu/topology: remove limit of CPUs due to noapic on x86_64 Fernando Fernandez Mancera
2024-11-25 8:37 ` Ingo Molnar
2024-11-25 15:13 ` Fernando F. Mancera
2024-12-01 13:49 ` Thomas Gleixner
2024-12-01 13:56 ` Thomas Gleixner [this message]
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=87ttbnv75j.ffs@tglx \
--to=tglx@linutronix.de \
--cc=ffmancera@riseup.net \
--cc=linux-kernel@vger.kernel.org \
--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 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.