From: Thiago Jung Bauermann via Gdb <gdb@sourceware.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Luis <luis.machado.foss@gmail.com>,
gdb@sourceware.org,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Subject: Re: gdb support for SME-without-SVE ?
Date: Thu, 29 Jan 2026 04:12:01 +0000 [thread overview]
Message-ID: <87tsw59hwu.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA9ikDB3zeE5Jqg93+S+3GfWqDUcQefmiMDdrQYNS9uwLg@mail.gmail.com> (Peter Maydell's message of "Wed, 28 Jan 2026 16:20:33 +0000")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Wed, 28 Jan 2026 at 04:24, Thiago Jung Bauermann
> <thiago.bauermann@linaro.org> wrote:
>> I'm currently implementing SME-only (i.e. without SVE) support in GDB
>> for Linux userspace debugging. It's mostly done, I just need to test a
>> few things, polish the code and prepare the patches. I'm hoping to send
>> the patches next week.
>
> Let me know if a QEMU setup emulating "SME only" would be helpful
> for you with that.
It would indeed! If there's a branch I can build, it would make my
testing quicker, and the regression testing more complete.
>> Due to the limitations in the remote protocol that Luis mentioned below,
>> I can't run the tests against a remote target so I'm only focusing on
>> local debugging, unfortunately.
>
> What does gdb need to do differently for "SME only" vs "SME + SVE" ?
There are two changes:
1. GDB assumed that whenever SME was available, then SVE was too and it
would try to also fetch the SVE register set when it decided to fetch
the SME register set.
2. Since GDB pretends the SVE register set (i.e., the
org.gnu.gdb.aarch64.sve XML feature) is always there, when the SVE
register set is needed and the inferior isn't in streaming mode then
GDB needs to fetch/set the FPSIMD register set instead, and pretend
that VL is 128 bits as you mentioned.
> What I'm wondering is, if for the remote protocol we define/redefine:
> - org.gnu.gdb.aarch64.sve is how the Z registers are exposed; its
> 'vg' tells you the size of the Z regs (either "max size" as
> currently, or eventually "current size", 128 bits if Z regs
> not currently exposed)
> - org.gnu.gdb.aarch64.sme is how the ZA array is exposed; its
> 'svg' tells you the size of the ZA array
>
> then does this break something subtly ? I think with current gdb
> it would let you at least access all the registers without it
> falling over. gdb wouldn't be able to tell the difference between
> "SME only" and "SME + SVE" if we define things this way; but we
> could add a new thing somewhere if it needs that information.
I think that should work fine. If the stub can always provide and accept
values for the Z registers, and if the Z registers have the size that
the VG register says they should have then GDB will be happy.
The changes I mentioned above stem from the fact that ptrace() rejects
calls referencing the NT_ARM_SVE regset in SME-only, and only allow
NT_ARM_SSVE if the inferior is in streaming mode. The remote protocol
doesn't need to expose these restrictions.
--
Thiago
next prev parent reply other threads:[~2026-01-29 4:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 11:31 Peter Maydell via Gdb
2026-01-27 14:21 ` Simon Marchi via Gdb
2026-01-27 14:47 ` Peter Maydell via Gdb
2026-01-27 14:57 ` Simon Marchi via Gdb
2026-01-27 21:23 ` Peter Maydell via Gdb
2026-01-27 21:28 ` Simon Marchi via Gdb
2026-01-28 1:07 ` Luis via Gdb
2026-01-28 4:23 ` Thiago Jung Bauermann via Gdb
2026-01-28 8:02 ` Luis via Gdb
2026-01-28 16:20 ` Peter Maydell via Gdb
2026-01-29 4:12 ` Thiago Jung Bauermann via Gdb [this message]
2026-01-29 9:10 ` Peter Maydell via Gdb
2026-01-29 11:34 ` Peter Maydell via Gdb
2026-01-30 4:28 ` Thiago Jung Bauermann via Gdb
2026-01-30 9:41 ` Peter Maydell via Gdb
2026-01-30 12:29 ` Peter Maydell via Gdb
2026-01-30 16:16 ` Thiago Jung Bauermann via Gdb
2026-01-30 16:29 ` Peter Maydell via Gdb
2026-01-30 17:06 ` Thiago Jung Bauermann via Gdb
2026-01-30 17:17 ` Peter Maydell via Gdb
2026-01-30 18:18 ` Thiago Jung Bauermann via Gdb
2026-01-30 18:34 ` Peter Maydell via Gdb
2026-01-30 18:40 ` Thiago Jung Bauermann via Gdb
2026-01-30 18:59 ` Peter Maydell via Gdb
2026-01-30 18:59 ` Thiago Jung Bauermann via Gdb
2026-01-30 19:01 ` Peter Maydell via Gdb
2026-01-30 19:03 ` Thiago Jung Bauermann via Gdb
2026-02-02 11:01 ` Peter Maydell via Gdb
2026-02-02 14:06 ` Peter Maydell via Gdb
2026-02-02 20:43 ` Thiago Jung Bauermann via Gdb
2026-01-30 18:24 ` Luis via Gdb
2026-01-27 21:29 ` Andrew Pinski via Gdb
2026-01-28 0:42 ` Luis via Gdb
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=87tsw59hwu.fsf@linaro.org \
--to=gdb@sourceware.org \
--cc=luis.machado.foss@gmail.com \
--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