From nobody Sun Feb 8 13:21:02 2026 Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 941136F307 for ; Sun, 24 Nov 2024 17:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.252.153.129 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732470349; cv=none; b=fq8n4x+EFJRpqbaJrCH2f5VB1xXp/U5QYrpixvJv+ebhjXiN+p2ESoAEcHk5BbmdT9elPAVTIg/Ddew+yfy7NDouarX+5bKy0/qBURqI7iWJKKijznPiI1RmonoLJmWCSssqsrFeeHaejIRbBH9Oy67abezc2HNfBizSNeeGhow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732470349; c=relaxed/simple; bh=EjTKw52XEP5sDYgOb2I3+VAHq2/8LE6N9diKnI/zHnA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=t4cT6lytQ4UwfJ6q7Vvr9SMTkTJ+aYOIMDY11Acu6mwnQxt6HBuF8MEdAUx2jFI/B8EHTybWUeYzqaWkNFZMoYAa9Hk7X2k/DTFkxXq0hPvA0GCfWcD0dYkDVrzyc/VmFDvyVdzPmENBYz/BeIPmmlbzW4Z6US+bp7U73NDVeIk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riseup.net; spf=pass smtp.mailfrom=riseup.net; dkim=pass (1024-bit key) header.d=riseup.net header.i=@riseup.net header.b=oTOWb0yL; arc=none smtp.client-ip=198.252.153.129 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riseup.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riseup.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=riseup.net header.i=@riseup.net header.b="oTOWb0yL" Received: from fews01-sea.riseup.net (fews01-sea-pn.riseup.net [10.0.1.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4XxGTG328NzDqh4; Sun, 24 Nov 2024 17:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1732470341; bh=EjTKw52XEP5sDYgOb2I3+VAHq2/8LE6N9diKnI/zHnA=; h=From:To:Cc:Subject:Date:From; b=oTOWb0yLvr9PEyqaXfG0i3isZjjM7yeVZ9x8O2QDWGHVBDccdBo84AMeKUV4buqXW +36x8DpsVw3ieWYn6gHPOihcuFRHVXgU6/sdzM4g0YY2qTsNr65mczk/oFpolhig7D z6DNjbBQ0Iaeox994kTNJBpfZKZ+4dE5pyviDBGw= X-Riseup-User-ID: A59CE217345DDF0B2EE92A352F7C9AB5DEDF285CB89B9ED4039D291B389A1692 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews01-sea.riseup.net (Postfix) with ESMTPSA id 4XxGTD6yLKzJsBP; Sun, 24 Nov 2024 17:45:36 +0000 (UTC) From: Fernando Fernandez Mancera To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, x86@kernel.org, Fernando Fernandez Mancera Subject: [PATCH RESEND] x86/cpu/topology: remove limit of CPUs due to noapic on x86_64 Date: Sun, 24 Nov 2024 18:45:07 +0100 Message-ID: <20241124174510.2561-1-ffmancera@riseup.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- RESEND: original patch https://lkml.org/lkml/2024/9/7/160 --- 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 =3D nr_cpu_ids; =20 - /* 'maxcpus=3D0' 'nosmp' 'nolapic' 'disableapic' 'noapic' */ - if (!setup_max_cpus || ioapic_is_disabled || apic_is_disabled) + /* 'maxcpus=3D0' 'nosmp' */ + if (!setup_max_cpus) possible =3D 1; =20 +#if defined(CONFIG_X86_32) + /* 'nolapic' 'disableapic' 'noapic' */ + if (apic_is_disabled || ioapic_is_disabled) + possible =3D 1; +#endif + /* 'possible_cpus=3DN' */ possible =3D min_t(unsigned int, max_possible_cpus, possible); =20 @@ -443,8 +449,14 @@ void __init topology_apply_cmdline_limits_early(void) =20 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 --=20 2.46.2