qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] gdbstub: Add support for MTE in system mode
@ 2024-08-25 14:52 Gustavo Romero
  2024-08-25 14:52 ` [PATCH v3 1/4] gdbstub: Use specific MMU index when probing MTE addresses Gustavo Romero
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Gustavo Romero @ 2024-08-25 14:52 UTC (permalink / raw)
  To: qemu-devel, alex.bennee, richard.henderson
  Cc: philmd, peter.maydell, gustavo.romero

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.

It also extends the MTE gdbstub tests to run in system mode, sharing the
tests between QEMU user mode and system mode.

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)


Cheers,
Gustavo

Gustavo Romero (4):
  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: 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        |   7 ++
 tests/tcg/aarch64/system/mte.S            | 109 ++++++++++++++++++++++
 10 files changed, 252 insertions(+), 35 deletions(-)
 create mode 100644 tests/tcg/aarch64/system/mte.S

-- 
2.34.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-09-06 13:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-25 14:52 [PATCH v3 0/4] gdbstub: Add support for MTE in system mode Gustavo Romero
2024-08-25 14:52 ` [PATCH v3 1/4] gdbstub: Use specific MMU index when probing MTE addresses Gustavo Romero
2024-08-25 14:52 ` [PATCH v3 2/4] gdbstub: Add support for MTE in system mode Gustavo Romero
2024-08-25 14:52 ` [PATCH v3 3/4] tests/guest-debug: Support passing arguments to the GDB test script Gustavo Romero
2024-09-06 13:49   ` Alex Bennée
2024-08-25 14:52 ` [PATCH v3 4/4] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode Gustavo Romero
2024-08-26  6:10   ` Philippe Mathieu-Daudé
2024-08-27 12:42     ` Gustavo Romero
2024-08-27 18:01       ` Gustavo Romero
2024-08-29  0:43         ` Richard Henderson
2024-08-29 20:13           ` Gustavo Romero
2024-08-29 22:16             ` Richard Henderson
2024-08-30 22:35               ` Gustavo Romero

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).