From: Gustavo Romero <gustavo.romero@linaro.org>
To: qemu-devel@nongnu.org, philmd@linaro.org, alex.bennee@linaro.org,
richard.henderson@linaro.org
Cc: peter.maydell@linaro.org, gustavo.romero@linaro.org
Subject: [PATCH v4 0/5] gdbstub: Add support for MTE in system mode
Date: Fri, 6 Sep 2024 14:33:11 +0000 [thread overview]
Message-ID: <20240906143316.657436-1-gustavo.romero@linaro.org> (raw)
This patchset makes handle_q_memtag, handle_q_isaddresstagged, and
handle_Q_memtag stubs build for system mode, allowing all GDB
'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system
mode, resolving:
https://gitlab.com/qemu-project/qemu/-/issues/620
For running the tests, a GDB that supports MTE for baremetal targets is
necessary. This support has just landed GDB's master branch.
GDB can be built and installed into a /tmp directory in a simple way:
after cloning GDB's master branch, inside a build directory, configure
GDB and build it:
$ git clone --depth 1 https://sourceware.org/git/binutils-gdb.git --branch master gdb_master && cd gdb_master
$ mkdir build && cd build
$ ../configure --disable-binutils --disable-ld --disable-gold --disable-gas --disable-sim --disable-gprof --disable-gprofng --with-python=python3 --enable-libctf --enable-unit-tests --prefix=/tmp/gdb --with-additional-debug-dirs=/usr/lib/debug --enable-targets=all
$ make -j 32
$ make install
Configure QEMU, specifying where GDB is installed. For example:
$ cd build
$ ../configure --target-list=aarch64-linux-user,aarch64-softmmu --disable-docs --gdb=/tmp/gdb/bin/gdb
$ make -j 32
$ cd..
And finally run the MTE gdbstub tests for QEMU system mode:
$ make -C build -j 32 run-tcg-tests-aarch64-softmmu
v2:
- Use of cpu_mmu_index() instead of arm_mmu_idx() (Richard's review)
- Converted mte.c test to mte.S
- Set tcr_el1, mair_el1, and sctlr_el1 in mte.S instead of in boot.S
(Richard's review)
- Allowed use of argparse in test scripts to get passed arguments from
run-test.py (Alex's review)
- Fixed test output to be stored in run-gdbstub-mte.out instead of
printed to stdout
- Added detection of GDB supporting MTE in baremetal
v3:
- No need of ARM_MMU_IDX_COREIDX_MASK with cpu_mmu_index()
(Richard's review)
- Define a symbol for mte_page instead of a whole section
(Richard's review)
v4:
- Better representation for MiB using M suffix in linker script
(Phil's review)
- Improve linker script organization (Richard's review)
Cheers,
Gustavo
Gustavo Romero (5):
gdbstub: Use specific MMU index when probing MTE addresses
gdbstub: Add support for MTE in system mode
tests/guest-debug: Support passing arguments to the GDB test script
tests/tcg/aarch64: Improve linker script organization
tests/tcg/aarch64: Extend MTE gdbstub tests to system mode
configure | 5 +
target/arm/gdbstub64.c | 21 +++--
tests/guest-debug/run-test.py | 6 ++
tests/guest-debug/test_gdbstub.py | 5 +
tests/tcg/aarch64/Makefile.softmmu-target | 49 +++++++++-
tests/tcg/aarch64/Makefile.target | 3 +-
tests/tcg/aarch64/gdbstub/test-mte.py | 71 +++++++++-----
tests/tcg/aarch64/system/boot.S | 11 +++
tests/tcg/aarch64/system/kernel.ld | 33 ++++---
tests/tcg/aarch64/system/mte.S | 109 ++++++++++++++++++++++
10 files changed, 266 insertions(+), 47 deletions(-)
create mode 100644 tests/tcg/aarch64/system/mte.S
--
2.34.1
next reply other threads:[~2024-09-06 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 14:33 Gustavo Romero [this message]
2024-09-06 14:33 ` [PATCH v4 1/5] gdbstub: Use specific MMU index when probing MTE addresses Gustavo Romero
2024-09-06 14:33 ` [PATCH v4 2/5] gdbstub: Add support for MTE in system mode Gustavo Romero
2024-09-06 14:33 ` [PATCH v4 3/5] tests/guest-debug: Support passing arguments to the GDB test script Gustavo Romero
2024-09-06 14:33 ` [PATCH v4 4/5] tests/tcg/aarch64: Improve linker script organization Gustavo Romero
2024-09-06 14:33 ` [PATCH v4 5/5] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode Gustavo Romero
2024-09-10 12:18 ` [PATCH v4 0/5] gdbstub: Add support for MTE in " Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906143316.657436-1-gustavo.romero@linaro.org \
--to=gustavo.romero@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).