public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <cdall@linaro.org>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: "Andrew Jones" <drjones@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Christoffer Dall" <cdall@linaro.org>
Subject: [PATCH kvm-unit-tests] arm64: timer: Use correct counter for !pending_before
Date: Thu,  3 Aug 2017 08:25:45 +0200	[thread overview]
Message-ID: <20170803062545.17533-1-cdall@linaro.org> (raw)

We were using the virtual counter to calculate a timer cval which is 10
seconds in the future, but this obviously doesn't work for the physical
timer which is bases on the physical counter.

Make sure we use a properly paired timer/counter pair.

Reported-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
---
 arm/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arm/timer.c b/arm/timer.c
index e824338..4cdca9e 100644
--- a/arm/timer.c
+++ b/arm/timer.c
@@ -174,7 +174,7 @@ static bool test_cval_10msec(struct timer_info *info)
 
 static void test_timer(struct timer_info *info)
 {
-	u64 now = read_sysreg(cntvct_el0);
+	u64 now = info->read_counter();
 	u64 time_10s = read_sysreg(cntfrq_el0) * 10;
 	u64 later = now + time_10s;
 
-- 
2.9.0

             reply	other threads:[~2017-08-03  6:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03  6:25 Christoffer Dall [this message]
2017-08-03 13:09 ` [PATCH kvm-unit-tests] arm64: timer: Use correct counter for !pending_before Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170803062545.17533-1-cdall@linaro.org \
    --to=cdall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox