Asahi Linux Progress Report: Linux 7.2
Linux 7.2 has been released, marking a rapid progress for the Asahi Linux platform. This Linux version introduces various improvements, with a primary focus on addressing the power management challenges on Apple Silicon devices. The Apple Silicon platform's power management infrastructure is intricate, involving multiple hardware blocks such as the SMC, PMGR, and PMP.
These components have been previously discussed on the Asahi Linux blog, with power management being a significant hurdle for enhancing battery life. The core issue lies in the application cores themselves, which have various "sleep" modes for efficient power usage. The basic way to put an ARM CPU core to sleep is by using a Wait For Interrupt (WFI) instruction, which halts the core's execution until an interrupt wakes it up.
However, the core stays powered up and retains enough state to resume work quickly. The cpuidle driver used in Asahi Linux sets WFI in a "deep" mode, shutting down more of the core while losing its state. This driver operates by setting WFI, issuing a WFI loop, and handling vendor-specific power management oddities through the Power State Coordination Interface (PSCI).
While the maintainers mandate the use of PSCI for power management in the arm64 arch-specific code, upstream hardware must comply with PSCI. However, Apple cores do not implement EL3, making it difficult for Linux to issue SMC or HVC instructions and utilize PSCI. A workaround involves loading the kernel into EL1 and hosting a PSCI implementation in EL2, but this would break some architectural features.
Instead, the team decided to implement a UEFI Runtime Service based PSCI conduit, allowing the kernel to call back into it for PSCI services. This change necessitated modifying m1n1, the base firmware for Apple Silicon devices, to reserve its memory and leave behind a PSCI implementation. The kernel team has already incorporated the patches enabling this new feature in the mailing list.
Additionally, the ARM specification mandates that cores in WFI loops should preserve all state, a default mode on Apple Silicon SoCs. However, Apple now sets chicken bits in mBoot and locks down the registers controlling them starting with the M4 series. To prevent M4 machines from crashing during early kernel initialization, a kernel command line parameter has been added to configure idle loop behavior, allowing the kernel to park cores using a basic no-op loop.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- Asahi Linux Progress Report: Linux 7.2 asahilinux.org