From patchwork Tue Jun 2 14:48:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49399 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 306CA20BD1 for ; Tue, 2 Jun 2015 14:51:35 +0000 (UTC) Received: by wiam3 with SMTP id m3sf20112881wia.3 for ; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=yBC0L48I5MDD9w8cqRu2XVSnDuOyYOf5Fg9bd3U1Fyw=; b=DgE64Gru553TgDRO2zjEuoTKn+v5gtN5iNL14A3+vNGcfpM1gB/yc/ZSDOeNje8rrR u7J4XU7xTG8p97q49aSQnfzoTv6uJ5i7z1agl+C24MwuLeS1HuTLsCRygGWDjY7E8ZqW GMdMGk3AfGb5/xQO3TpGo9BY4+5jd7TrHSSomTBLBlEFzxAeMvX8YBDQ0Hfz7yj0b6BD Irk7YJ2uvmB4BIxLpwFujn3wHDeGRAPikUSc/TwVmyaxx22NXFZ1LCU3nGE5EKCd2evv 70ZVWleeH1g8GBN0vGH02CwTFImdCahinDZlrOjSC15Ah2yDyn6ziOb7hiMUi/Us4GiS dt0w== X-Gm-Message-State: ALoCoQnFF/QTt1PciO/GJGBE1CaWlssubhirFD8HLvGM6kYpnEaeaagrwkZySzkIQ4bX7I2EaLoi X-Received: by 10.112.203.168 with SMTP id kr8mr26197710lbc.10.1433256694422; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.228 with SMTP id z4ls698437lal.90.gmail; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) X-Received: by 10.152.28.97 with SMTP id a1mr27049127lah.9.1433256694272; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id qa2si15258656lbb.153.2015.06.02.07.51.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jun 2015 07:51:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbqq2 with SMTP id qq2so106023663lbb.3 for ; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) X-Received: by 10.112.155.197 with SMTP id vy5mr26278497lbb.29.1433256694114; Tue, 02 Jun 2015 07:51:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3129784lbb; Tue, 2 Jun 2015 07:51:32 -0700 (PDT) X-Received: by 10.66.119.239 with SMTP id kx15mr51273079pab.156.1433256692079; Tue, 02 Jun 2015 07:51:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id po1si26750474pac.52.2015.06.02.07.51.31; Tue, 02 Jun 2015 07:51:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753802AbbFBOva (ORCPT + 2 others); Tue, 2 Jun 2015 10:51:30 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:36479 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759065AbbFBOva (ORCPT ); Tue, 2 Jun 2015 10:51:30 -0400 Received: by oihb142 with SMTP id b142so127302007oih.3 for ; Tue, 02 Jun 2015 07:51:29 -0700 (PDT) X-Received: by 10.182.20.195 with SMTP id p3mr23217546obe.6.1433256689814; Tue, 02 Jun 2015 07:51:29 -0700 (PDT) Received: from localhost ([167.160.116.34]) by mx.google.com with ESMTPSA id f5sm9473777oes.2.2015.06.02.07.51.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jun 2015 07:51:28 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, christoffer.dall@linaro.org, shannon.zhao@linaro.org Subject: [PATCH for 3.14.y stable 24/32] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Tue, 2 Jun 2015 22:48:19 +0800 Message-Id: <1433256507-7856-25-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1433256507-7856-1-git-send-email-shannon.zhao@linaro.org> References: <1433256507-7856-1-git-send-email-shannon.zhao@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Christoffer Dall commit 3ad8b3de526a76fbe9466b366059e4958957b88f upstream. The implementation of KVM_ARM_VCPU_INIT is currently not doing what userspace expects, namely making sure that a vcpu which may have been turned off using PSCI is returned to its initial state, which would be powered on if userspace does not set the KVM_ARM_VCPU_POWER_OFF flag. Implement the expected functionality and clarify the ABI. Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao --- Documentation/virtual/kvm/api.txt | 3 ++- arch/arm/kvm/arm.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 6cd63a9..bc6d617 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2344,7 +2344,8 @@ should be created before this ioctl is invoked. Possible features: - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. - Depends on KVM_CAP_ARM_PSCI. + Depends on KVM_CAP_ARM_PSCI. If not set, the CPU will be powered on + and execute guest code when KVM_RUN is called. - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode. Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only). diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 4a7f538..9c58125 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -680,6 +680,8 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu, */ if (test_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) vcpu->arch.pause = true; + else + vcpu->arch.pause = false; return 0; }