public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
@ 2024-04-22  4:11 thiago.bauermann at linaro dot org
  2024-04-22  4:12 ` [Bug tdep/31666] " thiago.bauermann at linaro dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-04-22  4:11 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

            Bug ID: 31666
           Summary: Support aarch64 mops feature ops ( CPYF*, CPY*, SET*
                    and SETG*)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: thiago.bauermann at linaro dot org
  Target Milestone: ---

Starting with Arm v8.8/v9.3, a new architectural feature (FEAT_MOPS) provides
new instructions to perform memory copy and memory set operations in a
standardized way. There are specialized versions of memcpy, memmove and memset
using them in glibc 2.39.

These instructions appear as a sequence of 3: one prologue, one main and one
epilogue instruction. The AArch64 target of GDB needs two things to support
them:

1. Recognize the trio of instructions as one atomic sequence.
2. Recognize the instructions for record/replay.

Patches for both are being finalized and will be posted in the next few days.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
@ 2024-04-22  4:12 ` thiago.bauermann at linaro dot org
  2024-05-04  0:09 ` thiago.bauermann at linaro dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-04-22  4:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

Thiago Jung Bauermann <thiago.bauermann at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |aarch64

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
  2024-04-22  4:12 ` [Bug tdep/31666] " thiago.bauermann at linaro dot org
@ 2024-05-04  0:09 ` thiago.bauermann at linaro dot org
  2024-05-07  2:38 ` thiago.bauermann at linaro dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-05-04  0:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #1 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Hello,

Posted the patch series here:

https://inbox.sourceware.org/gdb-patches/20240504000521.314531-1-thiago.bauermann@linaro.org/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
  2024-04-22  4:12 ` [Bug tdep/31666] " thiago.bauermann at linaro dot org
  2024-05-04  0:09 ` thiago.bauermann at linaro dot org
@ 2024-05-07  2:38 ` thiago.bauermann at linaro dot org
  2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-05-07  2:38 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #2 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Posted v2:

https://inbox.sourceware.org/gdb-patches/20240507022249.554831-1-thiago.bauermann@linaro.org/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (2 preceding siblings ...)
  2024-05-07  2:38 ` thiago.bauermann at linaro dot org
@ 2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
  2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-07 21:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thiago Bauermann
<bauermann@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b995344c116e04bd6bfeaf53364cd791d0dae45d

commit b995344c116e04bd6bfeaf53364cd791d0dae45d
Author: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Date:   Sat Apr 27 18:38:22 2024 -0300

    gdb/aarch64: Disable displaced single-step for MOPS instructions

    The AArch64 MOPS (Memory Operation) instructions provide a standardised
    instruction sequence to perform a memset, memcpy or memmove.  A sequence is
    always composed of three instructions: a prologue instruction, a main
    instruction and an epilogue instruction.  As an illustration, here are the
    implementations of these memory operations in glibc 2.39:

      (gdb) disassemble/r
      Dump of assembler code for function __memset_mops:
      => 0x0000fffff7e8d780 <+0>:     d503201f        nop
         0x0000fffff7e8d784 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8d788 <+8>:     19c10443        setp    [x3]!, x2!, x1
         0x0000fffff7e8d78c <+12>:    19c14443        setm    [x3]!, x2!, x1
         0x0000fffff7e8d790 <+16>:    19c18443        sete    [x3]!, x2!, x1
         0x0000fffff7e8d794 <+20>:    d65f03c0        ret
      End of assembler dump.

      (gdb) disassemble/r
      Dump of assembler code for function __memcpy_mops:
      => 0x0000fffff7e8c580 <+0>:     d503201f        nop
         0x0000fffff7e8c584 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8c588 <+8>:     19010443        cpyfp   [x3]!, [x1]!, x2!
         0x0000fffff7e8c58c <+12>:    19410443        cpyfm   [x3]!, [x1]!, x2!
         0x0000fffff7e8c590 <+16>:    19810443        cpyfe   [x3]!, [x1]!, x2!
         0x0000fffff7e8c594 <+20>:    d65f03c0        ret
      End of assembler dump.

      (gdb) disassemble/r
      Dump of assembler code for function __memmove_mops:
      => 0x0000fffff7e8d180 <+0>:     d503201f        nop
         0x0000fffff7e8d184 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8d188 <+8>:     1d010443        cpyp    [x3]!, [x1]!, x2!
         0x0000fffff7e8d18c <+12>:    1d410443        cpym    [x3]!, [x1]!, x2!
         0x0000fffff7e8d190 <+16>:    1d810443        cpye    [x3]!, [x1]!, x2!
         0x0000fffff7e8d194 <+20>:    d65f03c0        ret
      End of assembler dump.

    The Arm Architecture Reference Manual says that "the prologue, main, and
    epilogue instructions are expected to be run in succession and to appear
    consecutively in memory".  Therefore this patch disables displaced stepping
    on them.

    The testcase verifies that MOPS sequences are correctly single-stepped.

    PR tdep/31666
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666
    Approved-By: Luis Machado <luis.machado@arm.com>
    Tested-By: Luis Machado <luis.machado@arm.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (3 preceding siblings ...)
  2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
@ 2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
  2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-07 21:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thiago Bauermann
<bauermann@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ebd06ca6b9bb2327e1269b52eb99b2f012faabf9

commit ebd06ca6b9bb2327e1269b52eb99b2f012faabf9
Author: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Date:   Sat Apr 20 23:18:26 2024 -0300

    gdb/aarch64: Add record support for MOPS instructions.

    There are two kinds of MOPS instructions: set instructions and copy
    instructions.  Within each group there are variants with minor
    differences in how they read or write to memory â e.g., non-temporal
    read and/or write, unprivileged read and/or write and permutations of
    those â but they work in the same way in terms of the registers and
    regions of memory that they modify.

    The new gdb.reverse/aarch64-mops.exp testcase verifies that MOPS
    instructions are recorded and correctly reversed.  Not all variants of the
    copy and set instructions are tested, since there are many and the record
    and replay target processes them in the same way.

    PR tdep/31666
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666
    Approved-By: Luis Machado <luis.machado@arm.com>
    Tested-By: Luis Machado <luis.machado@arm.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (4 preceding siblings ...)
  2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
@ 2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
  2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-07 21:51 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #5 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The gdb-15-branch branch has been updated by Thiago Bauermann
<bauermann@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8215789c478d3fc006a94d4e7c1273329aa8c773

commit 8215789c478d3fc006a94d4e7c1273329aa8c773
Author: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Date:   Sat Apr 27 18:38:22 2024 -0300

    gdb/aarch64: Disable displaced single-step for MOPS instructions

    The AArch64 MOPS (Memory Operation) instructions provide a standardised
    instruction sequence to perform a memset, memcpy or memmove.  A sequence is
    always composed of three instructions: a prologue instruction, a main
    instruction and an epilogue instruction.  As an illustration, here are the
    implementations of these memory operations in glibc 2.39:

      (gdb) disassemble/r
      Dump of assembler code for function __memset_mops:
      => 0x0000fffff7e8d780 <+0>:     d503201f        nop
         0x0000fffff7e8d784 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8d788 <+8>:     19c10443        setp    [x3]!, x2!, x1
         0x0000fffff7e8d78c <+12>:    19c14443        setm    [x3]!, x2!, x1
         0x0000fffff7e8d790 <+16>:    19c18443        sete    [x3]!, x2!, x1
         0x0000fffff7e8d794 <+20>:    d65f03c0        ret
      End of assembler dump.

      (gdb) disassemble/r
      Dump of assembler code for function __memcpy_mops:
      => 0x0000fffff7e8c580 <+0>:     d503201f        nop
         0x0000fffff7e8c584 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8c588 <+8>:     19010443        cpyfp   [x3]!, [x1]!, x2!
         0x0000fffff7e8c58c <+12>:    19410443        cpyfm   [x3]!, [x1]!, x2!
         0x0000fffff7e8c590 <+16>:    19810443        cpyfe   [x3]!, [x1]!, x2!
         0x0000fffff7e8c594 <+20>:    d65f03c0        ret
      End of assembler dump.

      (gdb) disassemble/r
      Dump of assembler code for function __memmove_mops:
      => 0x0000fffff7e8d180 <+0>:     d503201f        nop
         0x0000fffff7e8d184 <+4>:     aa0003e3        mov     x3, x0
         0x0000fffff7e8d188 <+8>:     1d010443        cpyp    [x3]!, [x1]!, x2!
         0x0000fffff7e8d18c <+12>:    1d410443        cpym    [x3]!, [x1]!, x2!
         0x0000fffff7e8d190 <+16>:    1d810443        cpye    [x3]!, [x1]!, x2!
         0x0000fffff7e8d194 <+20>:    d65f03c0        ret
      End of assembler dump.

    The Arm Architecture Reference Manual says that "the prologue, main, and
    epilogue instructions are expected to be run in succession and to appear
    consecutively in memory".  Therefore this patch disables displaced stepping
    on them.

    The testcase verifies that MOPS sequences are correctly single-stepped.

    PR tdep/31666
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666
    Approved-By: Luis Machado <luis.machado@arm.com>
    Tested-By: Luis Machado <luis.machado@arm.com>

    (cherry picked from commit b995344c116e04bd6bfeaf53364cd791d0dae45d)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (5 preceding siblings ...)
  2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
@ 2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
  2024-06-14 15:36 ` luis.machado at arm dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-07 21:51 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

--- Comment #6 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The gdb-15-branch branch has been updated by Thiago Bauermann
<bauermann@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8fb41483be64f5e606c0e8e22652960535406cb4

commit 8fb41483be64f5e606c0e8e22652960535406cb4
Author: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Date:   Sat Apr 20 23:18:26 2024 -0300

    gdb/aarch64: Add record support for MOPS instructions.

    There are two kinds of MOPS instructions: set instructions and copy
    instructions.  Within each group there are variants with minor
    differences in how they read or write to memory â e.g., non-temporal
    read and/or write, unprivileged read and/or write and permutations of
    those â but they work in the same way in terms of the registers and
    regions of memory that they modify.

    The new gdb.reverse/aarch64-mops.exp testcase verifies that MOPS
    instructions are recorded and correctly reversed.  Not all variants of the
    copy and set instructions are tested, since there are many and the record
    and replay target processes them in the same way.

    PR tdep/31666
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666
    Approved-By: Luis Machado <luis.machado@arm.com>
    Tested-By: Luis Machado <luis.machado@arm.com>

    (cherry picked from commit ebd06ca6b9bb2327e1269b52eb99b2f012faabf9)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (6 preceding siblings ...)
  2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
@ 2024-06-14 15:36 ` luis.machado at arm dot com
  2024-06-14 16:13 ` thiago.bauermann at linaro dot org
  2024-06-14 16:14 ` thiago.bauermann at linaro dot org
  9 siblings, 0 replies; 11+ messages in thread
From: luis.machado at arm dot com @ 2024-06-14 15:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

Luis Machado <luis.machado at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis.machado at arm dot com

--- Comment #7 from Luis Machado <luis.machado at arm dot com> ---
I suppose this is done now?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (7 preceding siblings ...)
  2024-06-14 15:36 ` luis.machado at arm dot com
@ 2024-06-14 16:13 ` thiago.bauermann at linaro dot org
  2024-06-14 16:14 ` thiago.bauermann at linaro dot org
  9 siblings, 0 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-06-14 16:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

Thiago Jung Bauermann <thiago.bauermann at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|HEAD                        |15.1
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
It is. I hadn't realised I was able to close tickets in this bugzilla.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tdep/31666] Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*)
  2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
                   ` (8 preceding siblings ...)
  2024-06-14 16:13 ` thiago.bauermann at linaro dot org
@ 2024-06-14 16:14 ` thiago.bauermann at linaro dot org
  9 siblings, 0 replies; 11+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-06-14 16:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31666

Thiago Jung Bauermann <thiago.bauermann at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #9 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Closing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-14 16:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-22  4:11 [Bug tdep/31666] New: Support aarch64 mops feature ops ( CPYF*, CPY*, SET* and SETG*) thiago.bauermann at linaro dot org
2024-04-22  4:12 ` [Bug tdep/31666] " thiago.bauermann at linaro dot org
2024-05-04  0:09 ` thiago.bauermann at linaro dot org
2024-05-07  2:38 ` thiago.bauermann at linaro dot org
2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
2024-06-07 21:39 ` cvs-commit at gcc dot gnu.org
2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
2024-06-07 21:51 ` cvs-commit at gcc dot gnu.org
2024-06-14 15:36 ` luis.machado at arm dot com
2024-06-14 16:13 ` thiago.bauermann at linaro dot org
2024-06-14 16:14 ` thiago.bauermann at linaro dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).