From patchwork Sun Sep 13 10:56:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 53520 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 28C2922B26 for ; Sun, 13 Sep 2015 11:01:29 +0000 (UTC) Received: by lagj9 with SMTP id j9sf41423122lag.0 for ; Sun, 13 Sep 2015 04:01:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=elRKJYT7HRT/p9RCUogg2EMGcbMEc1IEFKAOBKxi4Os=; b=HvHTtUsYunB0Vtbxw3Am1rWrVgZQiK/OaxaHH5pZ61a+SkEktI1x3Y+GuSGAvFH/Yq McndDeL+5EpLMG+FkkPeen4k9ZGSxHtnVC1emDU5tjFkCbPbppzicS8cKOOETuffdOv/ w3L52CLiuGKv37oMJ2sSVloZe6ErOtYyYEmEfPsK5l4u4IBZ+mUe3O0/l9gZqDdlfiWS 0DWh/30+qJwJ7IDqJc9iN8pmRVe8t8ws9eC+81r07TGF5AvSW6if1K3Q7dY5KjgsD8gY UI+7yt7Kw33j8iVijzvwpXb3sM16++SFuZYCHfIfkVXCuJdsh0Qru3oSLffGqe3Y09AR oMNg== X-Gm-Message-State: ALoCoQn5bura2GgOLhmNx1PDVPBTmTRUsvoANj8bfL84SFRH5YUcxgqP2MwpCZ2Pu2XZ7/4ppto6 X-Received: by 10.194.59.166 with SMTP id a6mr1917834wjr.6.1442142087947; Sun, 13 Sep 2015 04:01:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.36 with SMTP id v4ls514558laj.109.gmail; Sun, 13 Sep 2015 04:01:27 -0700 (PDT) X-Received: by 10.152.3.233 with SMTP id f9mr4062870laf.14.1442142087782; Sun, 13 Sep 2015 04:01:27 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id f8si6203016lbv.92.2015.09.13.04.01.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 04:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcjc2 with SMTP id jc2so55589803lbc.0 for ; Sun, 13 Sep 2015 04:01:27 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr8191213lbb.106.1442142087338; Sun, 13 Sep 2015 04:01:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp655777lbq; Sun, 13 Sep 2015 04:01:26 -0700 (PDT) X-Received: by 10.68.234.167 with SMTP id uf7mr21154823pbc.51.1442142085140; Sun, 13 Sep 2015 04:01:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id bw10si14747184pab.111.2015.09.13.04.01.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 04:01:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zb4yH-0005Vu-5I; Sun, 13 Sep 2015 10:57:21 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zb4y7-0005Mo-Dr for linux-arm-kernel@lists.infradead.org; Sun, 13 Sep 2015 10:57:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F1A1524; Sun, 13 Sep 2015 03:57:06 -0700 (PDT) Received: from zomby-woof.wild-wind.fr.eu.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E1173F23A; Sun, 13 Sep 2015 03:56:50 -0700 (PDT) From: Marc Zyngier To: Paolo Bonzini , Gleb Natapov Subject: [PATCH 2/4] arm/arm64: KVM: arch timer: Reset CNTV_CTL to 0 Date: Sun, 13 Sep 2015 11:56:36 +0100 Message-Id: <1442141798-19191-3-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442141798-19191-1-git-send-email-marc.zyngier@arm.com> References: <1442141798-19191-1-git-send-email-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150913_035711_485196_50B3FCBC X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.101.70 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Wei Huang , Peter Maydell , Drew Jones , kvm@vger.kernel.org, Ard Biesheuvel , Alexander Spyridakis , linux-arm-kernel@lists.infradead.org, Mark Rutland , Laszlo Ersek , kvmarm@lists.cs.columbia.edu, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Christoffer Dall 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. This change alone fixes the UEFI reset issue reported by Laszlo back in February. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Drew Jones Cc: Wei Huang Cc: Peter Maydell Reviewed-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier --- 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. */