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: 7268171 Return-Path: X-Original-To: patchwork-kvm@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 E00D79F380 for ; Fri, 25 Sep 2015 21:43:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12921208E6 for ; Fri, 25 Sep 2015 21:43:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 380E0208E1 for ; Fri, 25 Sep 2015 21:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932116AbbIYVn3 (ORCPT ); Fri, 25 Sep 2015 17:43:29 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36742 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbbIYVmc (ORCPT ); Fri, 25 Sep 2015 17:42:32 -0400 Received: by pablk4 with SMTP id lk4so19529347pab.3 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=QOzIuh5Ju9WqEMUwdc+mVP0T5roC1J0g3X+UKPO2uesIPRaRgAHbE0unL+cmqIESyE AeqmZvtyzMqHrxmBXl3+barKCbn/Xj5qhf7rGfCRnkNbQGDwBECMZ3ge5JsLdrlJY+5L e/av7EysEkMdgkhaogXsviCko7X4Y2dfL/lzWt3nJcZjjvQ/Xhx7w6Ym9Q1f1w2gMJnH kh7a+wAmJZGwXZz5CFxUvVmCA5eQhtLhI/lGaVMRZPqTZ91w2ZdClJ5mEdUxLIXadzW7 y0zKLWzON4jcPhHOu4fiGQV8P1sIOkkT/9Ic6NjLGugxLFuHVvBkjaO0Py3lcYD5NqQq VpbA== X-Gm-Message-State: ALoCoQmtMoPidgl5/BIJCt8lXqQD6Qm2U4vK1KSIbuHuVVDVhjKrXMdxATWHEfgv8ZxV6G9HOAn9 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 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 */