From patchwork Sat Sep 28 14:05:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 20682 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4AA5524687 for ; Sat, 28 Sep 2013 14:05:33 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id a11sf3526424qen.6 for ; Sat, 28 Sep 2013 07:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=6i4mvuqBsQaawD7+TO2bXBgDUUq5CPgP+k8kd5yaDT8=; b=ECv/8X9+Sivkpn6+SCULb2uduVkIo+EyhdUHlNww7gydt8wc5u2YMQwmYWqcbt4Mar MxDH76CjpIEVQpU3VWZT+yM43a5m+mnNIRaBealx4ECt9UwS6aQJnUOdcghQEXr9PJxv 6HNCWLQRTh3zIklFhoPCe48StVI+uJmdJZzBfRkPFPpbqRAqy8m5ub63APE74gpvSfW8 ROPxq7Lbg6btXuo0roL+N0vP5EJPHf3oduVWmzSeZiSOZHgyewxG0/L2qimyzcPdbRI7 MQVH1rToCOUsBX9hLB8o4AZKyUIPOmfXt9vUA3apebThOMkLgcmjZG3sEW1qdnbwDFFi 8IAQ== X-Received: by 10.236.130.140 with SMTP id k12mr2022099yhi.42.1380377132701; Sat, 28 Sep 2013 07:05:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.170 with SMTP id z10ls1580758qej.32.gmail; Sat, 28 Sep 2013 07:05:32 -0700 (PDT) X-Received: by 10.58.133.66 with SMTP id pa2mr11911781veb.18.1380377132552; Sat, 28 Sep 2013 07:05:32 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id c11si3296103vej.128.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 07:05:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jy13so2805018veb.6 for ; Sat, 28 Sep 2013 07:05:02 -0700 (PDT) X-Gm-Message-State: ALoCoQl2XDUbAyLdvsOg6JDccnXLDtzZVoyVrGFEJlHTEDrpOo515PhHcNp1HLvMm7M/BBAd6BzO X-Received: by 10.220.145.132 with SMTP id d4mr11885229vcv.9.1380377102452; Sat, 28 Sep 2013 07:05:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp11281vcz; Sat, 28 Sep 2013 07:05:01 -0700 (PDT) X-Received: by 10.68.59.38 with SMTP id w6mr13078725pbq.135.1380377101562; Sat, 28 Sep 2013 07:05:01 -0700 (PDT) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id rz6si9738521pab.336.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 07:05:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id rr4so3678518pbb.20 for ; Sat, 28 Sep 2013 07:05:00 -0700 (PDT) X-Received: by 10.66.152.102 with SMTP id ux6mr17216582pab.79.1380377100810; Sat, 28 Sep 2013 07:05:00 -0700 (PDT) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id im8sm15268893pbc.24.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 07:05:00 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Cc: Marc Zyngier , Andre Przywara , linaro-kernel@lists.linaro.org, patches@linaro.org, Christoffer Dall Subject: [PATCH] KVM: ARM: arch_timer: Initialize cntvoff at vcpu_init Date: Sat, 28 Sep 2013 07:05:13 -0700 Message-Id: <1380377113-15183-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Initialize the cntvoff at vcpu_init time, not before running the VCPUs at the first time because that will overwrite any potentially restored values from user space. Signed-off-by: Christoffer Dall --- virt/kvm/arm/arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 8168437..2f6b5fe 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -181,6 +181,7 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) INIT_WORK(&timer->expired, kvm_timer_inject_irq_work); hrtimer_init(&timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); timer->timer.function = kvm_timer_expire; + vcpu->kvm->arch.timer.cntvoff = kvm_phys_timer_read(); } static void kvm_timer_init_interrupt(void *info) @@ -282,7 +283,6 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) int kvm_timer_init(struct kvm *kvm) { if (timecounter && wqueue) { - kvm->arch.timer.cntvoff = kvm_phys_timer_read(); kvm->arch.timer.enabled = 1; }