AArch64: Use HWCAP to detect pauth feature

Add aarch64_get_hwcap functions for reading the HWCAP.
From this extract the PACA value and use this to enable pauth.

gdb/ChangeLog:

	* aarch64-linux-nat.c
	(aarch64_linux_nat_target::read_description): Read PACA hwcap.
	* aarch64-linux-tdep.c
	(aarch64_linux_core_read_description): Likewise.
	(aarch64_linux_get_hwcap): New function.
	* aarch64-linux-tdep.h (AARCH64_HWCAP_PACA): New define.
	(aarch64_linux_get_hwcap): New declaration.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c (AARCH64_HWCAP_PACA): New define.
	(aarch64_get_hwcap): New function.
	(aarch64_arch_setup): Read APIA hwcap.
This commit is contained in:
Alan Hayward 2019-03-22 10:00:28 +00:00
parent 6dc0ebde59
commit ee4fbcfa26
6 changed files with 72 additions and 8 deletions

View file

@ -606,8 +606,11 @@ aarch64_linux_nat_target::read_description ()
if (ret == 0)
return tdesc_arm_with_neon;
/* pauth not yet supported. */
return aarch64_read_description (aarch64_sve_get_vq (tid), false);
CORE_ADDR hwcap = 0;
bool pauth_p = aarch64_linux_get_hwcap (this, &hwcap)
&& (hwcap & AARCH64_HWCAP_PACA);
return aarch64_read_description (aarch64_sve_get_vq (tid), pauth_p);
}
/* Convert a native/host siginfo object, into/from the siginfo in the