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

Andre Przywara posted 4 patches 5 years, 9 months ago
Failed in applying to current master (apply log)
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(-)
[Qemu-devel] [kvm-unit-tests PATCH v2 0/4] arm: add GICv2 MMIO tests
Posted by Andre Przywara 5 years, 9 months ago
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(-)

-- 
2.14.4


Re: [Qemu-devel] [kvm-unit-tests PATCH v2 0/4] arm: add GICv2 MMIO tests
Posted by Peter Maydell 5 years, 9 months ago
On 20 July 2018 at 16:39, Andre Przywara <andre.przywara@arm.com> wrote:
> 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.

Would be interesting to see if we've fixed some of the QEMU emulation
bugs, either already in master or in Luc's on-list patchset that adds
support for emulation of the GICv2 virt extensions...

thanks
-- PMM