[v2,3/4] gdb/aarch64: record/replay support for RPRFM, PRFM (reg), PRFUM

Message ID 20260512231707.18123-4-Ezra.Sitorus@arm.com
State New
Headers
Series gdb/aarch64: record/replay support for AArch64 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Ezra Sitorus May 12, 2026, 11:17 p.m. UTC
  From: Ezra Sitorus <ezra.sitorus@arm.com>

The PRFM (register) instruction variant was unsupported. This is added
along with RPRFM and PRFUM.

No testcase has been added as these are hint instructions which don't
modify registers/memory.

The full testsuite was done on aarch64-none-linux-gnu without RPRFM.
The gdb.arch and gdb.reverse tests were run on Shrinkwrap with RPRFM
support.
---
 gdb/aarch64-tdep.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
  

Comments

Thiago Jung Bauermann May 15, 2026, 3:56 a.m. UTC | #1
<Ezra.Sitorus@arm.com> writes:

> From: Ezra Sitorus <ezra.sitorus@arm.com>
>
> The PRFM (register) instruction variant was unsupported. This is added
> along with RPRFM and PRFUM.
>
> No testcase has been added as these are hint instructions which don't
> modify registers/memory.
>
> The full testsuite was done on aarch64-none-linux-gnu without RPRFM.
> The gdb.arch and gdb.reverse tests were run on Shrinkwrap with RPRFM
> support.
> ---
>  gdb/aarch64-tdep.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Thank you for adding PRFUM support. You already had Luis' approval for
v1, here is mine as well:

Approved-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>

If you want you can go ahead and push this patch separately.
  

Patch

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index b10bba67..5c1f8af5 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -5914,6 +5914,11 @@  aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r)
       else
 	if (size_bits != 0x03)
 	  ld_flag = 0x01;
+	else if (size_bits == 0x3 && vector_flag == 0x0 && opc == 0x2)
+	  {
+	    /* PRFM (register) or RPRFM */
+	    return AARCH64_RECORD_SUCCESS;
+	  }
 	else
 	  return AARCH64_RECORD_UNKNOWN;
 
@@ -5944,7 +5949,7 @@  aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r)
 	  aarch64_insn_r->reg_rec_count = 1;
 	}
     }
-  /* Load/store register (immediate and unprivileged) instructions.  */
+  /* Load/store register (immediate and unprivileged) instructions and PRFUM.  */
   else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03
 	   && !insn_bit21)
     {
@@ -5963,7 +5968,11 @@  aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r)
 	if (size_bits != 0x03)
 	  ld_flag = 0x01;
 	else
-	  return AARCH64_RECORD_UNKNOWN;
+	  if (insn_bits10_11 == 0)
+	    /* PRFUM instruction.  */
+	    return AARCH64_RECORD_SUCCESS;
+      else
+	return AARCH64_RECORD_UNKNOWN;
 
       if (!ld_flag)
 	{