Gustavo Romero <gustavo.rom...@linaro.org> writes: > Hi Alex, > > On 6/14/24 12:49 PM, Alex Bennée wrote: >> Gustavo Romero <gustavo.rom...@linaro.org> writes: >> >>> This patchset adds the stubs necessary to support GDB memory tagging >>> commands on QEMU aarch64 user mode. >>> >>> These new stubs handle the qIsAddressTagged, qMemTag, and QMemTag >>> packets, which allow GDB memory tagging subcommands 'check', >>> 'print-allocation-tag', and 'set-allocation-tag' to work. The remaining >>> memory tagging commands ('print-logical-tag' and 'with-logical-tag') >>> will also work, but they don't rely on any stub because they perform >>> local operations. >>> >>> Since the memory tagging stubs are not common to all architectures, this >>> patchset also introduces three functions: gdb_extend_qsupported_features, >>> gdb_extend_query_table, and gdb_extend_set_table. These functions can be >>> used to extend the target-specific 'qSupported' feature string and the >>> handlers for the 'q' (query) and 'Q' (set) packets. These new functions >>> are used to add the MTE stubs for the aarch64 gdbstub. >>> Note that this patchset requires a GDB that supports the >>> qIsAddressTagged packet (recently added to GDB), so the gdbstub MTE >>> tests introduced by it must be run using GDB's master branch, since the >>> GDB in the distros hasn't picked up the change yet. >>> >>> Once GDB is built and installed locally, the tests can be exercised, for >>> example, this way: >>> >>> make GDB=~/.local/bin/gdb run-tcg-tests-aarch64-linux-user -j 32 >> It looks like there might be some BSD build failures as well: >> https://gitlab.com/stsquad/qemu/-/pipelines/1332635371/failures > > I fixed the build for the BSD target in v3, however I think that the GDB in > the test containers need to be bumped to GDB 15 so the MTE tests can pass, > because support for IsAddressTagged packet is necessary. GDB 15 branch > is created by it's not released yet, so I don't know to proceed..
Two potential approaches, you could extend the configure segment: if test -n "$gdb_bin"; then gdb_version=$($gdb_bin --version | head -n 1) if version_ge ${gdb_version##* } 9.1; then gdb_arches=$($python "$source_path/scripts/probe-gdb-support.py" $gdb_bin) else gdb_bin="" fi fi and set a variable exported to config-host.mak to then test in the tcg test makefiles. Or you could implement a gdb-version-test command in tests/tcg/Makefile.target which you could use like the existing cc-test/cc-option commands to extend config-cc.mak and use that to gate the tests. -- Alex Bennée Virtualisation Tech Lead @ Linaro