I am more reading this as 'we just enabled compilation for Apple M1 but it is highly experimental, use at your own risk until it is properly fixed'.
I think you misinterpreted their stance.
What would be needed though is to have two copies of the system libraries in such a case, targeting different ABIs. That's of course very unlikely to happen.
Arm64e has the exact same abi as arm64, but in arm64 mode the pac instructions are no ops.
Otherwise as the parent says apple would need multiple copies of the system libraries.
> Software developers creating platform-independent code are advised to avoid using r18 if at all possible. Most compilers provide a mechanism to prevent specific registers from being used for general allocation; portable hand-coded assembler should avoid it entirely. It should not be assumed that treating the register as callee-saved will be sufficient to satisfy the requirements of the platform. Virtualization code must, of course, treat the register as they would any other resource provided to the virtual machine.
From: https://github.com/ARM-software/abi-aa/blob/2bcab1e3b22d5517...
On Darwin, x18 is used as a scratch register in context switches on hardware where Meltdown mitigations are needed.
As such, it is cleaned on each ctx switch on that hardware.
On M1, it's currently usable by applications, but that is not part of the ABI contract and might change at any time without notice.
On Windows, x18 is the TEB (thread environment block) register. It must as such _not_ be touched by apps either.
I’m confused. x18 is an ARM register, but I thought Meltdown only affected x86 chips. Were iOS devices vulnerable to Meltdown too? Or did you mean not x18 specifically but some equivalent OS-reserved x86 register?
However, due to specific features of the Arm architecture, it was patchable without a significant performance hit.
(see this section: https://siguza.github.io/KTRR/#meltdownspectre-mitigations-1..., which made the need for actually doing a page table switch avoidable)
X18 is very specifically called out as “for the platform: do not use”, though, so things like GNU MP [1] moaning that Apple hasn’t specified how they use x18, and them using it anyway are just ridiculous.
‘While we added support for Apple's new Arm based computers, our support has a problem. The problem is that Apple reserves CPU register x18, but GMP's mpn/arm64 assembly code uses that register. While GMP runs fine in our tests, we expect things to go awry in some execution situation. (Apple has not been kind enough to specify how they use x18. Therefore, we don't know what the consequences of using x18 might be.)’
[1] https://gmplib.org/