mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
41040cf7c5
The in-memory representation of SVE and FPSIMD registers is different: the FPSIMD V-registers are stored as single 128-bit host-endian values, whereas SVE registers are stored in an endianness-invariant byte order. This means that the two representations differ when running on a big-endian host. But we blindly copy data from one representation to another when converting between the two, resulting in the register contents being unintentionally byteswapped in certain situations. Currently this can be triggered by the first SVE instruction after a syscall, for example (though the potential trigger points may vary in future). So, fix the conversion functions fpsimd_to_sve(), sve_to_fpsimd() and sve_sync_from_fpsimd_zeropad() to swab where appropriate. There is no common swahl128() or swab128() that we could use here. Maybe it would be worth making this generic, but for now add a simple local hack. Since the byte order differences are exposed in ABI, also clarify the documentation. Cc: Alex Bennée <alex.bennee@linaro.org> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Alan Hayward <alan.hayward@arm.com> Cc: Julien Grall <julien.grall@arm.com> Fixes: |
||
---|---|---|
.. | ||
acpi_object_usage.txt | ||
arm-acpi.txt | ||
booting.txt | ||
cpu-feature-registers.txt | ||
elf_hwcaps.txt | ||
hugetlbpage.txt | ||
legacy_instructions.txt | ||
memory.txt | ||
perf.txt | ||
pointer-authentication.txt | ||
silicon-errata.txt | ||
sve.txt | ||
tagged-pointers.txt |