From: Catalin Marinas <catalin.marinas@arm•com>
To: Jinjie Ruan <ruanjinjie@huawei•com>
Cc: will@kernel•org, punit.agrawal@oss•qualcomm.com,
rafael.j.wysocki@intel•com, fengchengwen@huawei•com,
chenl311@chinatelecom•cn, suzuki.poulose@arm•com, maz@kernel•org,
timothy.hayes@arm•com, lpieralisi@kernel•org,
mrigendra.chaubey@gmail•com, arnd@arndb•de,
sudeep.holla@kernel•org, yangyicong@hisilicon•com,
jic23@kernel•org, pierre.gondois@arm•com,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, james.morse@arm•com
Subject: Re: [PATCH v2] cpu/hotplug: Fix NULL kobject warning in cpuhp_smt_enable()
Date: Mon, 11 May 2026 18:37:21 +0100 [thread overview]
Message-ID: <agIT0R4KV3YBYjlo@arm.com> (raw)
In-Reply-To: <20260427023507.1247418-1-ruanjinjie@huawei.com>
On Mon, Apr 27, 2026 at 10:35:07AM +0800, Jinjie Ruan wrote:
> On arm64, when booting with `maxcpus` greater than the number of present
> CPUs (e.g., QEMU -smp cpus=4,maxcpus=8), some CPUs are marked as 'present'
> but have not yet been registered via register_cpu(). Consequently,
> the per-cpu device objects for these CPUs are not yet initialized.
[...]
> Fix this by:
>
> 1. When booting with ACPI, checking the ACPI_MADT_ENABLED flag in the GICC
> entry before calling set_cpu_present() during SMP initialization.
>
> 2. Properly managing the present mask in acpi_map_cpu() and
> acpi_unmap_cpu() to support actual CPU hotplug events, This aligns with
> other architectures like x86 and LoongArch.
I had a chat with James earlier and IIUC the decision was to mark all
CPUs present and the GIC must be fully initialised. But digging through
the GICv3 code, I don't see it depending on cpu_present_mask but rather
on the "always on" MADT GICR description. So I think it should be safe
as long as we don't rely on the GICC gicr_base_address. But we should
update Documentation/arch/arm64/cpu-hotplug.rst to no longer state that
all online-capable vCPUs are marked as present by the kernel.
(or maybe I misunderstood all this)
--
Catalin
next prev parent reply other threads:[~2026-05-11 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 2:35 [PATCH v2] cpu/hotplug: Fix NULL kobject warning in cpuhp_smt_enable() Jinjie Ruan
2026-05-11 3:17 ` Jinjie Ruan
2026-05-11 9:55 ` Catalin Marinas
2026-05-11 17:37 ` Catalin Marinas [this message]
2026-05-19 12:48 ` Will Deacon
2026-05-19 12:56 ` Jinjie Ruan
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=agIT0R4KV3YBYjlo@arm.com \
--to=catalin.marinas@arm$(echo .)com \
--cc=arnd@arndb$(echo .)de \
--cc=chenl311@chinatelecom$(echo .)cn \
--cc=fengchengwen@huawei$(echo .)com \
--cc=james.morse@arm$(echo .)com \
--cc=jic23@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=lpieralisi@kernel$(echo .)org \
--cc=maz@kernel$(echo .)org \
--cc=mrigendra.chaubey@gmail$(echo .)com \
--cc=pierre.gondois@arm$(echo .)com \
--cc=punit.agrawal@oss$(echo .)qualcomm.com \
--cc=rafael.j.wysocki@intel$(echo .)com \
--cc=ruanjinjie@huawei$(echo .)com \
--cc=sudeep.holla@kernel$(echo .)org \
--cc=suzuki.poulose@arm$(echo .)com \
--cc=timothy.hayes@arm$(echo .)com \
--cc=will@kernel$(echo .)org \
--cc=yangyicong@hisilicon$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox