Re: [PATCH RFC v3 03/21] ACPI: processor: Register CPUs that are online, but not described in the DSDT
Jonathan Cameron <[email protected]> Tue, 23 Jan 2024 09:27:25 +0000
| Newsgroups | org.kernel.vger.linux-ia64,dev.linux.lists.kvmarm,dev.linux.lists.loongarch,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-acpi,org.kernel.vger.linux-arch,org.kernel.vger.linux-csky,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-parisc,org.kernel.vger.linux-pm |
|---|---|
| Organization | Huawei Technologies Research and Development (UK) Ltd. |
| Message-ID | <[email protected]> |
On Mon, 22 Jan 2024 17:30:05 +0000 "Russell King (Oracle)" <[email protected]> wrote: > On Mon, Jan 22, 2024 at 05:22:46PM +0100, Rafael J. Wysocki wrote: > > On Mon, Jan 22, 2024 at 5:02=E2=80=AFPM Jonathan Cameron > > <[email protected]> wrote: =20 > > > > > > On Mon, 15 Jan 2024 11:06:29 +0000 > > > "Russell King (Oracle)" <[email protected]> wrote: > > > =20 > > > > On Mon, Dec 18, 2023 at 09:22:03PM +0100, Rafael J. Wysocki wrote: = =20 > > > > > On Wed, Dec 13, 2023 at 1:49=E2=80=AFPM Russell King <rmk+kernel@= armlinux.org.uk> wrote: =20 > > > > > > > > > > > > From: James Morse <[email protected]> > > > > > > > > > > > > ACPI has two descriptions of CPUs, one in the MADT/APIC table, = the other > > > > > > in the DSDT. Both are required. (ACPI 6.5's 8.4 "Declaring Proc= essors" > > > > > > says "Each processor in the system must be declared in the ACPI > > > > > > namespace"). Having two descriptions allows firmware authors to= get > > > > > > this wrong. > > > > > > > > > > > > If CPUs are described in the MADT/APIC, they will be brought on= line > > > > > > early during boot. Once the register_cpu() calls are moved to A= CPI, > > > > > > they will be based on the DSDT description of the CPUs. When CP= Us are > > > > > > missing from the DSDT description, they will end up online, but= not > > > > > > registered. > > > > > > > > > > > > Add a helper that runs after acpi_init() has completed to regis= ter > > > > > > CPUs that are online, but weren't found in the DSDT. Any CPU th= at > > > > > > is registered by this code triggers a firmware-bug warning and = kernel > > > > > > taint. > > > > > > > > > > > > Qemu TCG only describes the first CPU in the DSDT, unless cpu-h= otplug > > > > > > is configured. =20 > > > > > > > > > > So why is this a kernel problem? =20 > > > > > > > > So what are you proposing should be the behaviour here? What this > > > > statement seems to be saying is that QEMU as it exists today only > > > > describes the first CPU in DSDT. =20 > > > > > > This confuses me somewhat, because I'm far from sure which machines t= his > > > is true for in QEMU. I'm guessing it's a legacy thing with > > > some old distro version of QEMU - so we'll have to paper over it anyw= ay > > > but for current QEMU I'm not sure it's true. > > > > > > Helpfully there are a bunch of ACPI table tests so I've been checking > > > through all the multi CPU cases. > > > > > > CPU hotplug not enabled. > > > pc/DSDT.dimmpxm - 4x Processor entries. -smp 4 > > > pc/DSDT.acpihmat - 2x Processor entries. -smp 2 > > > q35/DSDT.acpihmat - 2x Processor entries. -smp 2 > > > virt/DSDT.acpihmatvirt - 4x ACPI0007 entries -smp 4 > > > q35/DSDT.acpihmat-noinitiator - 4 x Processor () entries -smp 4 > > > virt/DSDT.topology - 8x ACPI0007 entries > > > > > > I've also looked at the code and we have various types of > > > CPU hotplug on x86 but they all build appropriate numbers of > > > Processor() entries in DSDT. > > > Arm likewise seems to build the right number of ACPI0007 entries > > > (and doesn't yet have CPU HP support). > > > > > > If anyone can add a reference on why this is needed that would be very > > > helpful. =20 > >=20 > > Yes, it would. > >=20 > > Personally, I would prefer to assume that it is not necessary until it > > turns out that (1) there is firmware with this issue actually in use > > and (2) updating the firmware in question to follow the specification > > is not practical. > >=20 > > Otherwise, we'd make it easier to ship non-compliant firmware for no > > good reason. =20 >=20 > If Salil can't come up with a reason, then I'm in favour of dropping > the patch like already done for patch 2. If the code change serves no > useful purpose, there's no point in making the change. >=20 Salil's out today, but I've messaged him to follow up later in the week. It 'might' be the odd cold plug path where QEMU half comes up, then extra CPUs are added, then it boots. (used by some orchestration frameworks) I don't have a set up for that and I won't get to creating one today anyway (we all love start of the year planning workshops!) I've +CC'd a few people have run tests on the various iterations of this work in the past. Maybe one of them can shed some light on this? Jonathan