From patchwork Fri Apr 24 05:27:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47496 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8921020553 for ; Fri, 24 Apr 2015 05:30:32 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf9001173wgi.3 for ; Thu, 23 Apr 2015 22:30:31 -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=CsITtXXXPNPnhzt45LXwErmI9NEJqPV67CgmMAPEH58=; b=dTSXy/SV081qszKVdqxknci2gk00PlWiVQUE71KX6wl8vKl18W1x8Y9/7r1Vf8iiuj oLFFCyv0+r5z239xrRULDH5y29LRRcLdhq7fpd/cEl4llQiB5HsL7utnlkmcCwheBYW1 l7h8/ZIv04loPt2d7Sbag6G5c1504vld2Ex60DOzIXMxCXjvpzC4qxkpa3CFhFdGUP3D nMHOxa6DpF4W2s42Cg4spw9+ix6nae5+WpnY7cVym3seEwhYDWIrdtwvf1MACJ6P8bpB A4XGVnZ1zQC0XAL2BifWVMKwa4HOdDHNXyeTFpvJlNGVKjmFJX7BlgrJWY+0SQPP/400 CIHQ== X-Gm-Message-State: ALoCoQkDRRbcFP/fAwG8DaYSOydu3TyLS+v7STO4EcpSL5WUMORL5JsTZZ9wJC0FtklEIL2kPChA X-Received: by 10.180.105.226 with SMTP id gp2mr157402wib.1.1429853431884; Thu, 23 Apr 2015 22:30:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.38 with SMTP id w6ls433400laa.13.gmail; Thu, 23 Apr 2015 22:30:31 -0700 (PDT) X-Received: by 10.152.207.41 with SMTP id lt9mr5381602lac.52.1429853431721; Thu, 23 Apr 2015 22:30:31 -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 da9si7465725lad.76.2015.04.23.22.30.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 22:30:31 -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 ga7so28600094lbc.1 for ; Thu, 23 Apr 2015 22:30:31 -0700 (PDT) X-Received: by 10.152.205.6 with SMTP id lc6mr2857469lac.73.1429853431484; Thu, 23 Apr 2015 22:30: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 l1csp977218lbt; Thu, 23 Apr 2015 22:30:30 -0700 (PDT) X-Received: by 10.66.222.130 with SMTP id qm2mr11586636pac.39.1429853428235; Thu, 23 Apr 2015 22:30:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id at5si15744662pbc.170.2015.04.23.22.30.26; Thu, 23 Apr 2015 22:30:28 -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 S1754481AbbDXFaZ (ORCPT + 2 others); Fri, 24 Apr 2015 01:30:25 -0400 Received: from mail-ob0-f176.google.com ([209.85.214.176]:34007 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754417AbbDXFaY (ORCPT ); Fri, 24 Apr 2015 01:30:24 -0400 Received: by obfe9 with SMTP id e9so30176291obf.1 for ; Thu, 23 Apr 2015 22:30:24 -0700 (PDT) X-Received: by 10.202.46.81 with SMTP id u78mr5374018oiu.54.1429853424127; Thu, 23 Apr 2015 22:30:24 -0700 (PDT) Received: from localhost ([167.160.116.36]) by mx.google.com with ESMTPSA id kw2sm6062771obb.24.2015.04.23.22.30.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Apr 2015 22:30:23 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: jslaby@suse.cz, christoffer.dall@linaro.org, shannon.zhao@linaro.org Subject: [PATCH for 3.12.y stable 11/63] arm/arm64: kvm: Set vcpu->cpu to -1 on vcpu_put Date: Fri, 24 Apr 2015 13:27:09 +0800 Message-Id: <1429853281-6136-12-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 e9b152cb957cb194437f37e79f0f3c9d34fe53d6 upstream. The arch-generic KVM code expects the cpu field of a vcpu to be -1 if the vcpu is no longer assigned to a cpu. This is used for the optimized make_all_cpus_request path and will be used by the vgic code to check that no vcpus are running. Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao --- arch/arm/kvm/arm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 9cf0778..d45c36c 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -340,6 +340,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) { + /* + * The arch-generic KVM code expects the cpu field of a vcpu to be -1 + * if the vcpu is no longer assigned to a cpu. This is used for the + * optimized make_all_cpus_request path. + */ + vcpu->cpu = -1; + kvm_arm_set_running_vcpu(NULL); }