Skip to content

Commit

Permalink
target/arm: Report pauth information to gdb as 'pauth_v2'
Browse files Browse the repository at this point in the history
So that we can avoid the "older gdb crashes" problem described in
commit 5787d17 and which caused us to disable reporting pauth
information via the gdbstub, newer gdb is going to implement support
for recognizing the pauth information via a new feature name:
 org.gnu.gdb.aarch64.pauth_v2

Older gdb won't recognize this feature name, so we can re-enable the
pauth support under the new name without risking them crashing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230406150827.3322670-1-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Apr 20, 2023
1 parent 0f40f7c commit 7bdd67a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gdb-xml/aarch64-pauth.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
notice and this notice are preserved. -->

<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.aarch64.pauth">
<feature name="org.gnu.gdb.aarch64.pauth_v2">
<reg name="pauth_dmask" bitsize="64"/>
<reg name="pauth_cmask" bitsize="64"/>
<reg name="pauth_dmask_high" bitsize="64"/>
Expand Down
9 changes: 4 additions & 5 deletions target/arm/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,17 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu)
aarch64_gdb_set_fpu_reg,
34, "aarch64-fpu.xml", 0);
}
#if 0
/*
* GDB versions 9 through 12 have a bug which means they will
* crash if they see this XML from QEMU; disable it for the 8.0
* release, pending a better solution.
* Note that we report pauth information via the feature name
* org.gnu.gdb.aarch64.pauth_v2, not org.gnu.gdb.aarch64.pauth.
* GDB versions 9 through 12 have a bug where they will crash
* if they see the latter XML from QEMU.
*/
if (isar_feature_aa64_pauth(&cpu->isar)) {
gdb_register_coprocessor(cs, aarch64_gdb_get_pauth_reg,
aarch64_gdb_set_pauth_reg,
4, "aarch64-pauth.xml", 0);
}
#endif
#endif
} else {
if (arm_feature(env, ARM_FEATURE_NEON)) {
Expand Down

0 comments on commit 7bdd67a

Please sign in to comment.