From patchwork Fri Sep 25 21:41:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 7268191 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B91A1BEEC1 for ; Fri, 25 Sep 2015 21:44:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01D95208F7 for ; Fri, 25 Sep 2015 21:44:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD826208E6 for ; Fri, 25 Sep 2015 21:44:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zfalq-00067R-Jd; Fri, 25 Sep 2015 21:43:10 +0000 Received: from mail-pa0-f48.google.com ([209.85.220.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZfalZ-0005vo-0k for linux-arm-kernel@lists.infradead.org; Fri, 25 Sep 2015 21:42:53 +0000 Received: by pacex6 with SMTP id ex6so116322441pac.0 for ; Fri, 25 Sep 2015 14:42: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:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1LWI9bBj+KDZnOG/uISh3NaQrkF8KIvfrPwqOhsoxVM=; b=P2AEqOlle1FdivsurLjKiTAv2HtOlBED5vuN6WCeUohwe6NKkDbeZbqzrONqkWJUa9 Cdh1yJmk2fspbM2qbqGHf/qfnnwMcXFhlGDuj1/UJ9ViisjRuD/Jj615iCS81YdlgK7h oz6O8Ofjmy8rIc1Q3n3ypsIZGdWxQeY9qsK68u/oEPlZmiPQ8DKTyckW2aFMbT5Lc43d /nvs2mPrWJWPfwAzQs7n2Hynr9RIdr9Zl4+Bv1o2vVvDF3cdN2/+8uJbjhLkKpzjmuKd JGWbD5IKruZ3moRnG4UpJc26u5QJ/1IagqflYILIMUVnP9B6wEfJjwU6ZPn45tnTJuvW 9vTQ== X-Gm-Message-State: ALoCoQlgeoMU2xHP5Na9+STHZxVwOPrxdomUmpPnNwQGYjfd3l/ODO5rIscEqRBUH6WBsV/s1+5I X-Received: by 10.67.6.164 with SMTP id cv4mr10171652pad.59.1443217352406; Fri, 25 Sep 2015 14:42:32 -0700 (PDT) Received: from gnx2579.st.com. ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id u1sm5606756pbz.56.2015.09.25.14.42.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 14:42:31 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, drjones@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v3 2/4] KVM: arm/arm64: check power_off in kvm_arch_vcpu_runnable Date: Fri, 25 Sep 2015 23:41:15 +0200 Message-Id: <1443217277-13173-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443217277-13173-1-git-send-email-eric.auger@linaro.org> References: <1443217277-13173-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150925_144253_103272_DE7F6F92 X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, patches@linaro.org 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 kvm_arch_vcpu_runnable now also checks whether the power_off flag is set. Signed-off-by: Eric Auger Reviewed-by: Christoffer Dall --- arch/arm/kvm/arm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 2b19ef7..9d16f76 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -352,7 +352,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, */ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) { - return !!v->arch.irq_lines || kvm_vgic_vcpu_pending_irq(v); + return ((!!v->arch.irq_lines || kvm_vgic_vcpu_pending_irq(v)) + && !v->arch.power_off); } /* Just ensure a guest exit from a particular CPU */