[all-commits] [llvm/llvm-project] 0d0ca5: [lldb][AArch64] Read SME2's ZT0 register from Linu...

David Spickett via All-commits all-commits at lists.llvm.org
Thu Nov 2 08:56:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d0ca51ffe1002cec3b1b7a332e290176b650390
      https://github.com/llvm/llvm-project/commit/0d0ca51ffe1002cec3b1b7a332e290176b650390
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-11-02 (Thu, 02 Nov 2023)

  Changed paths:
    M lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
    M lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
    M lldb/test/API/linux/aarch64/sme_core_file/TestAArch64LinuxSMECoreFile.py
    M lldb/test/API/linux/aarch64/sme_core_file/core_0_16_32_1
    M lldb/test/API/linux/aarch64/sme_core_file/core_0_32_16_0
    M lldb/test/API/linux/aarch64/sme_core_file/core_1_16_32_0
    M lldb/test/API/linux/aarch64/sme_core_file/core_1_32_16_1
    A lldb/test/API/linux/aarch64/sme_core_file/generate.sh
    M lldb/test/API/linux/aarch64/sme_core_file/main.c

  Log Message:
  -----------
  [lldb][AArch64] Read SME2's ZT0 register from Linux core files (#70934)

The ZT0 register is always 64 bytes in size so it is a lot easier to
handle than ZA which is scalable. In addition, reading an inactive ZT0
via ptrace returns all 0s, unlike ZA which returns no register data.

This means that a corefile from a process where ZA and ZT0 were inactive
still contains an NT_ARM_ZT note and we can simply say that if it's
there, then we should be able to read from it.

Along the way I removed a redundant check on the size of the ZA note. If
that note's size is < the ZA header size, we do not have SME, and
therefore could not have SME2 either.

I have added ZT0 to the existing SME core files tests. This means that
you need an SME2 system to generate them (Arm's FVP at this point). I
think this is a fair tradeoff given that this is all running in
simulation anyway and seperate ZT0 tests would be 99% identical copies
of the ZA only tests.




More information about the All-commits mailing list