Skip to content

arm: add GICv2 MMIO tests

Andre Przywara kvm kvmarm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 6 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mark exit() and abort() as non-returning functionslib/arm/io.c lib/libcflat.h lib/powerpc/io.c +1 more+7 -31 reply
2/4arm/arm64: GIC: basic GICv2 MMIO testsarm/gic.c arm/unittests.cfg lib/arm/asm/gic.h+113 -01 reply
3/4arm/arm64: GICv2: add GICD_IPRIORITYR testingarm/gic.c+79 -02 replies
4/4arm/arm64: GICv2: add GICD_ITARGETSR testingarm/gic.c lib/arm/asm/gic.h+44 -01 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAndrew Jones
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [kvm-unit-tests PATCH v2 0/4] arm: add GICv2 MMIO tests

I found this in one my branches: this is an updated version of what I sent end of 2016 [1]. I tried to address all comments that Drew and Eric had at the time.
Please have a look whether this makes sense.

Changelog v1..v2:
- made many functions void
- use symbolic name for first SPI being number 32
- add test runs with one and three vCPUs
- use gic_version() directly
- factor out test_byte_access()
- drop redundant "filling priorities" test
- dropped GICv3 test

[1] https://lists.cs.columbia.edu/pipermail/kvmarm/2016-November/022352.html

Original cover letter:
======================
The GIC spec mandates certain constraints on how to acccess the MMIO mapped registers, both in terms of which registers are available and also in terms of which bits within a register should be masked, for instance. Since we went through some lengths in the KVM emulation to implement this, it's about time to give this actually a test beyond what the kernel as a GIC user actually implements - for instance we ignore priorities in Linux.

This series tries to attack some constraints, on a low-hanging-fruit base. It focusses on some generic registers and the PRIORITY and TARGETS registers of GICv2. GICv3 is not covered yet.

This actually revealed genuine bugs in the KVM emulation in the past. KVM passes these tests now, but QEMU fails some UP and 3-way-SMP tests.

Cheers,
Andre.

Andre Przywara (4):
mark exit() and abort() as non-returning functions arm/arm64: GIC: basic GICv2 MMIO tests arm/arm64: GICv2: add GICD_IPRIORITYR testing arm/arm64: GICv2: add GICD_ITARGETSR testing

 arm/gic.c         | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 arm/unittests.cfg |  18 +++++
 lib/arm/asm/gic.h |   5 ++
 lib/arm/io.c      |   1 +
 lib/libcflat.h    |   7 +-
 lib/powerpc/io.c  |   1 +
 lib/x86/io.c      |   1 +
 7 files changed, 243 insertions(+), 3 deletions(-)
Signature · 1 line
2.14.4