KVM: selftests: Print timer ctl register in ISTATUS assertion

Message ID 20240212210932.3095265-2-oliver.upton@linux.dev
State New
Headers
Series KVM: selftests: Print timer ctl register in ISTATUS assertion |

Commit Message

Oliver Upton Feb. 12, 2024, 9:09 p.m. UTC
  Zenghui noted that the test assertion for the ISTATUS bit is printing
the current timer value instead of the control register in the case of
failure. While the assertion is sound, printing CNT isn't informative.

Change things around to actually print the CTL register value instead.

Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Closes: https://lore.kernel.org/kvmarm/3188e6f1-f150-f7d0-6c2b-5b7608b0b012@huawei.com/
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---

Applies to kvmarm/next.

 tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 680f749c272378a796388a3244bab53b5a952d67
  

Comments

Zenghui Yu Feb. 13, 2024, 12:39 a.m. UTC | #1
On 2024/2/13 05:09, Oliver Upton wrote:
> Zenghui noted that the test assertion for the ISTATUS bit is printing
> the current timer value instead of the control register in the case of
> failure. While the assertion is sound, printing CNT isn't informative.
> 
> Change things around to actually print the CTL register value instead.
> 
> Reported-by: Zenghui Yu <yuzenghui@huawei.com>
> Closes: https://lore.kernel.org/kvmarm/3188e6f1-f150-f7d0-6c2b-5b7608b0b012@huawei.com/
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

Reviewed-by: Zenghui Yu <zenghui.yu@linux.dev>
  
Oliver Upton Feb. 13, 2024, 1:43 a.m. UTC | #2
On Mon, 12 Feb 2024 21:09:33 +0000, Oliver Upton wrote:
> Zenghui noted that the test assertion for the ISTATUS bit is printing
> the current timer value instead of the control register in the case of
> failure. While the assertion is sound, printing CNT isn't informative.
> 
> Change things around to actually print the CTL register value instead.
> 
> 
> [...]

Applied to kvmarm/next, thanks!

[1/1] KVM: selftests: Print timer ctl register in ISTATUS assertion
      https://git.kernel.org/kvmarm/kvmarm/c/8cdc71fbf655

--
Best,
Oliver
  

Patch

diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c
index d5e8f365aa01..ab4b604d8ec0 100644
--- a/tools/testing/selftests/kvm/aarch64/arch_timer.c
+++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c
@@ -160,7 +160,7 @@  static void guest_validate_irq(unsigned int intid,
 	__GUEST_ASSERT(xcnt >= cval,
 		       "xcnt = 0x%lx, cval = 0x%lx, xcnt_diff_us = 0x%lx",
 		       xcnt, cval, xcnt_diff_us);
-	__GUEST_ASSERT(xctl & CTL_ISTATUS, "xcnt = 0x%lx", xcnt);
+	__GUEST_ASSERT(xctl & CTL_ISTATUS, "xctl = 0x%lx", xctl);
 
 	WRITE_ONCE(shared_data->nr_iter, shared_data->nr_iter + 1);
 }