From patchwork Fri Apr 24 05:27:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47494 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 68D7520553 for ; Fri, 24 Apr 2015 05:30:16 +0000 (UTC) Received: by wixv7 with SMTP id v7sf1570741wix.0 for ; Thu, 23 Apr 2015 22:30:15 -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=TAr7DTzMRqRPiG2n2srUqSB4tIjMkvra4TLHvUN0qZE=; b=ecHlSYQMXCEJ2J3Wl9XgZfnGJ5XjoTUsnMYX2SAd2bSfA3klCpbbXlQXVHkaz2sTW0 siTIjeKqCI9ioD/UjoQxFtKL5KFQcW9bIl96UJ/TPpGVHH14mtZZDLQD/AKVdlf9cL/x 5cBCa2PPQ/WNFls0Vbb8TX0k1JPsPI+pdwl8uMGlgOzcLqn5qzS5gHUzpdiinDDCyRXA MBJgSKALdhXU1628W5TOXd1stDa5Eof4bD7Ad+U0ZMCZ9V/TnwWT1z2moC5m7YMBxItm OAFx/nqeQhn/2ZKb7cw6oWnoWsvjRAnnj9U7vJM+DvdkWlGZuHCWTmusFfLnrGYQcitQ OAMg== X-Gm-Message-State: ALoCoQn5/X/72S7TquFo9YKYIUO82/b3uBLSHNqnZ+x1BN+NJGe5/BFrH5ObIaov2Sdl8NWRpvhM X-Received: by 10.194.95.67 with SMTP id di3mr3227822wjb.0.1429853415735; Thu, 23 Apr 2015 22:30:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.227 with SMTP id kt3ls373824lac.18.gmail; Thu, 23 Apr 2015 22:30:15 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr5423407laa.36.1429853415576; Thu, 23 Apr 2015 22:30:15 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id d4si7471503lae.42.2015.04.23.22.30.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 22:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbcga7 with SMTP id ga7so28597082lbc.1 for ; Thu, 23 Apr 2015 22:30:15 -0700 (PDT) X-Received: by 10.152.8.78 with SMTP id p14mr5448742laa.19.1429853415461; Thu, 23 Apr 2015 22:30:15 -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 l1csp977098lbt; Thu, 23 Apr 2015 22:30:14 -0700 (PDT) X-Received: by 10.66.124.164 with SMTP id mj4mr11786564pab.83.1429853413044; Thu, 23 Apr 2015 22:30:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gw3si15799508pac.117.2015.04.23.22.30.12; Thu, 23 Apr 2015 22:30:13 -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 S1754271AbbDXFaL (ORCPT + 2 others); Fri, 24 Apr 2015 01:30:11 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:36689 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260AbbDXFaK (ORCPT ); Fri, 24 Apr 2015 01:30:10 -0400 Received: by oift201 with SMTP id t201so32362312oif.3 for ; Thu, 23 Apr 2015 22:30:10 -0700 (PDT) X-Received: by 10.182.243.228 with SMTP id xb4mr5784509obc.86.1429853410365; Thu, 23 Apr 2015 22:30:10 -0700 (PDT) Received: from localhost ([167.160.116.36]) by mx.google.com with ESMTPSA id gh8sm6061170obb.27.2015.04.23.22.30.07 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Apr 2015 22:30:09 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: jslaby@suse.cz, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Andre Przywara Subject: [PATCH for 3.12.y stable 09/63] arm/arm64: KVM: arch_timer: Initialize cntvoff at kvm_init Date: Fri, 24 Apr 2015 13:27:07 +0800 Message-Id: <1429853281-6136-10-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> References: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> 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: shannon.zhao@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.217.181 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 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 --- 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 9c697db..847d280 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 b001dbf..14d7b51 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);