From patchwork Thu Apr 30 09:24:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47792 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B88992121F for ; Thu, 30 Apr 2015 09:31:25 +0000 (UTC) Received: by lbos2 with SMTP id s2sf12939967lbo.2 for ; Thu, 30 Apr 2015 02:31:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=O4uYka3fjv51BdQTEp4adlWDORi4FKQe+SKuzsETR10=; b=DYDDMQi0mj9ElaViUSlGxMogwLTK8XE6BvKt98uVK8jJYbfMikSMwC/DKXr768No0d wz2A/nacE4H1zcaworWhO4ZStOqwIEN82/83gm4RLya3BBpv/fXpxXMIgXCzuWplT5Op C1TnMvFILQBn04rIFudINbH4r5ZQozKqzJYIJWSzsieQ5rF8QhG4saXdPsQ09RQxg4yG H40rCo8B97nmWlJk+4xPbkLOs2sAtB42J9edasP+CqqEWmF4xf09WNpaP7/ABl2x8++Y xuyPJJjgt6D43RjXXATBGuEG9H7mRCrW00Kf0CZeS9eY6zOsfhZMbj9E8BetBulkdoTH OjkQ== X-Gm-Message-State: ALoCoQkM+4y6QlFGB2zaZ/chLgxy9eOPAu1bz9TmwgIg0HMPkQSd3mHI6BveYfZvk49xicIjdn6w X-Received: by 10.180.10.136 with SMTP id i8mr1209680wib.7.1430386284658; Thu, 30 Apr 2015 02:31:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls324436laj.86.gmail; Thu, 30 Apr 2015 02:31:24 -0700 (PDT) X-Received: by 10.152.206.103 with SMTP id ln7mr3053672lac.40.1430386284536; Thu, 30 Apr 2015 02:31:24 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id y1si1346477lag.66.2015.04.30.02.31.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 02:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laat2 with SMTP id t2so39677720laa.1 for ; Thu, 30 Apr 2015 02:31:24 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr3024080lag.106.1430386284434; Thu, 30 Apr 2015 02:31:24 -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.67.65 with SMTP id l1csp2997743lbt; Thu, 30 Apr 2015 02:31:23 -0700 (PDT) X-Received: by 10.68.111.35 with SMTP id if3mr6507007pbb.70.1430385945423; Thu, 30 Apr 2015 02:25:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nf2si2640288pbc.149.2015.04.30.02.25.44; Thu, 30 Apr 2015 02:25:45 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751245AbbD3JZf (ORCPT + 2 others); Thu, 30 Apr 2015 05:25:35 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:52955 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751361AbbD3JZO (ORCPT ); Thu, 30 Apr 2015 05:25:14 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YnkiV-0005MT-Ud; Thu, 30 Apr 2015 11:25:11 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Christoffer Dall , Andre Przywara , Shannon Zhao , Jiri Slaby Subject: [patch added to the 3.12 stable tree] arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init Date: Thu, 30 Apr 2015 11:24:17 +0200 Message-Id: <1430385911-20480-9-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1430385911-20480-1-git-send-email-jslaby@suse.cz> References: <1430385911-20480-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Christoffer Dall This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit a1a64387adeeba7a34ce06f2774e81f496ee803b upstream. 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: Andre Przywara Acked-by: Marc Zynger Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao Signed-off-by: Jiri Slaby --- 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 9c697db2787e..847d2804253c 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 b001dbff0f38..14d7b51bb223 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1410,7 +1410,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);