[Lldb-commits] [lldb] [lldb][AArch64] Fix Apple M4 on Linux (PR #135563)

Marcel Laverdet via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 13 13:43:53 PDT 2025


https://github.com/laverdet created https://github.com/llvm/llvm-project/pull/135563

This architecture implements SSVE but does not implement SVE.

More information is included in #121693

cc: @DavidSpickett

>From 5c85083f41230ec83bd862ebf2723d03d9bcfb65 Mon Sep 17 00:00:00 2001
From: Marcel Laverdet <marcel at laverdet.com>
Date: Sun, 13 Apr 2025 15:41:56 -0500
Subject: [PATCH] [lldb][AArch64] Fix Apple M4 on Linux

This architecture implements SSVE but does not implement SVE.
---
 .../NativeRegisterContextLinux_arm64.cpp      | 22 +++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index 884c7d4b9e359..f540a160c901a 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -107,19 +107,19 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
     if (NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,
                                           native_thread.GetID(), &regset,
                                           &ioVec, sizeof(sve_header))
-            .Success()) {
+            .Success())
       opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSVE);
 
-      // We may also have the Scalable Matrix Extension (SME) which adds a
-      // streaming SVE mode.
-      ioVec.iov_len = sizeof(sve_header);
-      regset = NT_ARM_SSVE;
-      if (NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,
-                                            native_thread.GetID(), &regset,
-                                            &ioVec, sizeof(sve_header))
-              .Success())
-        opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSSVE);
-    }
+    // We may also have the Scalable Matrix Extension (SME) which adds
+    // a streaming SVE mode. Note that SVE and SSVE may implemented
+    // independently, which is true on Apple's M4 architecture.
+    ioVec.iov_len = sizeof(sve_header);
+    regset = NT_ARM_SSVE;
+    if (NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,
+                                          native_thread.GetID(), &regset,
+                                          &ioVec, sizeof(sve_header))
+            .Success())
+      opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSSVE);
 
     sve::user_za_header za_header;
     ioVec.iov_base = &za_header;



More information about the lldb-commits mailing list