This is an RFC patch for the on going effort to support SVE registers access on AArch64 Linux. This patch lays down the structure and major parts of the implementation and seeks community feedback on overall design approach more specifically to the generic areas of gdb-remote process, register infos and register context classes.
The Scalable Vector Extension (SVE) is an optional extension introduced by the ARMv8.2 architecture and can be implemented by underlying hardware AArch64 execution state. SVE has introduced 32 Z registers (Z0..Z31), 16 P register (P0..P15) and an FFR register. All these registers can change their size dynamically during execution. SVE register sizes is governed by currently set vector length in multiples of 16 bytes. Z register has a 16 byte default size and its size can increase in multiples of 16 bytes upto 128 bytes. While size of P and FFR registers is equal to size of Z register divided by 8. Linux tracks SVE register per thread and each thread can have its own setting of vector length upon which its size is decided.
First part of this implementation deals with adding capability for dynamic size/offset update in register info description hosted by gdb-remote process and also on native Linux side. Also we have to make these register description per_thread so that they can have their own size and offset.
Also there has to be a way to exchange update size information between remote target and host. This is where VG (Vector Granule) pseudo register comes in, VG is the size of a Z register in 8 bytes (64bits) multiples. This information is read from PTRACE and sent back via expedited registers list. We have altered expedited register list to send a custom register set other than the register set at index 0 which is choosen by default. Once read by the host VG will help updated register sizes and offsets in DynamicRegisterInfos hosted by each gdb-remote thread.
Similarly on native size there is ConfigureRegisterContext function which will update register infos accordingly. Rest of code is implementation of register infos for SVE, some modifications to register infos to support SVE and register context linux ptrace access routines.
I am still working on some areas like offset sync and register data resizing. Looking forward to hear your feedback.