From patchwork Thu Dec 12 19:55:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 3334851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 676AFC0D4A for ; Thu, 12 Dec 2013 22:18:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55501207C1 for ; Thu, 12 Dec 2013 22:18:12 +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 657B2207BE for ; Thu, 12 Dec 2013 22:18:11 +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 1VrCNb-0004N3-P1; Thu, 12 Dec 2013 19:57:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrCMs-0008Gl-6d; Thu, 12 Dec 2013 19:56:18 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrCLQ-00083J-Gb for linux-arm-kernel@lists.infradead.org; Thu, 12 Dec 2013 19:54:49 +0000 Received: by mail-pd0-f179.google.com with SMTP id r10so1082626pdi.38 for ; Thu, 12 Dec 2013 11:54:28 -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=mhx11uu4fUq0v0MVs/Y0421Q6WuTfSm7J2bCZYKVmfs=; b=ZDaXRQGu/lRT7ApiQkavmul8tIOeKJxy2Bts69NsMJTdKPWTzoTEPFEgQ3fhmixkgn +/i5ElQOXJO4Xmia8jWTxPHQ6XDtFL4C3vEyB+FhKoCswoKHFKNjOrM1/Y6xfFhDlOII eDNDWWeYAY8Od4SPfEZlWrc+6lFfXdSjmWDJoWMlAQ+tMtoLZGOAlVquH8nTY4SdIjGs Avzhz+vcg82rSpoP7xAe+gIe9D0ns754flhlEQAlipwu3BEJqh32i9hKiVlbqzEUVaLm B3fcV4ZLLQwt7VRRUHTZdydING/zH+rTX15rFKzxVZ9SvwdAD8eDHZWyBGXHSnZv+lr5 sR7g== X-Gm-Message-State: ALoCoQnCAHb03JR1ECfjBXUGTg/ig3kZTeclr/rB3OLgzTY42ojUvaLNV6glC65N6xESmdBuQKqk X-Received: by 10.68.218.3 with SMTP id pc3mr15246867pbc.71.1386878068429; Thu, 12 Dec 2013 11:54:28 -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 ql10sm4014884pbc.44.2013.12.12.11.54.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Dec 2013 11:54:27 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/10] arm/arm64: kvm: Set vcpu->cpu to -1 on vcpu_put Date: Thu, 12 Dec 2013 11:55:45 -0800 Message-Id: <1386878149-13397-7-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1386878149-13397-1-git-send-email-christoffer.dall@linaro.org> References: <1386878149-13397-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131212_145448_667583_A5B772A8 X-CRM114-Status: GOOD ( 10.96 ) X-Spam-Score: 0.6 (/) 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=-1.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, UNPARSEABLE_RELAY autolearn=no 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. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- Changelog[v4]: - New in series 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 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); }