Re:The Arm64 memory tagging extension in Linux
by staticassertion on Monday October 19, 2020 @01:48PM
(#24828829)
> But that’s a lot of work to save a byte or two.
Is it? It's something like two xors on a register. If that's a byte or two per pointer (ie: it's pointer metadata that you'd have to store anyway, which I assume is the use case) that's actually a pretty significant win, and could help reduce cache pressure, thereby buying you back the performance (and then some).
Addresses are also XOR'd all the time with a secret as a mitigation, I don't know that there's much of an impact at all.
Of course, this doesn’t stop you from being able to[a], it just makes it harder.
[a]: The processor doesn’t know the “type” of a register’s value; It’s just bits. It could be a pointer, integer, floating point, etc. until you tell the processor to do something with it. So one could obviously use those extra bits to store data, then when a dereference is needed, store those bits in another register, dereference, then put the bits back. But that’s a lot of work to save a byte or two.
[0]: Intel SDM Volume 1 §3.3.7.1:
> In 64-bit mode, an address is considered to be in canonical form if address bits 63 through to the most-significant implemented bit by the microarchitecture are set to either all ones or all zeros.