[all-commits] [llvm/llvm-project] 43812c: [lldb][AArch64] Linux corefile support for SME

David Spickett via All-commits all-commits at lists.llvm.org
Thu Sep 21 05:24:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43812c8c87b1c14bbcd160d613b7d8a60c21f260
      https://github.com/llvm/llvm-project/commit/43812c8c87b1c14bbcd160d613b7d8a60c21f260
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

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

  Log Message:
  -----------
  [lldb][AArch64] Linux corefile support for SME

This adds the ability to read streaming SVE registers,
ZA, SVCR and SVG from core files.

Streaming SVE is in a new note NT_ARM_SSVE but otherwise
has the same format as SVE. So I've done the same as I
did for live processes and reused the existing SVE state
with an extra state for the mode variable.

ZA is in a note NT_ARM_ZA and again the handling matches
live processes. Except that it gets setup only once. A
disabled ZA reads as 0s as usual.

SVCR and SVG are pseudo registers, generated from the notes.

An important detail is that the notes represent what
you would have got if you read from ptrace at the time of
the crash.

This means that for a corefile in non-streaming mode,
there is still an NT_ARM_SSVE note and we check the header
flags to tell if it is active. We cannot just say if you
have the note you're in streaming mode.

The kernel does not provide register values for the inactive
mode and even if it did, they would be undefined, so if we find
streaming state, we ignore the non-streaming state.

Same for ZA, a disabled ZA still has the header in the note.

The tests do not cover all combinations but enough different
vector lengths, modes and ZA states to be confident.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D158500




More information about the All-commits mailing list