4 ms·
Why is Apple virtualizing Intel, but is Intel not virtualizing Apple hardware?
by amelius 5y ago
Why is Apple virtualizing Intel, but is Intel not virtualizing Apple hardware?
- gruez 5y agoIntel is incumbent, so most software (short of ios/android apps) are already written/complied for x86. Because of this, there's no real need for intel/amd to support ARM.
- smoldesu 5y ago1. Smaller companies like Corellium have already tried making that mistake, and Apple sends their lawyer death squads to their doorstep every time they try pushing a new feature. 2. There aren't really any killer apps for ARM yet. ARM itself is a fine ISA, but the majority of consumer desktop software and server software is still x86 first (particularly on platforms that Intel sells for). Until that changes, I doubt Intel will really care all that much. When it does change, I'm inclined to believe that the rest of the industry will be eyeing even more minimal ISAs like RISC-V. That's mostly just speculation though.
- kmeisthax 5y agoWell, first off, Apple isn't virtualizing Intel, they're emulating it. "Virtualization" implies that your CPU has special hardware support for running a kernel as if it were a regular OS process; which almost never crosses architecture boundaries. Apple does have special support in M1 for certain x86 features like total store order, but most of the work is done in software to translate binaries to ARM64 before they are executed. They just omitted emulating anything beyond Intel macOS user-mode, because that's relatively easy and lightweight[0]. Intel doesn't virtualize Apple hardware because it doesn't make business sense and is questionably legal (see also: Corellium). Apple silicon is just-different-enough from a regular ARM64 design that anything that can actually boot macOS almost certainly exists purely to break the macOS license agreement. [0] Specifically, having all your code neatly packaged into executables and libraries means that you can AOT-compile nearly everything and not have to actually interpret or JIT x86 code. There's also no need to emulate, say, x86 context switches or page table walking; you just stop emulation, run the syscall on the ARM side, and then restart the emulation once that's done. Of course, they still have a JIT, just in case you decide to run a binary that also contains a JIT.
- marcan_42 5y ago> anything that can actually boot macOS almost certainly exists purely to break the macOS license agreement. Apple provides a hypervisor framework that emulates a standard ARM64 system and macOS ARM64 kernels that run on it. This is how macOS on Apple Silicon virtualization works. It's not really Apple Silicon, it's boring standard ARM on Apple Silicon. Soon after Apple started shipping these kernels, before it was even announced, someone tried it on QEMU on another platform and found it worked just fine in single user mode. The only catch is the macOS UI requires Metal, and paravirtualized graphics are implemented using serialized Metal passthrough. In other words, if you want to boot ARM64 macOS to a desktop, you have to implement Metal in your VM host.
- kmeisthax 5y agoAah, TIL. Do we have paravirtualized Metal support in Linux guests yet? That would probably neatly brush away any legal claims against third-party hosts for implementing it on non-Apple hardware.
- jsjohnst 5y ago> They just omitted emulating anything beyond Intel macOS user-mode, because that's relatively easy and lightweight Is it that? I would’ve assumed it’s because the patents hadn’t expired yet.
- kmeisthax 5y agoI'm pretty sure some of the AVX and SSE instructions are patented still, and those are accessible in user-mode and supported by Rosetta 2. Apple almost certainly was able to either brow-beat Intel into a license, or design around the claims of said patents[0]. FWIW Apple has UI strings for when Rosetta 2 is disabled, so they might have had to consider cases where their license expires or something. [0] Notably I have no idea if patent claims on a hardware instruction & it's associated implementation would automatically prohibit emulation of that instruction, or if emulation would be a separate patentable.
- olliej 5y agoMac simply isn't a significant part of intel's market, and running Mac apps (the things you'd want to emulate) essentially requires a macOS license, which means owning a Mac.