From patchwork Tue Dec 17 05:29:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 3359261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 689B99F314 for ; Tue, 17 Dec 2013 05:34:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CD1C2035E for ; Tue, 17 Dec 2013 05:34:23 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3A8E20320 for ; Tue, 17 Dec 2013 05:34:22 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsnGe-0002Ds-Kr; Tue, 17 Dec 2013 05:32:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsnG3-0001Am-2j; Tue, 17 Dec 2013 05:31:51 +0000 Received: from mail-pb0-f54.google.com ([209.85.160.54]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsnF5-00010W-BZ for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2013 05:30:52 +0000 Received: by mail-pb0-f54.google.com with SMTP id un15so6465613pbc.41 for ; Mon, 16 Dec 2013 21:30:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=80og6HTJ1IrV5XgET6X4+RjtWgkK5hLqTu55IJCydXc=; b=IaUFJoroqocU6F2kTqP+NuHWNR83YDFNEhz7tvWKa+xxuDvVKbXG2NGwfl71UYCH16 YxB2kt4Khf8M3l7u2CbQ9Q5EvhcSbo/H0E7yvPC1GAaDtkn7UQ5/doMjf37bK0Njmvuu TbOM9n20KdMqshDj8+iSCMwkgX59lMKWKpQ6Pt3+CYztQ8SpX7a6hoSQTBR5gVo9GV5m LHpJft4PYZiCHjHETiClLU6V9F3JOU+P/akO4ohqsGzOaDwZuXIfmUh8O801Ij7Ej+0/ oarN4VVtIgb0sn9rpz6N13TMGuCiGYvLl+zgq5hwsJAIQqHDfNdNKxT6QPU1jywHeXCl ssvg== X-Gm-Message-State: ALoCoQk6+SqLdi3+sTCzVrEG4nDm07cVVcICIZr4VtqANAgRQiuALfrer2nf5mK2NBbYcJIS8m9a X-Received: by 10.68.217.129 with SMTP id oy1mr24965390pbc.23.1387258229829; Mon, 16 Dec 2013 21:30:29 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id vn10sm30771688pbc.21.2013.12.16.21.30.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 21:30:29 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 06/10] arm/arm64: kvm: Set vcpu->cpu to -1 on vcpu_put Date: Mon, 16 Dec 2013 21:29:57 -0800 Message-Id: <1387258201-8738-7-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5 In-Reply-To: <1387258201-8738-1-git-send-email-christoffer.dall@linaro.org> References: <1387258201-8738-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131217_003051_537497_9EB51939 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.1 (/) Cc: linaro-kernel@lists.linaro.org, Christoffer Dall , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/arm/kvm/arm.c | 7 +++++++ 1 file changed, 7 insertions(+) Changelog[v4]: - New in series diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index f290b22..b92ff6d3 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -342,6 +342,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); }