6 ms·
UTM is pretty cool QEMU's x86 emulation is outrageously slow compared to Rosetta2. Is it theoretically be possible to hook Rosetta2 for full x86 machine emulat
by gorkish 3y ago
UTM is pretty cool
QEMU's x86 emulation is outrageously slow compared to Rosetta2. Is it theoretically be possible to hook Rosetta2 for full x86 machine emulation (like oldschool vmware did before VT)?
- toxik 3y agoAIUI Rosetta 2 works by translating as much of the code as possible ahead of time, so you don’t get delays translation happening online, and you get speculative execution etc. IOW It won’t work on a VM.
- tpetry 3y agoLast years macOS release added support for rosetta within linux vms.
- WatchDog 3y agoThe docs for those interested https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta https://developer.apple.com/documentation/virtualization/run...
- zeusk 3y agoThat's only for userspace apps. In fact even on Mac, only userspace code can be handled by rosetta2. For most applications this isn't a problem but a lot of games these days come with kernel components for anti-cheat.
- wtallis 3y agoI would be surprised if kernel-level third-party anti-cheat is a thing on macOS.
- kergonath 3y agoI cannot imagine a game whose installation instructions start with “first, reboot your computer and disable SIP” would be very popular.
- pjmlp 3y agoNot on macOS, specially since Apple decided that in the long term only userspace drivers/extensions are allowed for third parties.
- vbezhenar 3y agoI don't think that working with proprietary piece of code which is not even allowed to be used for anything but proprietary virtualization.framework is very interesting for those who can pull that kind of implementation. Theoretically: why not? Kernel is not something drastically different from userspace. Sure, some rules are different, but I don't think that it's completely impossible to adapt Rosetta to the kernel. But practically: I doubt it. qemu is not supporting even ordinary Rosetta, last time I checked, despite that fact that it should be pretty trivial to implement.
- doctoboggan 3y ago"Docker Desktop for Mac" as the option to use rosetta 2 to run linux/amd64 containers on apple silicon Macs.
- maxmouchet 3y agoRosetta is used to run the amd64 binaries, but not the (arm) kernel of the Docker VM.
- zeusk 3y ago> Theoretically: why not? Kernel is not something drastically different from userspace. Sure, some rules are different, but I don't think that it's completely impossible to adapt Rosetta to the kernel. It's not impossible but very infeasible since kernel has critical sections where you can't take an interrupt or fault (leading to panic); such code sitting at the translation boundary would not work.
- gorkish 3y agoThis is why I mentioned "old vmware" which before VT handled these types of critical sections through an interpreting emulator while executing as many of the x86 instructions as possible unmodified. That is to say, they already did the hard part of breaking out the tricky bits. I was kind of hoping maybe QEMU had a similar strategy for x86-machine-on-x86-usermode without requiring virtualization extensions that could just be executed directly through rosetta (on macos or linux)
- api 3y agoParallels has a way to use Rosetta2 inside an ARM64 Linux VM to run x64 binaries, but it can occasionally be unstable. Usually works fine and way faster than qemu.
- cube2222 3y agoI believe that is actually a recently-added feature of the Hypervisor.Framework, not sure if parallels uses it under the hood. It's also been in Docker Desktop for a few months now, thanks to that.
- mook 3y agoAs the other comment mentioned, it might be using the feature from hvf: https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta https://developer.apple.com/documentation/virtualization/run...