Quick Look at Rosetta on Linux
threedots.ovh
threedots.ovh
Unsurprisingly CPUz has a bit of trouble running and is unable to give much information, saying the CPU name is Apple Silicon, the spec is ARMv8, and the clock speed of 3.0 Ghz, but most everything is blank.
What a time to be alive! Imagine reading this in 2015 :D
There is one thing that doesn't work, and that is code that relies on floating point exceptions, which Rosetta does not correctly emulate. It's a curious oversight for a system that is otherwise beyond impressive.
I haven't tested yet whether this functionality works on Linux.
$ cat /System/Volumes/Data/Library/Apple/usr/share/rosetta/rosetta
translation is done
as preferred long in advance
rosetta idlesIn our case, the moment the M1 Macs came out, I have re-built our development images on ARM, but there are a few dependencies to proprietary software which is only provided for x64 and which I can't really support on ARM Macs ATM because running affected services through QEMU is no fun, especially as those are mostly about handling bulk data living in proprietary databases.
But if this comes close to what Rosetta can do on macOS, using it for those cases becomes feasible.
No idea, but I found this comment from last year which is interesting and goes towards answering your question: https://news.ycombinator.com/item?id=27077545
Like on x86, where there is the CPUID instruction, on an ARM CPU it is possible to determine what version and subversion of the ISA is implemented, and which optional features are implemented, by reading some special registers.
It is possible to make a program that on newer CPUs will take advantage of some features, but on older CPUs it will have a fall-back code path of lower performance.
Because Apple writes software only for their CPUs, they do not bother to write programs that will also run on CPUs made by others, which may lack some of the features implemented on Apple CPUs.
As mentioned in the parent article, Rosetta needs FEAT_FlagM, which is implemented only on ISA versions of Armv8.4-A or newer.
All the ARM cores licensed from the ARM company with the exception of those introduced in 2021 (and also NVIDIA Carmel and the last cores designed by Samsung before giving up), support only Armv8.2-A, and those older than Cortex-A55 (e.g. Cortex-A73, Cortex-A72, NVIDIA Denver) support only Armv8.0-A.
This leaves very few non-Apple CPUs which can execute Rosetta, i.e. only the latest smartphones of 2022 with Armv9.0-A CPUs (Cortex-X2, Cortex-A710, Cortex-A510) and the Graviton 3 servers with Armv8.4-A CPUs (Neoverse V1).
Besides the ISA level compatibility, there is also the problem with the standard peripherals, e.g. timers, which also may differ between ARM CPU implementations.
As explained in the parent article, Rosetta is not written to work with any timer frequency, but accepts only a few values, so it had to be tricked to work on Graviton 3.
Because on any ARM system it is possible to determine the frequency of the timers, it would have been possible to write Rosetta to work with any frequency, but again, there was no reason for Apple to make it more flexible, when they want it to run only on their hardware.
If the Rosetta binary is only available after a certain remote fad path is mapped, I would guess the kernel needs to be native Aarch.
what about oracle cloudtron alwaysfree vps?
No, the BCM2711 is only ARMv8-A, Rosetta needs ARMv8.2 or later
Shouldn't it eliminate it entirely? I'm pretty sure ARM guarantees sequential consistency on a single core, so if the app is limited to a single CPU (e.g. using taskset), there should be no issue.
The real problem is, performance will be degraded.
Compared to qemu performance will be awesome.
Not at all. Apple only makes HW for the Apple ecosystem an that's it. Just look at everything they sell from monitors to earphones. Their functionality is crippled when not used with Apple HW because they're dependent on the Apple ecosystem to run at their full feature set.
What makes you think they would suddenly reverse that? They're just not in the business of building and supporting non-Apple ecosystems.
EDIT:
It was a HN thread:
https://news.ycombinator.com/item?id=30729731
"I find it crazy because you know they developed all this hardware with Linux. Just release the darn code."
"Apple does bringup with Linux because the silicon team doesn’t necessarily want to deal with getting the Darwin team involved during validation."
Worth reading the whole thread, some interesting insights and insider(?) info.