From patchwork Mon May 4 01:52:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47977 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AECCA2121F for ; Mon, 4 May 2015 01:56:41 +0000 (UTC) Received: by laat2 with SMTP id t2sf42178838laa.2 for ; Sun, 03 May 2015 18:56:40 -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=DUdfWH3uNYRtuVIN29mQzknq/AIsq74z/KFJmeWt4+8Za1gx+QPYGI6Jx9umFL1osw 3bwnHgIXgagGS49Ww/U2rN39PCbPtijgJfleSLvpT6NhWuGe5V3tHodRSLngw80je5pj IpPxC/zYKRUaIHsND3eR/ywzsyIKL5I58jVZD5OWH1gw3GpqnZ2rKBRkizMP+sIScmY9 h/o1f6N8O5IQJOXuj5I9Hqd6iGBxYAzdE2OFsdkewC1b28AhCEkw60jB41M7Ccpe0XgD K/RdiGK938OZ6Ag1ZMhQJMwXjhbk/RAQYSwbPPfCrKlCK4y/rmJOFaaFbCulSpcEFfzs jv8g== X-Gm-Message-State: ALoCoQmx5mF9QuQhWdlZvbyQ5usuvgUEji7y0mTsfoJYbjiZCAbpTvgvnLmnkSmFm7rVV+7tes+9 X-Received: by 10.194.121.67 with SMTP id li3mr16957982wjb.3.1430704600676; Sun, 03 May 2015 18:56:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.2 with SMTP id f2ls325803laa.103.gmail; Sun, 03 May 2015 18:56:40 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr11059313lau.3.1430704600519; Sun, 03 May 2015 18:56:40 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ay8si9083162lbc.111.2015.05.03.18.56.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 18:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbqq2 with SMTP id qq2so95608530lbb.3 for ; Sun, 03 May 2015 18:56:40 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr17373110lak.117.1430704600421; Sun, 03 May 2015 18:56:40 -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.67.65 with SMTP id l1csp1413249lbt; Sun, 3 May 2015 18:56:39 -0700 (PDT) X-Received: by 10.70.134.231 with SMTP id pn7mr38504280pdb.97.1430704598562; Sun, 03 May 2015 18:56:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ix6si17838787pac.46.2015.05.03.18.56.37; Sun, 03 May 2015 18:56:38 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751823AbbEDB4h (ORCPT + 2 others); Sun, 3 May 2015 21:56:37 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34949 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbbEDB4g (ORCPT ); Sun, 3 May 2015 21:56:36 -0400 Received: by pabtp1 with SMTP id tp1so147835320pab.2 for ; Sun, 03 May 2015 18:56:36 -0700 (PDT) X-Received: by 10.70.126.225 with SMTP id nb1mr38453883pdb.71.1430704596556; Sun, 03 May 2015 18:56:36 -0700 (PDT) Received: from localhost ([180.150.153.1]) by mx.google.com with ESMTPSA id b10sm11055800pdj.0.2015.05.03.18.56.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 May 2015 18:56:35 -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 39/47] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Mon, 4 May 2015 09:52:34 +0800 Message-Id: <1430704362-6292-40-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1430704362-6292-1-git-send-email-shannon.zhao@linaro.org> References: <1430704362-6292-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.175 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; }