From patchwork Thu Apr 30 12:11:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47834 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4602A2121F for ; Thu, 30 Apr 2015 12:28:33 +0000 (UTC) Received: by laat2 with SMTP id t2sf15064251laa.2 for ; Thu, 30 Apr 2015 05:28:32 -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: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=NVo/kxaP7AOqglK2erDExlQNry9q35jxnwMWeeal0bU=; b=SGO91I2blDrfkB2Gdwnv5BDKW+N77Z+3Fj+i1Ja270cbh+x+rGDw1NDR9yrQycEsiW aGfuOmWtOdzzdIT4DLyPpE9tpaVF4zYP6qciy1n9v9GP/H4Yd0foSGC7jLxXW1WOVZuM XPIwhc9vKRnjIVgwAI8fMgg86zjhGa7TmQMVeTs64YE1j6p1Njaj7Zu/uuEdSk06R/K3 FjWEkMbGOogp0HbybIdmt7SyC/V3Z9Nynp4Pb8efCcgTCvs6R1qqoW6rgQcsUbUw3vG8 xwKiwaoBrC9PRPn3dS6qgwICQ37X8djVhh/c+g36B104ZSJoCwLGrisJhrJoYh4JgX75 jt8g== X-Gm-Message-State: ALoCoQnXsmB+Gkpz+dJH/0wngmJ1BD3GU7MaOld95TE92s9/4m7ELQnlEgwtzlF4SDlHuagUZeGJ X-Received: by 10.112.51.68 with SMTP id i4mr2439853lbo.13.1430396912090; Thu, 30 Apr 2015 05:28:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.232 with SMTP id p8ls366561laf.13.gmail; Thu, 30 Apr 2015 05:28:31 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr3522194lag.67.1430396911947; Thu, 30 Apr 2015 05:28:31 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id zl2si1663127lbb.55.2015.04.30.05.28.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 05:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by layy10 with SMTP id y10so42928089lay.0 for ; Thu, 30 Apr 2015 05:28:31 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr3558342lak.29.1430396911848; Thu, 30 Apr 2015 05:28:31 -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 l1csp3082884lbt; Thu, 30 Apr 2015 05:28:30 -0700 (PDT) X-Received: by 10.68.139.225 with SMTP id rb1mr7837116pbb.93.1430396907701; Thu, 30 Apr 2015 05:28:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si3276097pbq.178.2015.04.30.05.28.26; Thu, 30 Apr 2015 05:28:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1752979AbbD3M1m (ORCPT + 28 others); Thu, 30 Apr 2015 08:27:42 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:53587 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751298AbbD3MMe (ORCPT ); Thu, 30 Apr 2015 08:12:34 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YnnKS-00089F-Q9; Thu, 30 Apr 2015 14:12:32 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Christoffer Dall , Andre Przywara , Shannon Zhao , Jiri Slaby Subject: [PATCH 3.12 09/63] arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init Date: Thu, 30 Apr 2015 14:11:38 +0200 Message-Id: X-Mailer: git-send-email 2.3.5 In-Reply-To: <45aaf85687dd6ac119c55c5ec0dbe0bef0e62235.1430387326.git.jslaby@suse.cz> References: <45aaf85687dd6ac119c55c5ec0dbe0bef0e62235.1430387326.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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.52 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 3.12-stable review patch. If anyone has any objections, please let me 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);