From: Eli Zaretskii <eliz@gnu.org>
To: Christina Joos <christina.joos@intel.com>
Cc: gdb-patches@sourceware.org, keiths@redhat.com
Subject: Re: [PATCH 1/1] gdb, gdbserver: Add Intel APX register support
Date: Sat, 25 Jul 2026 14:07:41 +0300 [thread overview]
Message-ID: <86zezftjia.fsf@gnu.org> (raw)
In-Reply-To: <20260725105335.2664219-2-christina.joos@intel.com> (message from Christina Joos on Sat, 25 Jul 2026 10:53:35 +0000)
> From: Christina Joos <christina.joos@intel.com>
> Cc: keiths@redhat.com
> Date: Sat, 25 Jul 2026 10:53:35 +0000
>
> From: "H.J. Lu" <hjl.tools@gmail.com>
>
> Intel Advanced Performance Extensions (APX) doubles the number of
> general-purpose registers (GPRs) from 16 to 32 (r16-r31).
>
> Those new 64-bit Extended GPRs (EGPRs) do not change the size of the
> XSAVE area, as they take up the space left behind by the deprecated
> MPX registers.
>
> In contrast to the legacy GPRS, EGPRs are not enabled by default in 64-bit
> mode but are xcr0 enabled based on APX_F Intel APX state. Define
> X86_XSTATE_APX_F to support this new configuration.
>
> Add gdb and gdbserver registers support for those new 64-bit EGPRs.
> Also add byte, word and dword pseudo register support.
>
> Co-Authored-By: Christina Joos <christina.joos@intel.com>
> ---
> gdb/NEWS | 4 +
> gdb/amd64-linux-tdep.c | 2 +
> gdb/amd64-tdep.c | 262 ++++++++++++++----
> gdb/amd64-tdep.h | 2 +
> gdb/arch/amd64.c | 4 +
> gdb/arch/x86-linux-tdesc-features.c | 1 +
> gdb/doc/gdb.texinfo | 5 +
> gdb/features/Makefile | 1 +
> gdb/features/i386/64bit-apx.c | 29 ++
> gdb/features/i386/64bit-apx.xml | 26 ++
> gdb/i386-tdep.c | 32 ++-
> gdb/i386-tdep.h | 26 ++
> gdb/i387-tdep.c | 105 ++++++-
> gdb/i387-tdep.h | 6 +
> gdb/nat/x86-xstate.c | 1 +
> gdb/target-debug.h | 1 +
> gdb/testsuite/gdb.arch/amd64-apx-core.c | 88 ++++++
> gdb/testsuite/gdb.arch/amd64-apx-corefile.c | 71 +++++
> gdb/testsuite/gdb.arch/amd64-apx-corefile.exp | 67 +++++
> gdb/testsuite/gdb.arch/amd64-apx.c | 66 +++++
> gdb/testsuite/gdb.arch/amd64-apx.exp | 77 +++++
> gdb/testsuite/lib/gdb.exp | 58 ++++
> gdbserver/i387-fp.cc | 43 +++
> gdbserver/linux-x86-low.cc | 4 +-
> gdbsupport/x86-xstate.h | 12 +-
> 25 files changed, 931 insertions(+), 62 deletions(-)
> create mode 100644 gdb/features/i386/64bit-apx.c
> create mode 100644 gdb/features/i386/64bit-apx.xml
> create mode 100644 gdb/testsuite/gdb.arch/amd64-apx-core.c
> create mode 100644 gdb/testsuite/gdb.arch/amd64-apx-corefile.c
> create mode 100644 gdb/testsuite/gdb.arch/amd64-apx-corefile.exp
> create mode 100644 gdb/testsuite/gdb.arch/amd64-apx.c
> create mode 100644 gdb/testsuite/gdb.arch/amd64-apx.exp
Thanks.
> diff --git a/gdb/NEWS b/gdb/NEWS
> index 8f40ca5cb11..5b3ba152188 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,10 @@
>
> *** Changes since GDB 17
>
> +* Support for Intel APX registers on amd64 GNU/Linux.
> + Support displaying and modifying Intel APX registers (Extended GPRs
> + $r16 - $r31) including byte, word and dword pseudo registers.
> +
> * Support for the Common Trace Format (CTF) has been removed. GDB now
> saves trace information exclusively in its own "tfile" format.
This part is okay.
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 0030698dcee..69a2d714299 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -50753,6 +50753,11 @@ amd64, 32 bits on amd64 with 32-bit pointer size (X32) and 32 bits on i386.
> Following the restriction of the Linux kernel, only @value{GDBN} for amd64
> targets makes use of this feature for now.
>
> +The @samp{org.gnu.gdb.i386.apx} feature is optional. It should describe
> +16 Extended General Purpose registers (@acronym{EGPRs})
> +@samp{r16} - @samp{r31} with 64 bits each. All @acronym{Intel APX}
> +registers are valid only on amd64.
This is also OK, but please use @acronym only for "APX", leaving the
"Intel" part outside of it.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
prev parent reply other threads:[~2026-07-25 11:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 10:53 [PATCH 0/1] Add Intel APX support Christina Joos
2026-07-25 10:53 ` [PATCH 1/1] gdb, gdbserver: Add Intel APX register support Christina Joos
2026-07-25 11:07 ` Eli Zaretskii [this message]
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=86zezftjia.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=christina.joos@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/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