-
Notifications
You must be signed in to change notification settings - Fork 13.5k
lldb-server crashes on startup on AArch64 which has SME but not SVE #138717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-lldb Author: David Spickett (DavidSpickett)
Relates to https://github.com//pull/135563
I'm running Arm's Foundation Model via shrinkwrap with the following added to the v9.5-a config:
Currently SME is disabled in the kernel but for issues that shouldn't break lldb, not like this anyway. So I have patched it back in:
The cpuinfo reported is:
Note all the This means the processor has SME but you cannot access the SVE register file outside of streaming mode or use SVE instructions. This is probably what the Apple M4 has, but I don't have one to confirm exactly. When I start lldb-server it crashes immediately:
If I symbolise this:
We crashed in something related to SVE registers. Probably we tried to lookup a register ID in an empty list, because lldb saw that we don't have SVE, and therefore didn't check for streaming SVE either. |
@llvm/issue-subscribers-backend-aarch64 Author: David Spickett (DavidSpickett)
Relates to https://github.com//pull/135563
I'm running Arm's Foundation Model via shrinkwrap with the following added to the v9.5-a config:
Currently SME is disabled in the kernel but for issues that shouldn't break lldb, not like this anyway. So I have patched it back in:
The cpuinfo reported is:
Note all the This means the processor has SME but you cannot access the SVE register file outside of streaming mode or use SVE instructions. This is probably what the Apple M4 has, but I don't have one to confirm exactly. When I start lldb-server it crashes immediately:
If I symbolise this:
We crashed in something related to SVE registers. Probably we tried to lookup a register ID in an empty list, because lldb saw that we don't have SVE, and therefore didn't check for streaming SVE either. |
Note that my kernel does include https://lore.kernel.org/linux-arm-kernel/[email protected]/ which fixes the CPU info, I have not tried an older kernel yet. |
Relevant quotes from the ARMARM:
So you can also think of this as "streaming SVE only", but the kernel has decided not to show it that way in the cpuinfo. I'm not sure myself what the proper term is, it's like there is a split between the SVE register state and FEAT_SVE the instructions themselves. Anyway, it is a legal configuration that's my point. |
#135563 get us further:
This is an example program that does not enter streaming mode, so the SVE registers not being available makes sense, though I don't know that it isn't an error on our part too. What's unexpected is the FP regs are missing. If we had SVE we would read them via the SVE context, so I expect we aren't falling back to the normal ptrace context for FP here. Will try an example with streaming mode enabled too. |
Entering streaming mode is more weird than I expected:
The before state makes some sense. We know that we have a form of SVE, so we're trying to use the SVE context to read the fp registers (I forget the reason for this, but it's what the kernel wants us to do). Of course that is going to return nothing, the fix will be to use the normal fp context. LLDB also doesn't support registers appearing and disappearing at runtime so even when we fix this, the normal SVE registers will be
Shouldn't be too difficult to fix if you can debug lldb-server itself remotely, and I want to see if I can get the tests for fp reading when SVE is present working in this "SME only" configuration. I can work on this but I have to look at recent kernel changes for SME (https://lists.infradead.org/pipermail/linux-arm-kernel/2025-May/1025549.html) first, and will be unavailable next week as well. |
Relates to #135563
I'm running Arm's Foundation Model via shrinkwrap with the following added to the v9.5-a config:
(normally it would use the docker runtime but I am inside of a docker container already)
The kernel and rootfs are built using the scripts in https://github.com/llvm/llvm-project/tree/main/lldb/scripts/lldb-test-qemu.
Currently SME is disabled in the kernel but for issues that shouldn't break lldb, not like this anyway. So I have patched it back in:
The cpuinfo reported is:
Note all the
sme.*
features and nosve.*
features.This means the processor has SME but you cannot access the SVE register file outside of streaming mode or use SVE instructions. This is probably what the Apple M4 has, but I don't have one to confirm exactly.
When I start lldb-server it crashes immediately:
If I symbolise this:
We crashed in something related to SVE registers. Probably we tried to lookup a register ID in an empty list, because lldb saw that we don't have SVE, and therefore didn't check for streaming SVE either.
The text was updated successfully, but these errors were encountered: