[PATCH 0/7] tests/tcg: more capabilities for aarch64-softmmu tests

Alex Bennée posted 7 patches 3 days, 20 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260417164328.1009132-1-alex.bennee@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>
tests/tcg/aarch64/system/lib/gicv3.h      |  60 +++++++++
tests/tcg/aarch64/system/lib/pgtable.h    |  80 ++++++++++++
tests/tcg/aarch64/system/lib/sysregs.h    |  42 +++++++
tests/tcg/aarch64/system/asid2.c          |  35 +++---
tests/tcg/aarch64/system/feat-xs.c        |   4 +-
tests/tcg/aarch64/system/lib/gicv3.c      |  70 +++++++++++
tests/tcg/aarch64/system/lib/pgtable.c    |  70 +++++++++++
tests/tcg/aarch64/system/vtimer.c         |  23 +---
tests/tcg/aarch64/system/wfx.c            | 143 ++++++++++++++++++++++
tests/tcg/aarch64/Makefile.softmmu-target |  22 +++-
tests/tcg/aarch64/system/boot.S           | 125 +++----------------
tests/tcg/aarch64/system/kernel.ld        |   3 +
12 files changed, 521 insertions(+), 156 deletions(-)
create mode 100644 tests/tcg/aarch64/system/lib/gicv3.h
create mode 100644 tests/tcg/aarch64/system/lib/pgtable.h
create mode 100644 tests/tcg/aarch64/system/lib/sysregs.h
create mode 100644 tests/tcg/aarch64/system/lib/gicv3.c
create mode 100644 tests/tcg/aarch64/system/lib/pgtable.c
create mode 100644 tests/tcg/aarch64/system/wfx.c
[PATCH 0/7] tests/tcg: more capabilities for aarch64-softmmu tests
Posted by Alex Bennée 3 days, 20 hours ago
In the process of writing the WFx code I needed to enhance the support
code so we could have interrupts in the test. To do that I needed to
map hardware into the page tables. To do that I wanted to make the
page table code easier to follow and now here we are.

It's quite a lot of code for a simple thing and of course if we keep
going down this road we'll end up with a kernel all of our own
although not big and professional like Linux.

The other option would be to build some machinery to exploit our cross
compiler support and just import kvm-unit-tests somehow and maybe
integrate it with meson more properly. It already has a more mature
set of helpers and is set up for even more architectural shenanigans
including setup for both GICs and a cleaner unit test wrappers.

While earlier versions of the tests where the result of LLM
prototyping hopefully the splitting and refactoring has made it more
human. There is an additional test for the HPFAR_EL2.NS for bug 2568
but I haven't had a chance to properly clean it up yet so I haven't
included it here.

What do people think? Should we go down this road or choose the
kvm-unit-tests option?

Alex.

Alex Bennée (7):
  tests/tcg: introduce a lib dir for aarch64 system tests
  tests/tcg: convert aarch64 feat-xs test to use helpers
  tests/tcg: convert aarch64 asid2 test to use sysreg helpers
  tests/tcg: move aarch64 page table setup to c code
  tests/tcg: add HW page for aarch64 tests
  tests/tcg: create a mini-gic3 library
  tests/tcg: add basic test for aarch64 wf[ie][t] insns

 tests/tcg/aarch64/system/lib/gicv3.h      |  60 +++++++++
 tests/tcg/aarch64/system/lib/pgtable.h    |  80 ++++++++++++
 tests/tcg/aarch64/system/lib/sysregs.h    |  42 +++++++
 tests/tcg/aarch64/system/asid2.c          |  35 +++---
 tests/tcg/aarch64/system/feat-xs.c        |   4 +-
 tests/tcg/aarch64/system/lib/gicv3.c      |  70 +++++++++++
 tests/tcg/aarch64/system/lib/pgtable.c    |  70 +++++++++++
 tests/tcg/aarch64/system/vtimer.c         |  23 +---
 tests/tcg/aarch64/system/wfx.c            | 143 ++++++++++++++++++++++
 tests/tcg/aarch64/Makefile.softmmu-target |  22 +++-
 tests/tcg/aarch64/system/boot.S           | 125 +++----------------
 tests/tcg/aarch64/system/kernel.ld        |   3 +
 12 files changed, 521 insertions(+), 156 deletions(-)
 create mode 100644 tests/tcg/aarch64/system/lib/gicv3.h
 create mode 100644 tests/tcg/aarch64/system/lib/pgtable.h
 create mode 100644 tests/tcg/aarch64/system/lib/sysregs.h
 create mode 100644 tests/tcg/aarch64/system/lib/gicv3.c
 create mode 100644 tests/tcg/aarch64/system/lib/pgtable.c
 create mode 100644 tests/tcg/aarch64/system/wfx.c

-- 
2.47.3