From patchwork Thu Apr 30 12:12:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47835 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 969DB2121F for ; Thu, 30 Apr 2015 12:29:18 +0000 (UTC) Received: by laat2 with SMTP id t2sf15072685laa.2 for ; Thu, 30 Apr 2015 05:29:17 -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: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=47SvCi9pvH7+NiHN+zcDvKA50ZiOuO8ryVD01l9ar30=; b=JejPlYJhtt7pqzm519AVZHFEzCcJtsgmN2oiR7c8mClINHGvBcz39wqLkJMsN8CV5E HAVjMfdvyf6Vw2BWdDXLvkwqmnRvJwVS+70QgDHJp7CJxWcD8HtI/HcMd+IxcVBq4O3o bS3q5UxUwQAhP5iCpvKDMdiS/uz6Bh5i58t86+rWU80RbBU7Gi7k/tx4gXv50DvW7C1j AfSh3rFbPQU+QZoyHPaOzJnKCEYV44rZkzggCdXePvXKmVfEBWOWtD0Y+/1+bvmnT2Oa Bp5D6vZzsoYwwTc84Bbp2gU5TR1Xw72i9lDfCLeQSugygmkij+/AKvCFzVQ5YwCEsF4c /gXQ== X-Gm-Message-State: ALoCoQkvisnomBbR6pDltZp4/diPS6Un3GmgBlHOtflEHl8jcE+pp6yZ7jmMun4DwNqAjijNH8nK X-Received: by 10.112.151.146 with SMTP id uq18mr2405110lbb.20.1430396957484; Thu, 30 Apr 2015 05:29:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.196 with SMTP id a4ls376671lak.30.gmail; Thu, 30 Apr 2015 05:29:17 -0700 (PDT) X-Received: by 10.152.182.167 with SMTP id ef7mr3594753lac.109.1430396957348; Thu, 30 Apr 2015 05:29:17 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id j8si1677057lah.14.2015.04.30.05.29.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 05:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbqq2 with SMTP id qq2so43108748lbb.3 for ; Thu, 30 Apr 2015 05:29:17 -0700 (PDT) X-Received: by 10.112.204.72 with SMTP id kw8mr3633595lbc.88.1430396956927; Thu, 30 Apr 2015 05:29:16 -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 l1csp3083279lbt; Thu, 30 Apr 2015 05:29:16 -0700 (PDT) X-Received: by 10.66.145.133 with SMTP id su5mr7656980pab.114.1430396280161; Thu, 30 Apr 2015 05:18:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pt2si3298787pbb.51.2015.04.30.05.17.58; Thu, 30 Apr 2015 05:18:00 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1752163AbbD3MRz (ORCPT + 28 others); Thu, 30 Apr 2015 08:17:55 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:53679 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751453AbbD3MMf (ORCPT ); Thu, 30 Apr 2015 08:12:35 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YnnKT-0008Dq-FX; Thu, 30 Apr 2015 14:12:33 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Christoffer Dall , Shannon Zhao , Jiri Slaby Subject: [PATCH 3.12 55/63] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Thu, 30 Apr 2015 14:12:24 +0200 Message-Id: <96c7d3a6b93b12868acd5432e408f42e36afe8d5.1430387326.git.jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <45aaf85687dd6ac119c55c5ec0dbe0bef0e62235.1430387326.git.jslaby@suse.cz> References: <45aaf85687dd6ac119c55c5ec0dbe0bef0e62235.1430387326.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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.173 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 3.12-stable review patch. If anyone has any objections, please let me know. =============== 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 Signed-off-by: Jiri Slaby --- 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 858aecf21db2..0d578c0f5749 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2299,7 +2299,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 7dc8e010c200..137cee9f3fd2 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -678,6 +678,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; }