Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v5 0/5] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE
@ 2026-09-16  9:17 srinath.parvathaneni
  2026-09-16  9:17 ` [PATCH v5 1/5] " srinath.parvathaneni
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: srinath.parvathaneni @ 2026-09-16  9:17 UTC (permalink / raw)
  To: gdb-patches
  Cc: simark, luis.machado.foss, thiago.bauermann, guinevere,
	Ezra.Sitorus, Matthieu.Longo, peter.maydell,
	Srinath Parvathaneni

From: Srinath Parvathaneni <srinath.parvathaneni@arm.com>

Changes v4 -> V5:

Patch 1:
* Remove "struct" from the all declarations.
* Use the gdb::array_view overload of store_unsigned_integer when
  storing/featching the pseudo-register value.
* Make gdb/arch/aarch64-poe-linux.h check-include-guards.py compliant
  and move this file to patch 2 instead.
* Update the gdb/Makefine.in.
* <asm/hwcap.h> included inside the macro guard in nat/arch/aarch64-poe-linux.h.
* Add documentation for AArch64 POE register support, including the
  decoded POR_EL0 display, individual permission pseudo-registers and
  the POR register group.

Patch 2:
* Move the file gdb/arch/aarch64-poe-linux.h from patch 1 to patch 2.
* Update the gdb/Makefine.in.

Patch 3:
Patch 4:
Patch 5:
* No functional changes.
---------------------------------------------------------------------

Changes v3 -> v4:

Patch 1:
* Address review comments and update the POR_EL0 interface based on the
  discussion.
* Keep POR_EL0 as a raw uint64 in the target description and move the
  permission decoding out of the XML.
* Add por_p0 through por_p15 pseudo-registers, with each pseudo-register
  mapping to the corresponding 4-bit field in POR_EL0.
* Add read/write support for the POE pseudo-registers. Writing a
  pseudo-register updates the corresponding field in POR_EL0.
* Add the "por" register group containing POR_EL0 and the POE
  pseudo-registers.
* Update the POR_EL0 display to omit zero valued fields and split long
  output across multiple lines.
* Add custom permission display for the POE pseudo-registers.

Patch 2:
* Address review comments.
* Rebase to use the generic gdb_si accessors for si_code, si_errno,
  si_addr and si_pkey.
* Fix the SIGSEGV comment and mark the protection-key diagnostic for
  translation.

Patch 3:
* Rebased.
* No functional changes.

Patch 4:
* Rebased.
* Update the patch subject to mention both core file and signal frame
  support.
* Address review comments.

Patch 5:
* Address review comments.
* Add a POE signal frame test to verify that POR_EL0 is restored from
  the saved signal context while unwinding.
* Add tests for the new "por" register group and POE pseudo-registers.
* Use "require allow_aarch64_poe_tests" in the POE tests.
* Remove the stray aarch64-poe-sigsegv. file.
* Update the tests for the new POR_EL0 interface.

-----------------------------
Changes v2 -> v3:
Patch 1:
* Address review comments.
* After discussion, retain the _EL0 suffix for the POE register.
* Merge the POR_EL0 custom printing support from v2 Patch 2.
* Update the XML description to use the POR_EL0_FLAGS type for
  custom register printing.

Patch 2:
* Corresponds to v2 Patch 3.
* No functional changes.
* Approved by Thiago Jung Bauermann.

Patch 3:
* Corresponds to v2 Patch 4.
* No functional changes.
* Approved by Thiago Jung Bauermann.

Patch 4:
* The BFD/readelf changes from v2 Patch 5 have been posted separately
  to binutils-gdb and have since been approved and committed.
* Corresponds to v2 Patch 6.
* Address review comments on the GDB core file support.

Patch 5:
* Corresponds to v2 Patch 7.
* Address review comments.
* Update the tests to reflect the POR_EL0 custom string shown by
  `info registers por_el0` and `print $por_el0`.
* Fix aarch64-poe-core.exp test issues.

* Rebased onto current upstream master, including:
  * Matthieu Longo's "gdb: align siginfo_t with the Linux kernel definition".
  * My "gdb: Fix assignment to TYPE_CODE_FLAGS registers" patch.
----------------

Changes v1 -> v2:

* Rebased the SIGSEGV diagnostic support on Matthieu Longo's generic
  "siginfo_t" changes, using the new "_._addr_pkey.si_pkey" layout
  instead of introducing a target-specific "siginfo_t" extension.
* Split the original series into smaller, subsystem-specific patches:
  * GDB register support
  * POR_EL0 pretty printing
  * SIGSEGV diagnostics
  * gdbserver support
  * BFD/readelf core file support
  * GDB core file support
  * Testsuite
* Separated BFD/readelf and GDB core file support into independent
  patches.
* Retained FEAT_S1POE expansion as "Permission Overlay Extension" after internal discussion.
* Removed the POR_EL0 permission decoding string (e.g. `por_el0[pkey=<value>] = rwx`) from
  SIGSEGV diagnostics, as displaying permissions without also showing base and effective
  permissions can be misleading to users.
* Rebased the series onto current upstream master + Matthieu's patch
  "gdb: align siginfo_t with the Linux kernel definition"

-------------------------------

Hi,

This series adds support for the AArch64 Permission Overlay Extension
(FEAT_S1POE) in GDB and gdbserver.

The series adds support for the POR_EL0 register, allowing GDB to read
and write it using the Linux NT_ARM_POE regset.

It also adds POE pseudo-registers por_p0 through por_p15, with each
pseudo-register mapping to the corresponding 4-bit permission field in
POR_EL0. POR_EL0 and the pseudo-registers are added to the "por"
register group so they can be displayed together using
"info registers por".

The series also improves SIGSEGV diagnostics for Permission Overlay
violations, adds gdbserver support for POR_EL0, adds core file support
and restores POR_EL0 while unwinding through signal frames.

The BFD/readelf support for the NT_ARM_POE core note was posted
separately and has already been approved and committed:

commit d15490528409305f97004a2860fdb04543862774
Author: Srinath Parvathaneni srinath.parvathaneni@arm.com
Date: Thu Jul 2 13:57:25 2026 +0000

bfd/readelf: Add core file support for FEAT_S1POE

The series consists of the following patches:

[1/5] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE

Add support for reading and writing POR_EL0 using the Linux NT_ARM_POE
regset. Add por_p0 through por_p15 pseudo-registers for accessing the
individual permission fields in POR_EL0, and add the "por" register
group for displaying the POE register state.

[2/5] gdb: Improve SIGSEGV diagnostics for POE faults

Report the faulting address together with the associated protection key
for Permission Overlay violations.

[3/5] gdbserver/aarch64: Add POR_EL0 register support

Transfer POR_EL0 using the Linux NT_ARM_POE regset during remote
debugging.

[4/5] gdb/aarch64: Add core file and signal frame support for FEAT_S1POE

Restore POR_EL0 from Linux core files and from the POE context while
unwinding through signal frames.

[5/5] gdb/testsuite: Add FEAT_S1POE testcases

Add tests for POR_EL0 and the POE pseudo-registers, the "por" register
group, SIGSEGV diagnostics, fix-and-continue support, core file support
and signal frame unwinding.

The series has been tested natively and using gdbserver with remote GDB
on an FVP built using shrinkwrap with a Linux kernel configured with
CONFIG_ARM64_POE=y and a glibc version providing userspace POE support.

Regression tested on aarch64-none-linux-gnu with no regressions.

Ok for GDB master?

Srinath Parvathaneni (5):
  gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE
  gdb: Improve SIGSEGV diagnostics for POE faults
  gdbserver/aarch64: Add POR_EL0 register support
  gdb/aarch64: Add core file and signal frame support for FEAT_S1POE
  gdb/testsuite: Add FEAT_S1POE testcases

 gdb/Makefile.in                               |   2 +
 gdb/aarch64-linux-nat.c                       |  64 +++++
 gdb/aarch64-linux-tdep.c                      |  68 ++++-
 gdb/aarch64-tdep.c                            | 268 ++++++++++++++++++
 gdb/aarch64-tdep.h                            |  12 +
 gdb/arch/aarch64-poe-linux.h                  |  29 ++
 gdb/arch/aarch64.c                            |   4 +
 gdb/arch/aarch64.h                            |   8 +-
 gdb/doc/gdb.texinfo                           |  38 +++
 gdb/features/Makefile                         |   1 +
 gdb/features/aarch64-poe.c                    |  14 +
 gdb/features/aarch64-poe.xml                  |  11 +
 gdb/nat/aarch64-poe-linux.h                   |  30 ++
 gdb/testsuite/gdb.arch/aarch64-poe-core.exp   | 101 +++++++
 gdb/testsuite/gdb.arch/aarch64-poe-sigframe.c |  45 +++
 .../gdb.arch/aarch64-poe-sigframe.exp         |  55 ++++
 gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c  |  52 ++++
 .../gdb.arch/aarch64-poe-sigsegv.exp          |  55 ++++
 gdb/testsuite/gdb.arch/aarch64-poe.c          |  29 ++
 gdb/testsuite/gdb.arch/aarch64-poe.exp        |  60 ++++
 gdb/testsuite/lib/gdb.exp                     |  55 ++++
 gdbserver/linux-aarch64-low.cc                |  30 ++
 22 files changed, 1027 insertions(+), 4 deletions(-)
 create mode 100644 gdb/arch/aarch64-poe-linux.h
 create mode 100644 gdb/features/aarch64-poe.c
 create mode 100644 gdb/features/aarch64-poe.xml
 create mode 100644 gdb/nat/aarch64-poe-linux.h
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-core.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigframe.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigframe.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.exp
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe.exp

-- 
2.43.0


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

end of thread, other threads:[~2026-09-16  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16  9:17 [PATCH v5 0/5] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE srinath.parvathaneni
2026-09-16  9:17 ` [PATCH v5 1/5] " srinath.parvathaneni
2026-09-16  9:18 ` [PATCH v5 2/5] gdb: Improve SIGSEGV diagnostics for POE faults srinath.parvathaneni
2026-09-16  9:18 ` [PATCH v5 3/5] gdbserver/aarch64: Add POR_EL0 register support srinath.parvathaneni
2026-09-16  9:18 ` [PATCH v5 4/5] gdb/aarch64: Add core file and signal frame support for FEAT_S1POE srinath.parvathaneni
2026-09-16  9:18 ` [PATCH v5 5/5] gdb/testsuite: Add FEAT_S1POE testcases srinath.parvathaneni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox