4 ms·
M1 does have x86 compatible memory ordering: https://twitter.com/ErrataRob/status/1331735383193903104 https://twitter.com/ErrataRob/status/1331735383193903104
by liuliu 5y ago
M1 does have x86 compatible memory ordering: https://twitter.com/ErrataRob/status/1331735383193903104 https://twitter.com/ErrataRob/status/1331735383193903104
IMHO, this is the biggest hurdle for x86 emulation on ARM.
- a-dub 5y agoyeah i think the rub is that much of the internet world uses x86 containers/vms because so much backend infra is still x86 and that will probably stay the case for a long time. my understanding is that when you're on intel, vms are accelerated with this vt-x hardware support stuff that essentially runs the machine code in the vm on bare metal. before vt-x, vms were dog slow and involved running the code in a full software emulation of the target cpu which is slow because there's a whole layer of indirection that adds loads of instructions for every target instruction executed and breaks all the caching and branch prediction and such. the rosetta thing seems cool in that they essentially jit and cache translations of intel binaries that are executed under darwin, translating them once and caching the result, and it turns out they tweaked their chips to be intel like to make this translation lightweight... so you can run intel binaries from the darwin shell and after the first run, they're quite fast... but... the question is, are there effectively two layers of emulation that break each other's acceleration? the vm emulation and then the x86 processor emulation? can you run x86 vms in a vt-x like way, while taking advantage of rosetta's jit translation (and the caching of those results)? it seems really hard as the host machine would not have any knowledge of when a child vm is even launching a process, let alone its identity, and if it doesn't know these things, how would it know to jit that executable and save the result? seems you would need some sort of special hardware emulation support, but i'm just speculating... edit: it seems you could also do something by adding support in the guest os, but i have doubts as to how the maintainers would feel about such a thing!