From: Luis <luis.machado.foss@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: gdb-patches@sourceware.org,
Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Subject: Re: [PATCH] docs: Clarify gdb remote protocol AArch64 SVE and SME handling
Date: Fri, 13 Feb 2026 11:39:40 +0000 [thread overview]
Message-ID: <3624e27d-52f6-4523-b9e4-f41f6ca48548@gmail.com> (raw)
In-Reply-To: <CAFEAcA9vOQ8Mbc0YpH8yuWBpdKF2uAivD8qv3nLzt3P5ASNLnw@mail.gmail.com>
On 09/02/2026 09:36, Peter Maydell wrote:
> On Mon, 2 Feb 2026 at 23:41, Luis <luis.machado.foss@gmail.com> wrote:
>> On 30/01/2026 09:36, Peter Maydell wrote:
>>> When I said "for the Z registers" that was a perhaps confusing
>>> simplification. SME's "streaming SVE" mode still requires all of:
>>> - the z regs
>>> - the p predicate regs
>>> - the ffr register
>>> - fpsr
>>> - fpcr
>>> (because streaming SVE gives you a subset of the SVE2 instruction set).
>>>
>>> The only thing that becomes in some sense duplicated is that the
>>> 'vg' pseudoregister in org.gnu.gdb.aarch64.sve will always read
>>> the same as the 'svg' pseudoregister in org.gnu.gdb.aarch64.sme,
>>> because the Z reg size is always the same as the ZA array size.
>>> But the debugger doesn't really need to care about that, as long
>>> as it consistently uses org.gnu.gdb.aarch64.sve 'vg' for the Z
>>> reg length and org.gnu.gdb.aarch64.sme 'svg' for the ZA array size
>>> (which it must do already for the SVE + SME case).
>>>
>>
>> Thanks for clarifying it. That makes more sense.
>>
>>>> It might be cleaner to clearly separate SVE and SME features, adding
>>>> Z registers to a SME feature if needed when SVE is disabled. Or
>>>> something similar to that.
>>>
>>> The disadvantage here is that instead of "SME only remote debug
>>> just works with the existing gdb" we get "you will need a new
>>> gdb that understands the new features".
>>>
>>
>> Remote debug *kinda* just works, unfortunately. In reality remote
>> debugging with SVE/SME is not properly supported because the remote
>> target cannot communicate vg/svg changes to gdb, and that messes things
>> up badly.
>
> The vg/svg won't generally change without gdb knowing about it,
> though -- presumably gdb could read it whenever the target stops,
> even if there's no mechanism for actively reporting a change ?
>
The problem is the register buffer size changes according to the vg
size. If we let the program run on the remote and it eventually changes
vg, the next time it stops the remote will report a block of registers
with a size gdb is not expecting. So this is the problematic case.
>> It might not be a big issue for SVE itself, as we don´t usually change
>> vg mid-execution. But SME has SSVE and that tends to change vg/svg, so
>> it is more likely to run into issues.
>>
>> But yeah, putting that aside, I´d definitely like to make things work
>> with the current XML. Or make it work in a compatible way at least.
>>
>>>> I don't feel comfortable setting this is stone before we have a
>>>> patch that clarifies how this separation between SVE and SME is
>>>> achieved.
>>>
>>> I agree that we don't want to commit this until we're happy that
>>> it's the right thing. This patch is my attempt to put down in a
>>> concrete form how I think this should work.
>>>
>>> When you talk about "a patch that clarifies how this separation
>>> between SVE and SME is achieved", what do you mean? A patch to
>>> gdb? With this proposal, current gdb I think should work without
>>> changes. The changes Thiago has are all because of the way that
>>> the Linux ptrace API has chosen to represent SVE and SME, AIUI.
>>
>> We need a couple things from what I can see.
>>
>> First we need to teach gdb about SME without SVE, and that's what Thiago
>> is working on. I´d like to see that patch first before we adjust the
>> documentation for the SME-but-no-SVE mode. Just to make sure things match.
>>
>> The second one is addressing the remote debugging situation with the
>> changing vg/svg. Without that I'm afraid SVE/SME/SSVE remote debugging
>> will not go far. Yes, it will kinda work, but as soon as vg/svg changes
>> we will run into trouble.
>>
>> Until the second part is addressed, I'm a bit skeptical of documenting
>> things as if they really work for remote debugging.
>
> Thanks, that makes sense (though I would note that the documentation
> as it currently stands already implies that SVE and SME work for remote
> debugging).
>
Yes, it does. And that's on me for not documenting it more clearly. We
should use this opportunity to clarify things. If we take longer to fix
the remote situation, we can update the documentation to make the
situation clear.
> For the moment I would like to fix the QEMU gdbstub for the SVE + SME
> case, so that it at least reports the Z regs as having their actual
> maximum possible size (currently it reports them as having the max size
> for SVE only, even though it reports the 'vg' pseudoreg as being the
> SVE+SME current width).
What gdb expects is the remote reporting Z registers that match the
actual size based on vg (no streaming mode) or svg (streaming mode).
By maximum size, do you mean QEMU always reports whatever maximum we
have between vg/svg?
>
> (That's this QEMU patch:
> https://lore.kernel.org/qemu-devel/20260202133353.2231685-3-peter.maydell@linaro.org/
> )
>
> thanks
> -- PMM
next prev parent reply other threads:[~2026-02-13 11:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 18:11 Peter Maydell
2026-01-29 23:13 ` Luis
2026-01-30 9:36 ` Peter Maydell
2026-02-02 23:41 ` Luis
2026-02-09 9:36 ` Peter Maydell
2026-02-13 11:39 ` Luis [this message]
2026-02-13 12:15 ` Peter Maydell
2026-03-19 13:41 ` Peter Maydell
2026-03-20 3:02 ` Thiago Jung Bauermann
2026-03-20 9:25 ` Peter Maydell
2026-01-30 11:37 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3624e27d-52f6-4523-b9e4-f41f6ca48548@gmail.com \
--to=luis.machado.foss@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=thiago.bauermann@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox