<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00" -->

---
title: The forgetful CPU (Linux on M4) | daily.dev
description: A developer recounts the lengthy reverse-engineering effort to boot mainline Linux on Apple's M4 Mac mini for the Asahi Linux project. The M4 introduced SPTM...
canonical: https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The forgetful CPU (Linux on M4) | daily.dev
og:description: A developer recounts the lengthy reverse-engineering effort to boot mainline Linux on Apple's M4 Mac mini for the Asahi Linux project. The M4 introduced SPTM...
og:url: https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00
og:image: https://api.daily.dev/og/posts/iGQAUaX00.png
og:image:alt: The forgetful CPU (Linux on M4)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The forgetful CPU (Linux on M4)

**[Lobsters](https://daily.dev/sources/lobsters)** · 9 min read · 1 upvotes · 0 comments

## Summary

A developer recounts the lengthy reverse-engineering effort to boot mainline Linux on Apple's M4 Mac mini for the Asahi Linux project. The M4 introduced SPTM hardening that broke the previous MMIO-tracing bringup method, forcing a from-scratch approach using println-style debugging, device tree hacking, and register-level investigation. Key obstacles included locked GXF and RVBAR registers, missing UART memory mappings after MMU init, a crash tied to a virtualization register, and a broken WFI instruction that zeroed CPU registers on wake, violating the ARM64 spec. The WFI issue was eventually solved with a new kernel bootarg (proposed by Will Deacon) that has since been merged into mainline Linux and m1n1, enabling Linux to boot on M4 with all cores active, including M4 Pro, M4 Max, and M5 variants.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://yuka.dev/blog-2026-10-02-linux-m4.html>

## Questions this post answers

### Why did Linux fail to boot on the Apple M4 Mac mini initially with Asahi Linux's m1n1 bootloader?

The M4 is the first Apple Silicon generation to mandate SPTM (Secure Page Table Monitor), which hardens the XNU kernel and broke the prior MMIO-tracing bringup method used for M1-M3 chips. Additional obstacles included locked GXF initialization, a locked RVBAR register, missing MMIO mappings for the UART after MMU init, and a crash writing to SYS_IMP_APL_VM_TMR_FIQ_ENA_EL2, all of which had to be individually diagnosed and worked around.

_Developers tracking Apple Silicon Linux support can follow bring-up breakthroughs like this on daily.dev._

### Why does the WFI instruction crash Linux on Apple M4 and later chips?

On M4 and later Apple Silicon, the WFI (Wait For Interrupt) and WFIT instructions zero out CPU registers x0-x31 upon execution, which violates the ARM64 specification requiring WFI not to cause loss of architectural state. On M1-M3 chips this behavior could be disabled via a chicken bit, but on M4 that bit appears locked or removed, so a workaround replacing WFI/WFIT with NOP, and later a dedicated kernel bootarg, was needed.

_Anyone porting kernels to new Apple Silicon chips can track these errata fixes as they land upstream via daily.dev._

### How was the Apple Silicon WFI register-zeroing erratum fixed in mainline Linux?

Will Deacon proposed adding kernel support for a bootarg that disables WFI-based idle, allowing m1n1 to conditionally pass that bootarg only on bare-metal machines with the broken WFI behavior, since detecting virtualization reliably was impractical. This mechanism, along with a WFxT override, has been merged into mainline Linux and m1n1, letting Linux boot natively with all cores on M4, M4 Pro, M4 Max, and M5 Macs.

_Kernel contributors weighing errata-handling strategies can find deep technical write-ups like this through daily.dev._

## Similar posts on daily.dev

- [Progress Report: Linux 7.2](https://daily.dev/posts/progress-report-linux-7-2-xqndrr7aq) · Asahi Linux · 2 upvotes · 0 comments
- [Initial Patches Posted For Booting The Apple M4 On Linux](https://daily.dev/posts/initial-patches-posted-for-booting-the-apple-m4-on-linux-ggwpry8ya) · Phoronix · 0 upvotes · 0 comments
- [Asahi Linux - Porting Linux to Apple Silicon](https://daily.dev/posts/asahi-linux---porting-linux-to-apple-silicon-7kpfpvyxe) · Lobsters · 1 upvotes · 0 comments
- [Running Modern Linux On A 68008](https://daily.dev/posts/running-modern-linux-on-a-68008-ni9b7c7xe) · Hackaday · 5 upvotes · 0 comments
- [GitHub - GrieferPig/esp32-s31-linux: Porting MMU Linux to ESP32-S31](https://daily.dev/posts/github---grieferpig-esp32-s31-linux-porting-mmu-linux-to-esp32-s31-o9nrg0dao) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#hardware](https://daily.dev/tags/hardware), [#reverse-engineering](https://daily.dev/tags/reverse-engineering), [#asahi-linux](https://daily.dev/tags/asahi-linux)

[View this post on daily.dev](https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The forgetful CPU (Linux on M4)","url":"https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00"},"datePublished":"2026-10-02T19:45:58.980Z","dateModified":"2026-10-02T19:48:36.268Z","description":"A developer recounts the lengthy reverse-engineering effort to boot mainline Linux on Apple's M4 Mac mini for the Asahi Linux project. The M4 introduced SPTM...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3ff797d5277c8a28186b75bc582d58aa?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3ff797d5277c8a28186b75bc582d58aa?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,hardware,reverse-engineering,asahi-linux","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"The forgetful CPU (Linux on M4)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-forgetful-cpu-linux-on-m4--igqauax00#faq","mainEntity":[{"@type":"Question","name":"Why did Linux fail to boot on the Apple M4 Mac mini initially with Asahi Linux's m1n1 bootloader?","acceptedAnswer":{"@type":"Answer","text":"The M4 is the first Apple Silicon generation to mandate SPTM (Secure Page Table Monitor), which hardens the XNU kernel and broke the prior MMIO-tracing bringup method used for M1-M3 chips. Additional obstacles included locked GXF initialization, a locked RVBAR register, missing MMIO mappings for the UART after MMU init, and a crash writing to SYS_IMP_APL_VM_TMR_FIQ_ENA_EL2, all of which had to be individually diagnosed and worked around. Developers tracking Apple Silicon Linux support can follow bring-up breakthroughs like this on daily.dev."}},{"@type":"Question","name":"Why does the WFI instruction crash Linux on Apple M4 and later chips?","acceptedAnswer":{"@type":"Answer","text":"On M4 and later Apple Silicon, the WFI (Wait For Interrupt) and WFIT instructions zero out CPU registers x0-x31 upon execution, which violates the ARM64 specification requiring WFI not to cause loss of architectural state. On M1-M3 chips this behavior could be disabled via a chicken bit, but on M4 that bit appears locked or removed, so a workaround replacing WFI/WFIT with NOP, and later a dedicated kernel bootarg, was needed. Anyone porting kernels to new Apple Silicon chips can track these errata fixes as they land upstream via daily.dev."}},{"@type":"Question","name":"How was the Apple Silicon WFI register-zeroing erratum fixed in mainline Linux?","acceptedAnswer":{"@type":"Answer","text":"Will Deacon proposed adding kernel support for a bootarg that disables WFI-based idle, allowing m1n1 to conditionally pass that bootarg only on bare-metal machines with the broken WFI behavior, since detecting virtualization reliably was impractical. This mechanism, along with a WFxT override, has been merged into mainline Linux and m1n1, letting Linux boot natively with all cores on M4, M4 Pro, M4 Max, and M5 Macs. Kernel contributors weighing errata-handling strategies can find deep technical write-ups like this through daily.dev."}}]}
```

