From patchwork Fri Aug 7 16:08:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6970941 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C792A9F373 for ; Fri, 7 Aug 2015 16:11:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A40E2061E for ; Fri, 7 Aug 2015 16:11:43 +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 3FB732039C for ; Fri, 7 Aug 2015 16:11:42 +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 1ZNkDT-000217-Ua; Fri, 07 Aug 2015 16:09:55 +0000 Received: from mail-wi0-f180.google.com ([209.85.212.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNkDJ-0001on-Ai for linux-arm-kernel@lists.infradead.org; Fri, 07 Aug 2015 16:09:46 +0000 Received: by wijp15 with SMTP id p15so65650340wij.0 for ; Fri, 07 Aug 2015 09:09:23 -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=vPW0sJYK2BGXZ/vKJJxYpmqDH4LjvzllCjYMHpcSuKY=; b=JOS1Uz/7OVZzjIx81ddfyd637Ho88NzmAzfhaImn7WP7OaZkXks0frtUjkcdZABMG1 PgMTDaO/2rQqhlfWVL6GSZS3xBMI/QSZCC6c9qTVLlanbtmkXt26SwwEnOQeqeP+P5jX 7Bi6ZT6eScYr8D6AZrKedxKZYXS0ku8PtdugelEmmhnLQ/Yt9ySsSoOz5v4+iVaqysTz zZOqC0RFNmS2PekoKLzeuBfw07DOX2Rl37YiXJ2yENR9guh2twGZJnATxZRqwwFyGhxT 9SMcencHF+hN8gS7SKPnIOnMMjuZtYhVgfsusx7cKXPkhieVwj3FsW63u+CgNwvBODVw kQMA== X-Gm-Message-State: ALoCoQmqU5aVqXzjLSqkpTY9RQlpC+/owkSTviFhVu7us2MmfxEi7wm0MXgcjCdRg53J4WP68vIx X-Received: by 10.194.122.132 with SMTP id ls4mr15671732wjb.130.1438963763826; Fri, 07 Aug 2015 09:09:23 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id by17sm9127438wib.18.2015.08.07.09.09.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Aug 2015 09:09:22 -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 v2 2/4] KVM: arm/arm64: check power_off in kvm_arch_vcpu_runnable Date: Fri, 7 Aug 2015 18:08:31 +0200 Message-Id: <1438963713-10460-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438963713-10460-1-git-send-email-eric.auger@linaro.org> References: <1438963713-10460-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150807_090945_656683_3DD175C4 X-CRM114-Status: GOOD ( 12.11 ) 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: pbonzini@redhat.com, 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.3 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 --- 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 3ac6b4c..4f50be3 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -347,7 +347,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 */