Re: [PATCHv2 13/13] x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method

From: kirill.shutemov@xxxxxxxxxxxxxxx
Date: Fri Oct 27 2023 - 07:58:24 EST


On Tue, Oct 24, 2023 at 10:11:58AM +0000, Huang, Kai wrote:
>
> > --- /dev/null
> > +++ b/arch/x86/kernel/acpi/madt.S
>
> I think the name 'madt.S' is too generic. How about something be more specific
> such as madt_reset.S, or madt_playdead.S, etc?

Okay, madt_playdead.S sounds good.

> > @@ -11,6 +16,150 @@ static u64 acpi_mp_wake_mailbox_paddr;
> > /* Virtual address of the Multiprocessor Wakeup Structure mailbox */
> > static struct acpi_madt_multiproc_wakeup_mailbox *acpi_mp_wake_mailbox;
> >
> > +u64 acpi_mp_pgd;
> > +u64 acpi_mp_reset_vector_paddr;
> > +
> > +void asm_acpi_mp_play_dead(void);
> > +
> > +static void __init *alloc_pgt_page(void *context)
> > +{
> > + return memblock_alloc(PAGE_SIZE, PAGE_SIZE);
> > +}
> > +
> > +/*
> > + * Make sure asm_acpi_mp_play_dead() is present in the identity mapping at
> > + * the same place as in the kernel page tables. The function switches to
> > + * the identity mapping 
> >
>
> This function itself doesn't switch to the identity mapping. It just creates
> the kernel mapping for asm_acpi_mp_play_dead() in the identify mapping page
> table.

By "The function" I meant asm_acpi_mp_play_dead(). Yeah, it is not clear.

Will so s/The function/asm_acpi_mp_play_dead()/

> > - cpu_hotplug_disable_offlining();
> > + if (mp_wake->version >= ACPI_MADT_MP_WAKEUP_VERSION_V1 &&
> > + mp_wake->header.length >= ACPI_MADT_MP_WAKEUP_SIZE_V1) {
> > + acpi_mp_setup_reset(mp_wake->reset_vector);
>
> It's better to fallback to "disable offline" if this function fails.
>

Okay, will warn to disable offlining.

--
Kiryl Shutsemau / Kirill A. Shutemov