Hacker News new | ask | show | jobs
by dmitrygr 2156 days ago
Nope, the writers are just wrong. It is not a random value, and it is not arbitrary

"DC ZVA" always zeroes exactly one data cache line. That is the size. And you can easily get that size from an appropriate userspace-readable register. See for yourself: https://developer.arm.com/docs/ddi0595/h/aarch64-system-inst... and https://developer.arm.com/docs/ddi0595/h/aarch64-system-regi...

You are not expected to use it anyways. Your libc is, in its implementation of memset(), and it will properly query and use it.

Not only that, but since ARMv8.6 this instr, AND the reg you can read to get its size are both trappable by hypervisors (using HFGITR_EL2 and HFGRTR_EL2 fine-grained-trap regs respectively). See https://developer.arm.com/docs/ddi0595/h/aarch64-system-regi... and https://developer.arm.com/docs/ddi0595/h/aarch64-system-regi...