All of lore.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>,
	"Alexander Graf" <agraf@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Jintack Lim" <jintack@cs.columbia.edu>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Christoffer Dall" <cdall@linaro.org>
Subject: [PATCH kvm-unit-tests 1/3] arm64: timer: Fix vtimer interrupt test
Date: Thu, 13 Jul 2017 21:20:07 +0200	[thread overview]
Message-ID: <20170713192009.10069-2-cdall@linaro.org> (raw)
In-Reply-To: <20170713192009.10069-1-cdall@linaro.org>

The timer irq_handler is supposed to mask the timer signal, but unfortunately
also disables the timer at the same time, even though we loop and wait on
ISTATUS to become set.

According to the ARM ARM, "When the value of the ENABLE bit is 0, the
ISTATUS field is UNKNOWN."  This test happens to work on AMD Seattle, but
doesn't work on Mustang or on QEMU with TCG.

Fix the problem by preserving the enable bit in the irq handler.

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 89f4c94..02d9e0a 100644
--- a/arm/timer.c
+++ b/arm/timer.c
@@ -28,7 +28,7 @@ static void irq_handler(struct pt_regs *regs)
 		gic_write_eoir(irqstat);
 
 	if (irqnr == PPI(vtimer_irq)) {
-		write_sysreg(CNTV_CTL_IMASK, cntv_ctl_el0);
+		write_sysreg(CNTV_CTL_IMASK | CNTV_CTL_ENABLE, cntv_ctl_el0);
 		++vtimer_irq_received;
 	}
 }
-- 
2.9.0

  reply	other threads:[~2017-07-13 19:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 19:20 [PATCH kvm-unit-tests 0/3] Add physical timer test Christoffer Dall
2017-07-13 19:20 ` Christoffer Dall [this message]
2017-07-14  7:55   ` [PATCH kvm-unit-tests 1/3] arm64: timer: Fix vtimer interrupt test Marc Zyngier
2017-07-14 15:43     ` Christoffer Dall
2017-07-14 15:54       ` Marc Zyngier
2017-07-13 19:20 ` [PATCH kvm-unit-tests 2/3] arm64: timer: Fix test on APM X-Gene Christoffer Dall
2017-07-14  8:04   ` Marc Zyngier
2017-07-14 15:45     ` Christoffer Dall
2017-07-18 10:05       ` Andrew Jones
2017-07-18 10:35         ` Christoffer Dall
2017-07-18 12:15           ` Andrew Jones
2017-07-24 17:13             ` Paolo Bonzini
2017-07-24 21:25               ` Christoffer Dall
2017-07-26 11:38                 ` Christoffer Dall
2017-07-13 19:20 ` [PATCH kvm-unit-tests 3/3] arm64: timer: Add support for phys timer testing Christoffer Dall
2017-07-18 12:09   ` Andrew Jones
2017-07-18 13:01     ` Christoffer Dall
2017-07-18 13:23       ` Andrew Jones
2017-07-18 13:31         ` Christoffer Dall
2017-07-18 13:50           ` Andrew Jones
2017-07-18 14:15             ` Christoffer Dall
2017-07-18 14:29               ` Andrew Jones
2017-07-18 14:37                 ` Christoffer Dall
2017-07-18 10:17 ` [PATCH kvm-unit-tests 0/3] Add physical timer test Andrew Jones
2017-07-18 10:42   ` Christoffer Dall
2017-07-18 12:20     ` Andrew Jones
2017-07-24 17:16 ` Paolo Bonzini

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=20170713192009.10069-2-cdall@linaro.org \
    --to=cdall@linaro.org \
    --cc=agraf@suse.de \
    --cc=drjones@redhat.com \
    --cc=jintack@cs.columbia.edu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.