[Lldb-commits] [PATCH] D72251: [RFC] Support SVE registers access on AArch64 Linux

Muhammad Omair Javaid via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 6 03:50:11 PST 2020


omjavaid created this revision.
omjavaid added reviewers: labath, clayborg, jankratochvil, jasonmolenda.
omjavaid added a project: LLDB.
Herald added subscribers: kristof.beyls, tschuett.
Herald added a reviewer: rengolin.

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 <https://reviews.llvm.org/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.


https://reviews.llvm.org/D72251

Files:
  lldb/include/lldb/Host/common/NativeRegisterContext.h
  lldb/include/lldb/Utility/RegisterValue.h
  lldb/source/Plugins/Process/Linux/LinuxPTraceDefines_arm64sve.h
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
  lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
  lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
  lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h
  lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h
  lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h
  lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
  lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
  lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
  lldb/source/Plugins/Process/Utility/RegisterInfos_arm64_sve.h
  lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
  lldb/source/Utility/ARM64_DWARF_Registers.h
  lldb/source/Utility/ARM64_ehframe_Registers.h
  lldb/source/Utility/RegisterValue.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72251.236320.patch
Type: text/x-patch
Size: 92166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200106/28661c1a/attachment-0001.bin>


More information about the lldb-commits mailing list