diff options
author | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 09:58:42 +0000 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2019-03-22 09:58:42 +0000 |
commit | 6dc0ebde59dfb73eae507ced718bafa54023bf33 (patch) | |
tree | 9cc851b66b4b94d633e576f1b955edfe9b63d81c /gdb/gdbserver | |
parent | 968aa7ae389d9e6cecb5fda6826bf889ed959fce (diff) | |
download | gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.zip gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.tar.gz gdb-6dc0ebde59dfb73eae507ced718bafa54023bf33.tar.bz2 |
AArch64: Add pointer authentication feature
Pointer Authentication is a new feature in AArch64 v8.3-a. When enabled in
the compiler, function return addresses will be mangled by the kernel.
Add register description xml and wire up to aarch64_linux_read_description.
This description includes the two pauth user registers.
Nothing yet uses the feature - that is added in later patches.
gdb/ChangeLog:
* aarch64-linux-nat.c
(aarch64_linux_nat_target::read_description): Add pauth param.
* aarch64-linux-tdep.c
(aarch64_linux_core_read_description): Likewise.
* aarch64-tdep.c (struct target_desc): Add in pauth.
(aarch64_read_description): Add pauth param.
(aarch64_gdbarch_init): Likewise.
* aarch64-tdep.h (aarch64_read_description): Likewise.
* arch/aarch64.c (aarch64_create_target_description): Likewise.
* arch/aarch64.h (aarch64_create_target_description): Likewise.
* features/Makefile: Add new files.
* features/aarch64-pauth.c: New file.
* features/aarch64-pauth.xml: New file.
gdb/doc/ChangeLog:
* gdb.texinfo: Describe pauth feature.
gdb/gdbserver/ChangeLog:
* linux-aarch64-ipa.c (get_ipa_tdesc): Add pauth param.
(initialize_low_tracepoint): Likewise.
* linux-aarch64-low.c (aarch64_arch_setup): Likewise.
* linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Likewise.
* linux-aarch64-tdesc.c (struct target_desc): Likewise.
(aarch64_linux_read_description): Likewise.
* linux-aarch64-tdesc.h (aarch64_linux_read_description): Likewise.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-ipa.c | 8 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-low.c | 3 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-tdesc-selftest.c | 2 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-tdesc.c | 10 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-tdesc.h | 2 |
6 files changed, 24 insertions, 12 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 9879481..9fdbe1d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,14 @@ +2019-03-22 Alan Hayward <alan.hayward@arm.com> + Jiong Wang <jiong.wang@arm.com> + + * linux-aarch64-ipa.c (get_ipa_tdesc): Add pauth param. + (initialize_low_tracepoint): Likewise. + * linux-aarch64-low.c (aarch64_arch_setup): Likewise. + * linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Likewise. + * linux-aarch64-tdesc.c (struct target_desc): Likewise. + (aarch64_linux_read_description): Likewise. + * linux-aarch64-tdesc.h (aarch64_linux_read_description): Likewise. + 2019-03-12 John Baldwin <jhb@FreeBSD.org> * linux-x86-tdesc.c (i386_linux_read_description): Update call to diff --git a/gdb/gdbserver/linux-aarch64-ipa.c b/gdb/gdbserver/linux-aarch64-ipa.c index 94db53f..3804b1e 100644 --- a/gdb/gdbserver/linux-aarch64-ipa.c +++ b/gdb/gdbserver/linux-aarch64-ipa.c @@ -147,12 +147,12 @@ get_raw_reg (const unsigned char *raw_regs, int regnum) /* Return target_desc to use for IPA, given the tdesc index passed by gdbserver. Index is ignored, since we have only one tdesc - at the moment. SVE not yet supported. */ + at the moment. SVE and pauth not yet supported. */ const struct target_desc * get_ipa_tdesc (int idx) { - return aarch64_linux_read_description (0); + return aarch64_linux_read_description (0, false); } /* Allocate buffer for the jump pads. The branch instruction has a reach @@ -204,6 +204,6 @@ alloc_jump_pad_buffer (size_t size) void initialize_low_tracepoint (void) { - /* SVE not yet supported. */ - aarch64_linux_read_description (0); + /* SVE and pauth not yet supported. */ + aarch64_linux_read_description (0, false); } diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 0b2946e..db329da 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -501,7 +501,8 @@ aarch64_arch_setup (void) if (is_elf64) { uint64_t vq = aarch64_sve_get_vq (tid); - current_process ()->tdesc = aarch64_linux_read_description (vq); + /* pauth not yet supported. */ + current_process ()->tdesc = aarch64_linux_read_description (vq, false); } else current_process ()->tdesc = tdesc_arm_with_neon; diff --git a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c b/gdb/gdbserver/linux-aarch64-tdesc-selftest.c index 1b2453a..bf24a27 100644 --- a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c +++ b/gdb/gdbserver/linux-aarch64-tdesc-selftest.c @@ -29,7 +29,7 @@ namespace tdesc { static void aarch64_tdesc_test () { - const target_desc *tdesc = aarch64_linux_read_description (0); + const target_desc *tdesc = aarch64_linux_read_description (0, false); SELF_CHECK (*tdesc == *tdesc_aarch64); } } diff --git a/gdb/gdbserver/linux-aarch64-tdesc.c b/gdb/gdbserver/linux-aarch64-tdesc.c index 6ab473e..6f9b4f1 100644 --- a/gdb/gdbserver/linux-aarch64-tdesc.c +++ b/gdb/gdbserver/linux-aarch64-tdesc.c @@ -24,22 +24,22 @@ #include <inttypes.h> /* All possible aarch64 target descriptors. */ -struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1]; +struct target_desc *tdesc_aarch64_list[AARCH64_MAX_SVE_VQ + 1][2/*pauth*/]; /* Create the aarch64 target description. */ const target_desc * -aarch64_linux_read_description (uint64_t vq) +aarch64_linux_read_description (uint64_t vq, bool pauth_p) { if (vq > AARCH64_MAX_SVE_VQ) error (_("VQ is %" PRIu64 ", maximum supported value is %d"), vq, AARCH64_MAX_SVE_VQ); - struct target_desc *tdesc = tdesc_aarch64_list[vq]; + struct target_desc *tdesc = tdesc_aarch64_list[vq][pauth_p]; if (tdesc == NULL) { - tdesc = aarch64_create_target_description (vq); + tdesc = aarch64_create_target_description (vq, pauth_p); static const char *expedite_regs_aarch64[] = { "x29", "sp", "pc", NULL }; static const char *expedite_regs_aarch64_sve[] = { "x29", "sp", "pc", @@ -50,7 +50,7 @@ aarch64_linux_read_description (uint64_t vq) else init_target_desc (tdesc, expedite_regs_aarch64_sve); - tdesc_aarch64_list[vq] = tdesc; + tdesc_aarch64_list[vq][pauth_p] = tdesc; } return tdesc; diff --git a/gdb/gdbserver/linux-aarch64-tdesc.h b/gdb/gdbserver/linux-aarch64-tdesc.h index 7ce8150..06b3ec9 100644 --- a/gdb/gdbserver/linux-aarch64-tdesc.h +++ b/gdb/gdbserver/linux-aarch64-tdesc.h @@ -20,7 +20,7 @@ #ifndef GDBSERVER_LINUX_AARCH64_TDESC_H #define GDBSERVER_LINUX_AARCH64_TDESC_H -const target_desc * aarch64_linux_read_description (uint64_t vq); +const target_desc * aarch64_linux_read_description (uint64_t vq, bool pauth_p); #if GDB_SELF_TEST void initialize_low_tdesc (); |