[PATCH v8 0/3] target/arm: Added support for SME register exposure to GDB

Vacha Bhavsar posted 3 patches 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250909161012.2561593-1-vacha.bhavsar@oss.qualcomm.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Peter Maydell <peter.maydell@linaro.org>
[PATCH v8 0/3] target/arm: Added support for SME register exposure to GDB
Posted by Vacha Bhavsar 5 months ago
The QEMU GDB stub does not expose the ZA storage SME register to GDB via
the remote serial protocol, which can be a useful functionality to debug SME
code. To provide this functionality in Aarch64 target, this patch registers the
SME register set with the GDB stub. To do so, this patch implements the
aarch64_gdb_get_sme_reg() and aarch64_gdb_set_sme_reg() functions to
specify how to get and set the SME registers, and the
arm_gen_dynamic_smereg_feature() function to generate the target
description in XML format to indicate the target architecture supports SME.
Finally, this patch includes a dyn_smereg_feature structure to hold this
GDB XML description of the SME registers for each CPU.

Additionally, this patch series increases the value of MAX_PACKET_LENGTH
to allow for remote GDB debugging of the ZA register when the vector
length is maximal.

We have chosen to drop the patch related to changing GDBState's line_buf
to a dynamically re-sizeable GString for the time being.

This patch also includes a test case for testing SME register exposure
to GDB, based off of the existing SVE test case for the gdbstub.

Vacha Bhavsar (3):
  target/arm: Increase MAX_PACKET_LENGTH for SME ZA remote gdb debugging
  target/arm: Added support for SME register exposure to GDB
  target/arm: Added test case for SME register exposure to GDB

-- 
2.34.1
Re: [PATCH v8 0/3] target/arm: Added support for SME register exposure to GDB
Posted by Peter Maydell 4 months, 3 weeks ago
On Tue, 9 Sept 2025 at 17:10, Vacha Bhavsar
<vacha.bhavsar@oss.qualcomm.com> wrote:
>
> The QEMU GDB stub does not expose the ZA storage SME register to GDB via
> the remote serial protocol, which can be a useful functionality to debug SME
> code. To provide this functionality in Aarch64 target, this patch registers the
> SME register set with the GDB stub. To do so, this patch implements the
> aarch64_gdb_get_sme_reg() and aarch64_gdb_set_sme_reg() functions to
> specify how to get and set the SME registers, and the
> arm_gen_dynamic_smereg_feature() function to generate the target
> description in XML format to indicate the target architecture supports SME.
> Finally, this patch includes a dyn_smereg_feature structure to hold this
> GDB XML description of the SME registers for each CPU.
>
> Additionally, this patch series increases the value of MAX_PACKET_LENGTH
> to allow for remote GDB debugging of the ZA register when the vector
> length is maximal.
>
> We have chosen to drop the patch related to changing GDBState's line_buf
> to a dynamically re-sizeable GString for the time being.
>
> This patch also includes a test case for testing SME register exposure
> to GDB, based off of the existing SVE test case for the gdbstub.
>
> Vacha Bhavsar (3):
>   target/arm: Increase MAX_PACKET_LENGTH for SME ZA remote gdb debugging
>   target/arm: Added support for SME register exposure to GDB
>   target/arm: Added test case for SME register exposure to GDB

Thanks, I have applied this version to target-arm.next.

I had to fix up quite a few style nits reported by scripts/checkpatch.pl:
for future contributions I would suggest running your patches through
it. The script is not infallible so you have to use some judgement
in deciding whether to make changes, but it catches simple issues
like trailing whitespace or mixing tabs and spaces in indentation.

-- PMM
Re: [PATCH v8 0/3] target/arm: Added support for SME register exposure to GDB
Posted by Vacha Bhavsar 4 months, 3 weeks ago
Noted, thank you!

On Tue, Sep 16, 2025 at 6:39 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Tue, 9 Sept 2025 at 17:10, Vacha Bhavsar
> <vacha.bhavsar@oss.qualcomm.com> wrote:
> >
> > The QEMU GDB stub does not expose the ZA storage SME register to GDB via
> > the remote serial protocol, which can be a useful functionality to debug
> SME
> > code. To provide this functionality in Aarch64 target, this patch
> registers the
> > SME register set with the GDB stub. To do so, this patch implements the
> > aarch64_gdb_get_sme_reg() and aarch64_gdb_set_sme_reg() functions to
> > specify how to get and set the SME registers, and the
> > arm_gen_dynamic_smereg_feature() function to generate the target
> > description in XML format to indicate the target architecture supports
> SME.
> > Finally, this patch includes a dyn_smereg_feature structure to hold this
> > GDB XML description of the SME registers for each CPU.
> >
> > Additionally, this patch series increases the value of MAX_PACKET_LENGTH
> > to allow for remote GDB debugging of the ZA register when the vector
> > length is maximal.
> >
> > We have chosen to drop the patch related to changing GDBState's line_buf
> > to a dynamically re-sizeable GString for the time being.
> >
> > This patch also includes a test case for testing SME register exposure
> > to GDB, based off of the existing SVE test case for the gdbstub.
> >
> > Vacha Bhavsar (3):
> >   target/arm: Increase MAX_PACKET_LENGTH for SME ZA remote gdb debugging
> >   target/arm: Added support for SME register exposure to GDB
> >   target/arm: Added test case for SME register exposure to GDB
>
> Thanks, I have applied this version to target-arm.next.
>
> I had to fix up quite a few style nits reported by scripts/checkpatch.pl:
> for future contributions I would suggest running your patches through
> it. The script is not infallible so you have to use some judgement
> in deciding whether to make changes, but it catches simple issues
> like trailing whitespace or mixing tabs and spaces in indentation.
>
> -- PMM
>