The Forgetful CPU (Linux on M4)
Article URL: https://yuka.dev/blog-2026-10-02-linux-m4.html Comments URL: https://news.ycombinator.com/item?id=49933869 Points: 251 # Comments: 175
In November 2024, I acquired an M4 Mac mini, anticipating that it would be comparable to the M1-M3 Apple Silicon machines in terms of support for the Asahi Linux. However, the M4 machines proved to be quite a challenge, as they were the first generation of Apple Silicon to incorporate SPTM (Secure Page Table Monitor), which offers robust security against vulnerabilities in the XNU kernel of macOS.
The Linux boot process was largely based on MMIO traces captured using the m1n1 hypervisor in previous generations. With SPTM in place, major modifications to the m1n1 were required to enable macOS to function under the hypervisor, a task that went beyond my capabilities as a newcomer to this domain.
To facilitate the boot process, I initiated the first attempts to boot Linux on the M4. This entailed disabling strict boot security, installing m1n1 as a custom boot object via macOS recovery, and obtaining a serial console to monitor the logs. Initially, m1n1 was only capable of starting in BRINGUP mode, subsequently crashing while attempting to initialize GXF.
It was later discovered that GXF functionality was either disabled or locked in raw boot mode on these M4+ SoCs, necessitating the conditional and conditional skipping of its initialization on these machines. Additionally, the RVBAR (Reset Vector Base Address Register) was identified as a region in memory (one per CPU core) that determines the starting point of execution when the core is powered on.
Writing to this register on M4 led to a crash, as the value already contained the correct address, rendering this write unnecessary.
Written by urgent.news from Hacker News Best'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.
- The Forgetful CPU (Linux on M4) yuka.dev