[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a5qbmdp5.ffs@tglx>
Date: Fri, 15 Dec 2023 21:08:06 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Ingo Molnar
<mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, x86@...nel.org
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Peter Zijlstra
<peterz@...radead.org>, Adrian Hunter <adrian.hunter@...el.com>,
Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
Elena Reshetova <elena.reshetova@...el.com>, Jun Nakajima
<jun.nakajima@...el.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>, Tom
Lendacky <thomas.lendacky@....com>, "Kalra, Ashish"
<ashish.kalra@....com>, Sean Christopherson <seanjc@...gle.com>, "Huang,
Kai" <kai.huang@...el.com>, Baoquan He <bhe@...hat.com>,
kexec@...ts.infradead.org, linux-coco@...ts.linux.dev,
linux-kernel@...r.kernel.org, "Kirill A. Shutemov"
<kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCHv4 13/14] x86/acpi: Do not attempt to bring up secondary
CPUs in kexec case
On Tue, Dec 05 2023 at 03:45, Kirill A. Shutemov wrote:
> ACPI MADT doesn't allow to offline CPU after it got woke up. It limits
to offline a CPU after it was onlined. This limits kexec: ...
> kexec: the second kernel won't be able to use more than one CPU.
... one CPU, which is enough to cover the kdump case.
> Now acpi_mp_wake_mailbox_paddr already has the mailbox address.
> The acpi_wakeup_cpu() will use it to bring up secondary cpus.
>
> Zero out mailbox address in the ACPI MADT wakeup structure to indicate
> that the mailbox is not usable. This prevents the kexec()-ed kernel
> from reading a vaild mailbox, which in turn makes the kexec()-ed kernel
> only be able to use the boot CPU.
>
> This is Linux-specific protocol and not reflected in ACPI spec.
>
> Booting the second kernel with signle CPU is enough to cover the most
> common case for kexec -- kdump.
This is confusing at best and I doubt that kdump is the most common case
for every one.
To prevent a kexec kernel from onlining secondary CPUs invalidate the
mailbox address in the ACPI MADT wakeup structure which prevents a
kexec kernel to use it.
This is safe as the booting kernel has the mailbox address cached
already and acpi_wakeup_cpu() uses the cached value to bring up the
secondary CPUs.
Note: This is a Linux specific convention and not covered by the
ACPI specification.
Hmm?
> + /*
> + * ACPI MADT doesn't allow to offline CPU after it got woke up.
to offline a CPU after it was onlined.
> + * It limits kexec: the second kernel won't be able to use more than
This limits kexec: ...
> + * one CPU.
> + *
> + * Now acpi_mp_wake_mailbox_paddr already has the mailbox address.
> + * The acpi_wakeup_cpu() will use it to bring up secondary cpus.
> + *
> + * Zero out mailbox address in the ACPI MADT wakeup structure to
> + * indicate that the mailbox is not usable. This prevents the
> + * kexec()-ed kernel from reading a vaild mailbox, which in turn
> + * makes the kexec()-ed kernel only be able to use the boot CPU.
> + *
> + * This is Linux-specific protocol and not reflected in ACPI spec.
See changelog comment...
> + */
> + mp_wake->mailbox_address = 0;
> +
> apic_update_callback(wakeup_secondary_cpu_64, acpi_wakeup_cpu);
>
> return 0;
Powered by blists - more mailing lists