Re: [PATCH RFC v3 03/21] ACPI: processor: Register CPUs that are online, but not described in the DSDT

From: Russell King (Oracle)
Date: Mon Jan 22 2024 - 13:06:28 EST


On Mon, Jan 22, 2024 at 04:02:27PM +0000, Jonathan Cameron wrote:
> On Mon, 15 Jan 2024 11:06:29 +0000
> "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> wrote:
>
> > On Mon, Dec 18, 2023 at 09:22:03PM +0100, Rafael J. Wysocki wrote:
> > > On Wed, Dec 13, 2023 at 1:49 PM Russell King <rmk+kernel@xxxxxxxxxxxxxxx> wrote:
> > > >
> > > > From: James Morse <james.morse@xxxxxxx>
> > > >
> > > > 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 Processors"
> > > > 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 online
> > > > early during boot. Once the register_cpu() calls are moved to ACPI,
> > > > they will be based on the DSDT description of the CPUs. When CPUs 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 register
> > > > CPUs that are online, but weren't found in the DSDT. Any CPU that
> > > > 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-hotplug
> > > > is configured.
> > >
> > > So why is this a kernel problem?
> >
> > 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.
>
> This confuses me somewhat, because I'm far from sure which machines this
> 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 anyway
> 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.

Maybe Salil can shed some light on this?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!