public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/3] arm: pmu: Add support for PMUv3p5
@ 2022-12-02  4:55 Ricardo Koller
  2022-12-02  4:55 ` [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters Ricardo Koller
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Ricardo Koller @ 2022-12-02  4:55 UTC (permalink / raw)
  To: kvm, kvmarm, andrew.jones
  Cc: maz, alexandru.elisei, eric.auger, oliver.upton, reijiw,
	Ricardo Koller

The first commit fixes the tests when running on PMUv3p5. The issue is that
PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured
for overflowing at 32 or 64-bits. Tests are currently failing [0] on
PMUv3p5 because of this. They wrongly assume that values will be wrapped
around 32-bits, but they overflow into the other half of the 64-bit
counters.

The second and third commits add new tests for 64-bit overflows, a feature
added with PMUv3p5 (PMCR_EL0.LP == 1). This is done by running all
overflow-related tests in two modes: with 32-bit and 64-bit overflows.

This series was tested on PMUv3p5 and PMUv3p4 using the ARM Fast Model and
kvmtool.  All tests pass on both PMUv3p5 and PMUv3p4 when using Marc's
PMUv3p5 series [0], plus the suggestion made at [1]. Didn't test AArch32.

[0] https://lore.kernel.org/kvmarm/20221113163832.3154370-1-maz@kernel.org/
[1] https://lore.kernel.org/kvmarm/Y4jasyxvFRNvvmox@google.com/

Ricardo Koller (3):
  arm: pmu: Fix overflow checks for PMUv3p5 long counters
  arm: pmu: Prepare for testing 64-bit overflows
  arm: pmu: Add tests for 64-bit overflows

 arm/pmu.c | 217 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 133 insertions(+), 84 deletions(-)

-- 
2.39.0.rc0.267.gcb52ba06e7-goog


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

end of thread, other threads:[~2022-12-14 18:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02  4:55 [kvm-unit-tests PATCH 0/3] arm: pmu: Add support for PMUv3p5 Ricardo Koller
2022-12-02  4:55 ` [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters Ricardo Koller
2022-12-09 17:47   ` Alexandru Elisei
2022-12-10 11:01     ` Marc Zyngier
2022-12-11 11:40       ` Alexandru Elisei
2022-12-12  9:05         ` Marc Zyngier
2022-12-12 13:56           ` Alexandru Elisei
2022-12-12 21:00     ` Ricardo Koller
2022-12-13 12:36   ` Alexandru Elisei
2022-12-13 16:21     ` Ricardo Koller
2022-12-13 16:43       ` Alexandru Elisei
2022-12-13 18:01         ` Ricardo Koller
2022-12-14 10:46           ` Alexandru Elisei
2022-12-14 18:07             ` Ricardo Koller
2022-12-02  4:55 ` [kvm-unit-tests PATCH 2/3] arm: pmu: Prepare for testing 64-bit overflows Ricardo Koller
2022-12-02  4:55 ` [kvm-unit-tests PATCH 3/3] arm: pmu: Add tests for " Ricardo Koller
2022-12-13 17:03   ` Alexandru Elisei
2022-12-13 18:04     ` Ricardo Koller
2022-12-14 10:45       ` Alexandru Elisei
2022-12-14 18:31         ` Ricardo Koller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox