From patchwork Mon Dec 15 11:41:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 42235 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43E4121772 for ; Mon, 15 Dec 2014 11:44:40 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf3534915lbi.8 for ; Mon, 15 Dec 2014 03:44:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=oKeAuUKiiHDW8e5F5Un38Z+lcc6ekOWDrVA14xdY+9w=; b=AocFr/yqr7z7EB1EXomJZ9pmSAXGubdTbnLFRj83kDgMS6OvhcBitohl3Pu68wUq0c 3+6eSPUvIySNJ1IImRCgAtnfn0arZ/3O/04zyqNfUps/xC0VXQtVuORzzwADzwiKToAT +tr4XEfuMysuu29TmFZY8medM05sm24hM47GEC2yFAze8QxM/j5VDcptnh0Po1xPZETZ yUiSpkyOGTpurjMrdinxT4U91qLVjImD81CqSOw6zhrnYah46Ak/W42R3aIMPkzMQK6+ SGN7n7Fnvt3Mm1Nve50jdxTkXkGHVYhxYPtahBKAZBnTQYFSMwBwWtQN4nDKD/wIFR65 tgEw== X-Gm-Message-State: ALoCoQmkipdgkr1heW34RVtdFlLTfIiRo17bwRUkA869EoREy67R8F6hQLjRwBGWfw7g3Nn9cnnG X-Received: by 10.152.8.67 with SMTP id p3mr318050laa.4.1418643879283; Mon, 15 Dec 2014 03:44:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.134 with SMTP id b6ls606220laa.27.gmail; Mon, 15 Dec 2014 03:44:39 -0800 (PST) X-Received: by 10.112.171.199 with SMTP id aw7mr29558130lbc.40.1418643879018; Mon, 15 Dec 2014 03:44:39 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id an8si10157275lac.95.2014.12.15.03.44.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 03:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id u10so8971132lbd.31 for ; Mon, 15 Dec 2014 03:44:38 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr22120289laf.81.1418643878917; Mon, 15 Dec 2014 03:44:38 -0800 (PST) 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.142.69 with SMTP id ru5csp688414lbb; Mon, 15 Dec 2014 03:44:38 -0800 (PST) X-Received: by 10.70.135.41 with SMTP id pp9mr50816837pdb.77.1418643877043; Mon, 15 Dec 2014 03:44:37 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kv14si13696139pab.28.2014.12.15.03.44.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2014 03:44:37 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1Y0U3P-0003JG-PR; Mon, 15 Dec 2014 11:43:08 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0U2k-0002qV-BW for linux-arm-kernel@lists.infradead.org; Mon, 15 Dec 2014 11:42:27 +0000 Received: by mail-lb0-f171.google.com with SMTP id w7so4690945lbi.30 for ; Mon, 15 Dec 2014 03:42:03 -0800 (PST) X-Received: by 10.112.119.201 with SMTP id kw9mr29446505lbb.99.1418643723686; Mon, 15 Dec 2014 03:42:03 -0800 (PST) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id ug5sm2616126lac.38.2014.12.15.03.42.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 03:42:02 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [GIT PULL 02/12] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Mon, 15 Dec 2014 12:41:49 +0100 Message-Id: <1418643719-25966-3-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1418643719-25966-1-git-send-email-christoffer.dall@linaro.org> References: <1418643719-25966-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141215_034226_655127_06DBEBEB X-CRM114-Status: GOOD ( 11.37 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.171 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.171 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: Marc Zyngier , Christoffer Dall , kvm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@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.172 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 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 --- 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 7610eaa..bb82a90 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2455,7 +2455,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). - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 for the CPU. diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index b160bea..edc1964 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -663,6 +663,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; }