From patchwork Sun Nov 17 03:12:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 3193381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7E870C045B for ; Sun, 17 Nov 2013 03:12:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96A582087E for ; Sun, 17 Nov 2013 03:12:06 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90CAA20878 for ; Sun, 17 Nov 2013 03:12:05 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vhslr-0006IY-VO; Sun, 17 Nov 2013 03:11:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vhsli-0003dv-Nk; Sun, 17 Nov 2013 03:11:26 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhslX-0003cm-7t for linux-arm-kernel@lists.infradead.org; Sun, 17 Nov 2013 03:11:23 +0000 Received: by mail-pa0-f46.google.com with SMTP id kl14so261524pab.33 for ; Sat, 16 Nov 2013 19:10:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h/KfxEENt1iAEzCPLbJNSwtTv+S/kNOlI5KAWx1KbQw=; b=mMRzY70b1PBQJ1V5quXCPTHGnKP/9FYwDsbOjbXhucFopJhbmSu37Eqo+mG5bZ3bTd ql7XqgUDqABh5dNRYNwmDD5/QHz7n/PnkmykxmehdRXnFQjsSV4qg4aAGSPP5E26sZSn SIeB095NeMPGGQ+/RK2gQqM2xFWQTKGTGZKshe6uISKrsOahS29zxOkqjuFXr2Weq9vT YtOKT4C5F2WQmZ1jJRJfjgKmj747GuSOgP+Dh+caia0SZYZjWIBw+pODx5+r0lZIe4YN 8U/v1snvvNGOzd8MRKgoBCLWxAWFwgqIKumSjvWR2ya60HUvL9pQxemJCO8vASQCR7aZ neWQ== X-Gm-Message-State: ALoCoQnFkm8G849DNSQL9lLu1xe+HqtuKp8yUry44n0mAG2UvEnuf2Xa5mWP2TCa8J3XlPvpEjH5 X-Received: by 10.68.180.162 with SMTP id dp2mr14110220pbc.5.1384657853049; Sat, 16 Nov 2013 19:10:53 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id qv8sm14186570pbc.31.2013.11.16.19.10.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Nov 2013 19:10:52 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2 v2] arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init Date: Sat, 16 Nov 2013 19:12:05 -0800 Message-Id: <1384657926-28194-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1384657926-28194-1-git-send-email-christoffer.dall@linaro.org> References: <1384657926-28194-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131116_221115_418892_E24C6834 X-CRM114-Status: GOOD ( 10.37 ) X-Spam-Score: -2.6 (--) Cc: Marc Zynger , Andre Przywara , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initialize the cntvoff at kvm_init_vm time, not before running the VCPUs at the first time because that will overwrite any potentially restored values from user space. Cc: Marc Zynger Cc: Andre Przywara Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- Changelog[v2]: - Call kvm_timer_init from kvm_arch_init_vm instead of moving the cntvoff to vcpu initialization, which would be redundant. arch/arm/kvm/arm.c | 2 ++ virt/kvm/arm/vgic.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index e312e4a..2bc2ec4 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -137,6 +137,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) if (ret) goto out_free_stage2_pgd; + kvm_timer_init(kvm); + /* Mark the initial VMID generation invalid */ kvm->arch.vmid_gen = 0; diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 685fc72..81e9481 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1409,7 +1409,6 @@ int kvm_vgic_init(struct kvm *kvm) for (i = VGIC_NR_PRIVATE_IRQS; i < VGIC_NR_IRQS; i += 4) vgic_set_target_reg(kvm, 0, i); - kvm_timer_init(kvm); kvm->arch.vgic.ready = true; out: mutex_unlock(&kvm->lock);