This is also less of a QEMU problem and more just that ARM does not emulate well on x86_64 due to their designs.
This is also less of a QEMU problem and more just that ARM does not emulate well on x86_64 due to their designs.
ARM Linux is close to usable, however.
Only emulating the portion of the instruction set available from the userspace is another story though. At least the way Apple does it with Rosetta and Microsoft with whatever their thing is called, you don't even notice that an app is running under emulation. The only giveaway is that it takes a noticeable time to start for the first time while the code is being translated. It's truly impressive.
It seems the main obstacle is in paging where x86 4KB clashes with Apple 16KB (ARM/64 supports multiple sizes), so, 2-level paging canʼt aid and an emulator has to shadow-paging which is, definitely, much slower.
> Apple does it with Rosetta and Microsoft with whatever their thing is called, you don't even notice that an app is running under emulation.
But they still use a vendor-specific TSO support in hardware.
A simple approach would identify basic blocks in the code and translate them to an IR for an optimizing compiler back-end like LLVM.
Of course, you have to be careful with self-modifying code.