Corellium, a software company specializing in virtualization solutions, has managed to port Linux to an Apple M1-based PC and even succeeded in making almost all the system peripherals work. In the process, Corellium discovered several interesting details about Apple’s M1 processor and the system architecture.
A couple of weeks ago, we reported that a startup called Corellium had managed to run Linux on an Apple M1-based computer. Back then, the operating system ran, but it did not support many things, essentially making the PC unusable to a large degree. Recently the company finally managed to make most of the things (including Wi-Fi) work, which means that Linux can now be used on the latest Macs. But the whole project of running a non-Apple OS on such computers has an interesting side effect as it reveals how different Apple’s SoCs are compared to other Arm-based architectures.
Loads of Proprietary Technologies
It's no secret that Apple has focused on building its own Arm-based microarchitectures to offer unbeatable performance with its iPhones and iPads for quite a while now. Unlike its rivals, the company did not throw in more cores, instead improving its cores' single-core/single-thread performance. In addition to custom cores, Apple apparently uses a highly custom system architecture too, according to Corellium.
When virtually all 64-bit Arm-based systems bootup, they call firmware through an interface called PSCI, but in the case of the M1, the CPU cores start at an address specified by an MMIO register and then start to run the kernel. Furthermore, Apple systems also use a proprietary Apple Interrupt Controller (AIC) that is not compatible with Arm’s standards. Meanwhile, the timer interrupts are connected to the FIQ, an obscure architectural feature primarily used on 32-bit Arm systems that is not compatible with Linux.
To make various processors in an M1-powered PC interact with each other, the OS has to provide a set of inter-processor interrupts (IPIs). Previously IPIs were handled just like traditional IRQs using MMIO accesses to the AIC, but in the case of the M1, Apple uses processor core registers to dispatch and acknowledge IPIsas they rely on FIQs.
Apple’s oddities do not end there. For example, Apple’s Wi-Fi/Bluetooth controller connects to the SoC using a non-standard PCIe-based protocol (which fortunately was supported by Corellium virtualization software). To make matters more complicated, Apple’s PCIe and the integrated Synopsys DWC3 USB controller use the company’s proprietary input–output memory management unit (IOMMU) called device address resolution table (DART). Furthermore, Apple’s I2C has a custom firmware that uses an exclusive protocol, which thwarted using the USB Type-A ports.
Using a proprietary system architecture is not something new for Apple, but it will make it much harder to port other operating systems to its platforms as well as running those OSes in virtualization mode. Recently a developer managed to make Microsoft’s upcoming Windows 10X run on an Apple M1-based system using QEMU virtualization, but this OS is not yet final, and it is unclear how stable it is. Furthermore, Windows 10X does not run Win32 apps, making it less valuable for some users.
Running Windows 10 or Linux on an Apple Mac may not be crucially important for most Mac owners. But a complicated system architecture featuring multiple proprietary technologies will likely make it harder to develop certain kinds of software and hardware for Arm-based Macs.