From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3A5ED378D86 for ; Thu, 23 Apr 2026 10:08:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776938896; cv=none; b=kv+pZZnp13yVvBZhnoMCWkro8JT1veN7yeN9QmtL+UJwHjddPctEbgKYe7RSvnGkt7e/1EyeSRtOXJm5VxAa72z/fXY9j2EpueoMx5o/bCgBOFxbFX1s5aOo8+ajUZQK2EVFOgxAQ5rpPzKNJWtswtw0p6A8em60h9D3VWPc508= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776938896; c=relaxed/simple; bh=CHvcjnR3SprvG3lX1LUmOGMYpbXoJ2lZd/UJrEB9jD8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=B1+tssqFeNdjYkTNgyuSwLI9bqY5/uyC7Xtdk0fOFDR/3HNsDkPPz7IXmWjwRhEOwLLM2kib2m8J1tKgTrcqmVF+6S1B9s6ewbzHoFH/P6nnskM5pBjImO41AZOVReZwyMORiHLTzrO4DgGTN3RpdX1RcYnntXh+3ShG2TorCpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eG8+Zy3l; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eG8+Zy3l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E14C7C2BCAF; Thu, 23 Apr 2026 10:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776938895; bh=CHvcjnR3SprvG3lX1LUmOGMYpbXoJ2lZd/UJrEB9jD8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eG8+Zy3lPv6p4S4ubMi7YbUJOwCY4PtRErxgwgmw8G8U3cgwKTtlHJactQ+s5jfXB Sq0QdRGiBGxaf6OM5dAjIZiEJ/1z2Wz2STT+B+MKhPEARQDqfKG/24SLpzRT2Rq9Gq w06Dcg8RtVMoV++XgKcN6eu1xhgRZCj+4WiRh4/nfZVD9Sacotl38fL7cnuuLUnBo3 yyR4Uo45sFeOODj2A1FzojlWH+SNKa8ozmcMYxCrHl2Q3Y86itEjWxFw2fgV9WOU8E T02LFv/zSuwWnymZwf28C0nUew03PVuQWyEbeZdlerB3RP0BPAb9eK4lBYaUa4LEOG oByK9NZ7uiilQ== From: Thomas Gleixner To: Catalin Marinas , Jinjie Ruan Cc: peterz@infradead.org, sudeep.holla@kernel.org, yangyicong@hisilicon.com, dietmar.eggemann@arm.com, Jonathan.Cameron@huawei.com, linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] cpu/hotplug: Fix NULL kobject warning in cpuhp_smt_enable() In-Reply-To: References: <20260417075534.3745793-1-ruanjinjie@huawei.com> Date: Thu, 23 Apr 2026 12:08:11 +0200 Message-ID: <87ldee0z1w.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sat, Apr 18 2026 at 12:55, Catalin Marinas wrote: > Another option would have been to avoid marking such CPUs present but I > think this will break other things. Yet another option is to register > all CPU devices even if they never come up (like maxcpus greater than > actual CPUs). > > Opinions? It might be an arm64+ACPI-only thing. I think so. The proper thing to do is to apply sane limits: 1) The possible CPUs enumerated by firmware N_POSSIBLE_FW 2) The maxcpus limit on the command line N_MAXCPUS_CL So the actual possible CPUs evaluates to: num_possible = min(N_POSSIBLE_FW, N_MAXCPUS_CL, CONFIG_NR_CPUS); The evaluation of the firmware should not mark CPUs present which are actually not. ACPI gives you that information. See: 5.2.12.14 GIC CPU Interface (GICC) Structure in the ACPI spec. That has two related bits: Enabled: If this bit is set, the processor is ready for use. If this bit is clear and the Online Capable bit is set, the system supports enabling this processor during OS runtime. If this bit is clear and the Online Capable bit is also clear, this processor is un- usable, and the operating system support will not attempt to use it. Online Capable: The information conveyed by this bit depends on the value of the Enabled bit. If the Enabled bit is set, this bit is reserved and must be zero. Otherwise, if this bit is set, the system supports enabling this processor later during OS runtime So the combination of those gives you the right answer: Enabled Online Capable 0 0 Not present, not possible 0 1 Not present, but possible to "hotplug" layter 1 0 Present 1 1 Invalid The kernel sizes everything on the number of possible CPUs and the present CPU mask is only there to figure out which CPUs are actually usable and can be brought up. The runtime physical hotplug mechanics use acpi_[un]map_cpu() to toggle the present bit. Thanks, tglx