Expand description
Multiprocessor Boot Support
The MP initialization protocol defines two classes of processors: the bootstrap processor (BSP) and the application processors (APs). Following a power-up or RESET of an MP system, system hardware dynamically selects one of the processors on the system bus as the BSP. The remaining processors are designated as APs.
The BSP executes the BIOSβs boot-strap code to configure the APIC environment, sets up system-wide data structures. Up to now, BSP has completed most of the initialization of the OS, but APs has not been awakened.
Following a power-up or reset, the APs complete a minimal self-configuration, then wait for a startup signal (a SIPI message) from the BSP processor.
The wake-up of AP follows SNIT-SIPI-SIPI IPI sequence:
- Broadcast INIT IPI (Initialize the APs to the wait-for-SIPI state)
- Wait
- Broadcast De-assert INIT IPI (Only older processors need this step)
- Wait
- Broadcast SIPI IPI (APs exits the wait-for-SIPI state and starts executing code)
- Wait
- Broadcast SIPI IPI (If an AP fails to start)
This sequence does not need to be strictly followed, and there may be different considerations in different systems.
ConstantsΒ§
- AP_
BOOT_ πSTART_ PA - This is where the linker load the symbols in the
.ap_boot
section. The BSP would copy the AP boot code to this address.
FunctionsΒ§
- __
ap_ π βboot_ end - __
ap_ π βboot_ start - ap_
boot_ πcode_ size - The size of the AP boot code (the
.ap_boot
section). - bringup_
all_ π βaps - Brings up all application processors.
- copy_
ap_ π βboot_ code - Safety
- count_
processors π β - Counts the number of processors. Safety: This function needs to be called after the OS initializes the ACPI table.
- fill_
boot_ π βinfo_ ptr - Safety
- fill_
boot_ π βpt_ ptr - Safety
- reclaimable_
memory_ πregion - send_
boot_ π βipis - Sends IPIs to notify all application processors to boot.
- send_
init_ π βdeassert - Safety
- send_
init_ π βto_ all_ aps - Safety
- send_
startup_ π βto_ all_ aps - Safety
- spin_
wait_ πcycles - Spin wait approximately
c
cycles. - wake_
up_ π βaps_ via_ mailbox - Wakes up all application processors via the ACPI multiprocessor mailbox structure.