Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] gdb, aarch64: cache pointer authentication masks per inferior
@ 2026-09-12 22:20 Luis Machado
  2026-09-12 22:20 ` [PATCH 1/2] " Luis Machado
  2026-09-12 22:20 ` [PATCH 2/2] gdb, aarch64: add selftest for the pauth mask cache Luis Machado
  0 siblings, 2 replies; 4+ messages in thread
From: Luis Machado @ 2026-09-12 22:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: thiago.bauermann

aarch64_remove_non_address_bits recomputes the pointer authentication
dmask/cmask on every call by walking the current inferior's thread
list, looking up its regcache, and reading the masks from the target.
This function is called from memory_xfer_partial for every memory
transfer GDB performs, as well as from the watchpoint and breakpoint
address-masking hooks, so the lookup happens far more often than the
masks can possibly change (they are fixed for the life of a process
and shared by all of its threads).

Patch 1 caches the computed mask per inferior instead of recomputing
it on every call, only populating the cache when a thread is stopped
so a transient "thread running" state never gets cached as a
permanent answer, and invalidates the cache on inferior exit,
inferior appeared, and exec.

Patch 2 adds a selftest that verifies the cache actually avoids
redundant target register fetches across a simulated resume/stop
cycle.

Tested on aarch64-linux with no regressions, though the testing was
done on a target without PAC support. It would be good to also
validate on a PAC-enabled target to be sure.

Luis Machado (2):
  gdb, aarch64: cache pointer authentication masks per inferior
  gdb, aarch64: add selftest for the pauth mask cache

 gdb/aarch64-tdep.c | 224 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 182 insertions(+), 42 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-09-14 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-12 22:20 [PATCH 0/2] gdb, aarch64: cache pointer authentication masks per inferior Luis Machado
2026-09-12 22:20 ` [PATCH 1/2] " Luis Machado
2026-09-14 15:24   ` Simon Marchi
2026-09-12 22:20 ` [PATCH 2/2] gdb, aarch64: add selftest for the pauth mask cache Luis Machado

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