From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm/arm64: KVM: arch timer: Reset CNTV_CTL to 0
Date: Fri, 4 Sep 2015 16:47:19 +0200 [thread overview]
Message-ID: <20150904144719.GJ5171@cbox> (raw)
In-Reply-To: <1441376679-8341-3-git-send-email-christoffer.dall@linaro.org>
On Fri, Sep 04, 2015 at 04:24:39PM +0200, Christoffer Dall wrote:
> Provide a better quality of implementation and be architecture compliant
> on ARMv7 for the architected timer by resetting the CNTV_CTL to 0 on
> reset of the timer, and call kvm_timer_update_state(vcpu) at the same
> time, ensuring the timer output is not asserted after, for example, a
> PSCI system reset.
forgot to remove the bit about kvm_timer_update_state(vcpu) which is no
longer valid when these patches are merged before the rework series.
Marc, if you're otherwise happy with this patch, can you fix this up at
commit time?
Thanks,
-Christoffer
>
> This change alone fixes the UEFI reset issue reported by Laszlo back in
> February.
>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Drew Jones <drjones@redhat.com>
> Cc: Wei Huang <wei@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
> virt/kvm/arm/arch_timer.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index 76e38d2..48c6e1a 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -200,6 +200,14 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
> timer->irq = irq;
>
> /*
> + * The bits in CNTV_CTL are architecturally reset to UNKNOWN for ARMv8
> + * and to 0 for ARMv7. We provide an implementation that always
> + * resets the timer to be disabled and unmasked and is compliant with
> + * the ARMv7 architecture.
> + */
> + timer->cntv_ctl = 0;
> +
> + /*
> * Tell the VGIC that the virtual interrupt is tied to a
> * physical interrupt. We do that once per VCPU.
> */
> --
> 2.1.2.330.g565301e.dirty
>
next prev parent reply other threads:[~2015-09-04 14:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 14:24 [PATCH 0/2] arm/arm64: KVM: Fix arthictected timer issues Christoffer Dall
2015-09-04 14:24 ` [PATCH 1/2] arm/arm64: KVM: vgic: Move active state handling to flush_hwstate Christoffer Dall
2015-09-07 14:44 ` Eric Auger
2015-09-07 15:46 ` Eric Auger
2015-09-07 15:54 ` Marc Zyngier
2015-09-04 14:24 ` [PATCH 2/2] arm/arm64: KVM: arch timer: Reset CNTV_CTL to 0 Christoffer Dall
2015-09-04 14:47 ` Christoffer Dall [this message]
2015-09-04 14:51 ` Marc Zyngier
2015-09-04 15:35 ` [PATCH 0/2] arm/arm64: KVM: Fix arthictected timer issues Marc Zyngier
2015-09-04 15:53 ` Christoffer Dall
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=20150904144719.GJ5171@cbox \
--to=christoffer.dall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).