[kvm-unit-tests PATCH] arm: pmu: Fix overflow test condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I think one of the test conditions for the KVM PMU unit test "basic_event_count" is not strong enough. It only checks whether an overflow occurred for counter #0, but it should also check that none happened for the other counter(s):

report(read_sysreg(pmovsclr_el0) & 0x1,
      "check overflow happened on #0 only");

This should be "==" instead of "&".

Note that this test uses one more counter (#1), which must not overflow. This should also be checked, even though this would be visible through the "report_info()" a few lines above. But the latter does not mark the test failing - it is purely informational, so any test automation will not notice.


I apologize in advance if my email program at work messes up any formatting. Please let me know and I will try to reconfigure and resend if necessary. Thank you.

Best Regards,

Matthias
[Banner]<http://www.nio.io>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. You may NOT use, disclose, copy or disseminate this information. If you have received this email in error, please notify the sender and destroy all copies of the original message and all attachments. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
From 0a3ca4c88818e752ca63dee3d50945a26a16d29b Mon Sep 17 00:00:00 2001
From: Matthias Rosenfelder <matthias.rosenfelder@xxxxxx>
Date: Tue, 26 Sep 2023 19:07:18 +0200
Subject: [kvm-unit-tests PATCH] arm: PMU: Fix test condition

The test description says: "check overflow happened on #0 only",
but the test condition actually tests: "check overflow happened
AT LEAST of #0, maybe of some other counters as well."
This basically disregards any overflow of other counters, but it
should ensure that there are none.

With the updated test condition the test will fail if there was an
overflow of counter #1, too.

Signed-off-by: Matthias Rosenfelder <matthias.rosenfelder@xxxxxx>
---
 arm/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arm/pmu.c b/arm/pmu.c
index b164f21..1956b42 100644
--- a/arm/pmu.c
+++ b/arm/pmu.c
@@ -532,7 +532,7 @@ static void test_basic_event_count(bool overflow_at_64bits)
 		    read_regn_el0(pmevcntr, 1));
 
 	report_info("overflow reg = 0x%lx", read_sysreg(pmovsclr_el0));
-	report(read_sysreg(pmovsclr_el0) & 0x1,
+	report(read_sysreg(pmovsclr_el0) == 0x1,
 		"check overflow happened on #0 only");
 }
 
-- 
2.34.1


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux