[all-commits] [llvm/llvm-project] b8150c: [lldb][AArch64] Add SME2's ZT0 register (#70205)
David Spickett via All-commits
all-commits at lists.llvm.org
Wed Nov 1 03:40:40 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b8150c8f12fcb3c3c5e40611ddd883db1506be35
https://github.com/llvm/llvm-project/commit/b8150c8f12fcb3c3c5e40611ddd883db1506be35
Author: David Spickett <david.spickett at linaro.org>
Date: 2023-11-01 (Wed, 01 Nov 2023)
Changed paths:
M lldb/packages/Python/lldbsuite/test/lldbtest.py
M lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
M lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
M lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
M lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
M lldb/source/Plugins/Process/elf-core/RegisterUtilities.h
M lldb/test/API/commands/register/register/aarch64_dynamic_regset/TestArm64DynamicRegsets.py
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/save_restore/Makefile
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/save_restore/TestSMEZRegistersSaveRestore.py
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/save_restore/main.c
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/TestZAThreadedDynamic.py
A lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/main.c
R lldb/test/API/commands/register/register/aarch64_za_register/za_dynamic_resize/Makefile
R lldb/test/API/commands/register/register/aarch64_za_register/za_dynamic_resize/TestZAThreadedDynamic.py
R lldb/test/API/commands/register/register/aarch64_za_register/za_dynamic_resize/main.c
R lldb/test/API/commands/register/register/aarch64_za_register/za_save_restore/Makefile
R lldb/test/API/commands/register/register/aarch64_za_register/za_save_restore/TestZARegisterSaveRestore.py
R lldb/test/API/commands/register/register/aarch64_za_register/za_save_restore/main.c
Log Message:
-----------
[lldb][AArch64] Add SME2's ZT0 register (#70205)
SME2 is documented as part of the main SME supplement:
https://developer.arm.com/documentation/ddi0616/latest/
The one change for debug is this new ZT0 register. This register
contains data to be used with new table lookup instructions.
It's size is always 512 bits (not scalable) and can be
interpreted in many different ways depending on the instructions
that use it.
The kernel has implemented this as a new register set containing
this single register. It always returns register data (with no header,
unlike ZA which does have a header).
https://docs.kernel.org/arch/arm64/sme.html
ZT0 is only active when ZA is active (when SVCR.ZA is 1). In the
inactive state the kernel returns 0s for its contents. Therefore
lldb doesn't need to create 0s like it does for ZA.
However, we will skip restoring the value of ZT0 if we know that
ZA is inactive. As writing to an inactive ZT0 sets SVCR.ZA to 1,
which is not desireable as it would activate ZA also. Whether
SVCR.ZA is set will be determined only by the ZA data we restore.
Due to this, I've added a new save/restore kind SME2. This is easier
than accounting for the variable length ZA in the SME data. We'll only
save an SME2 data block if ZA is active. If it's not we can get fresh
0s back from the kernel for ZT0 anyway so there's nothing for us to
restore.
This new register will only show up if the system has SME2 therefore
the SME set presented to the user may change, and I've had to account
for that in in a few places.
I've referred to it internally as simply "ZT" as the kernel does in
NT_ARM_ZT, but the architecture refers to the specific register as "ZT0"
so that's what you'll see in lldb.
```
(lldb) register read -s 6
Scalable Matrix Extension Registers:
svcr = 0x0000000000000000
svg = 0x0000000000000004
za = {0x00 <...> 0x00}
zt0 = {0x00 <...> 0x00}
```
More information about the All-commits
mailing list