Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis <luis.machado.foss@gmail.com>
To: Ezra.Sitorus@arm.com, gdb-patches@sourceware.org
Cc: thiago.bauermann@linaro.org
Subject: Re: [PATCH v3 2/6] gdbserver/aarch64: Enable FPMR for AArch64 in gdbserver on Linux
Date: Mon, 27 Oct 2025 22:26:59 +0000	[thread overview]
Message-ID: <c268784c-6e59-4f39-a50b-ce0bbc42f29c@gmail.com> (raw)
In-Reply-To: <20251021150300.59860-3-Ezra.Sitorus@arm.com>

On 21/10/2025 16:02, Ezra.Sitorus@arm.com wrote:
> From: Ezra Sitorus <ezra.sitorus@arm.com>
> 
> Add support for FPMR in gdbserver.
> ---
> Changes from v1->v2:
> * Addressed comments/whitespace/formatting issues.
> * gdb/arch/aarch64.h: operator() takes fpmr into account now.
> * Defined HWCAP2_FPMR in gdb/arch/aarch64.h
> 
> Changes from v2-v3:
> * Formatting fixes.
> * Moved initialisation of fpmr variables closer to where they are used.
> 
> Ezra
> 
>   gdbserver/linux-aarch64-low.cc | 29 +++++++++++++++++++++++++++++
>   1 file changed, 29 insertions(+)
> 
> diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
> index 9d3ac803e7b..d63f3e2ad2c 100644
> --- a/gdbserver/linux-aarch64-low.cc
> +++ b/gdbserver/linux-aarch64-low.cc
> @@ -248,6 +248,26 @@ aarch64_store_fpregset (struct regcache *regcache, const void *buf)
>     supply_register (regcache, AARCH64_FPCR_REGNUM, &regset->fpcr);
>   }
>   
> +/* Fill BUF with the FPMR register set from the regcache.  */
> +
> +static void
> +aarch64_fill_fpmr_regset (struct regcache *regcache, void *buf)
> +{
> +  uint64_t *fpmr = (uint64_t *) buf;
> +  int fpmr_regnum = find_regno (regcache->tdesc, "fpmr");
> +  collect_register (regcache, fpmr_regnum, fpmr);
> +}
> +
> +/* Store the FPMR register set to regcache.  */
> +
> +static void
> +aarch64_store_fpmr_regset (struct regcache *regcache, const void *buf)
> +{
> +  uint64_t *fpmr = (uint64_t *) buf;
> +  int fpmr_regnum = find_regno (regcache->tdesc, "fpmr");
> +  supply_register (regcache, fpmr_regnum, fpmr);
> +}
> +
>   /* Store the pauth registers to regcache.  */
>   
>   static void
> @@ -879,6 +899,10 @@ static struct regset_info aarch64_regsets[] =
>     { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_TAGGED_ADDR_CTRL,
>       0, OPTIONAL_REGS,
>       aarch64_fill_mteregset, aarch64_store_mteregset },
> +  /* Floating Point Mode Register (FPMR).  */
> +  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_FPMR,
> +    0, OPTIONAL_REGS,
> +    aarch64_fill_fpmr_regset, aarch64_store_fpmr_regset },
>     /* TLS register.  */
>     { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_TLS,
>       0, OPTIONAL_REGS,
> @@ -954,6 +978,10 @@ aarch64_adjust_register_sets (const struct aarch64_features &features)
>   	  if (features.gcs_linux)
>   	    regset->size = sizeof (user_gcs);
>   	  break;
> +	case NT_ARM_FPMR:
> +	  if (features.fpmr)
> +	    regset->size = sizeof (uint64_t);
> +	  break;
>   	default:
>   	  gdb_assert_not_reached ("Unknown register set found.");
>   	}
> @@ -986,6 +1014,7 @@ aarch64_target::low_arch_setup ()
>         features.mte = linux_get_hwcap2 (pid, 8) & HWCAP2_MTE;
>         features.tls = aarch64_tls_register_count (tid);
>         features.gcs = features.gcs_linux = linux_get_hwcap (pid, 8) & HWCAP_GCS;
> +      features.fpmr = linux_get_hwcap2 (pid, 8) & HWCAP2_FPMR;
>   
>         /* Scalable Matrix Extension feature and size check.  */
>         if (linux_get_hwcap2 (pid, 8) & HWCAP2_SME)

This is OK. Thanks!

Approved-By: Luis Machado <luis.machado.foss@gmail.com>

  reply	other threads:[~2025-10-27 22:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 15:02 [PATCH v3 0/6] gdb/aarch64: Support for FPMR Ezra.Sitorus
2025-10-21 15:02 ` [PATCH v3 1/6] gdb/aarch64: Enable FPMR for AArch64 in gdb on Linux Ezra.Sitorus
2025-10-27 22:32   ` Luis
2025-10-21 15:02 ` [PATCH v3 2/6] gdbserver/aarch64: Enable FPMR for AArch64 in gdbserver " Ezra.Sitorus
2025-10-27 22:26   ` Luis [this message]
2025-10-21 15:02 ` [PATCH v3 3/6] gdb/aarch64: signal frame support for fpmr Ezra.Sitorus
2025-10-27 22:25   ` Luis
2025-10-21 15:02 ` [PATCH v3 4/6] gdb/aarch64: core file support for FPMR Ezra.Sitorus
2025-10-27 22:23   ` Luis
2025-10-21 15:02 ` [PATCH v3 5/6] gdb/aarch64: Tests " Ezra.Sitorus
2025-10-27 22:19   ` Luis
2025-10-21 15:03 ` [PATCH v3 6/6] gdb/doc: Document AArch64 FPMR support Ezra.Sitorus
2025-10-21 15:35   ` Eli Zaretskii
2025-10-22  9:25     ` Ezra Sitorus
2025-10-22 11:53       ` Eli Zaretskii
2025-10-27 22:08   ` Luis

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=c268784c-6e59-4f39-a50b-ce0bbc42f29c@gmail.com \
    --to=luis.machado.foss@gmail.com \
    --cc=Ezra.Sitorus@arm.com \
    --cc=gdb-patches@sourceware.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