162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci===================================================
462306a36Sopenharmony_ciFirmware support for CPU hotplug under Linux/x86-64
562306a36Sopenharmony_ci===================================================
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciLinux/x86-64 supports CPU hotplug now. For various reasons Linux wants to
862306a36Sopenharmony_ciknow in advance of boot time the maximum number of CPUs that could be plugged
962306a36Sopenharmony_ciinto the system. ACPI 3.0 currently has no official way to supply
1062306a36Sopenharmony_cithis information from the firmware to the operating system.
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciIn ACPI each CPU needs an LAPIC object in the MADT table (5.2.11.5 in the
1362306a36Sopenharmony_ciACPI 3.0 specification).  ACPI already has the concept of disabled LAPIC
1462306a36Sopenharmony_ciobjects by setting the Enabled bit in the LAPIC object to zero.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciFor CPU hotplug Linux/x86-64 expects now that any possible future hotpluggable
1762306a36Sopenharmony_ciCPU is already available in the MADT. If the CPU is not available yet
1862306a36Sopenharmony_ciit should have its LAPIC Enabled bit set to 0. Linux will use the number
1962306a36Sopenharmony_ciof disabled LAPICs to compute the maximum number of future CPUs.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciIn the worst case the user can overwrite this choice using a command line
2262306a36Sopenharmony_cioption (additional_cpus=...), but it is recommended to supply the correct
2362306a36Sopenharmony_cinumber (or a reasonable approximation of it, with erring towards more not less)
2462306a36Sopenharmony_ciin the MADT to avoid manual configuration.
25