From patchwork Thu Nov 27 18:40:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 41643 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0695F2486D for ; Thu, 27 Nov 2014 18:42:52 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf3514582eek.1 for ; Thu, 27 Nov 2014 10:42:50 -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=AAoiU59VbpuqTvo65FW831gF/aO1SS8W9dkbBeesR0s=; b=Ae9p8YExbztyY6Tqhw/brSCPFIcr7Vy2XPfJA5im9NFkHJQqHC/dlfwTECxh1A8wFo NpXmvH/9s+t4jHlfUHoBYoi5Q0s1qvk+ut9w7f+EitChGun6YZfPW8TzSnkoGXE/tlDK puidx3cyu+Nba3lnDRvPQbsM7Fk/Y5X5Q+vlC6v63JIb2nm4OXmb3EaZndPC/2TXiJih auRLE12VjMthr/g5HgY+zAQu8dIm1Rj7vKxMpsqvkgvP56Li1MRBXCEm2HY7TPGPCBsJ hHIEnDKcHj4Tw92ZjnCllt7bTwKFCYV2LWzu6Ttt9CKHA6cQiRPtd9Q44Izl8paNYB41 c85w== X-Gm-Message-State: ALoCoQkpeJqmnj27JYMsEKsYtYgG9i8jkQNg0d2rpz/qkyPlcdbCU12rZfSDT/dlYkiP5TocpLK1 X-Received: by 10.180.101.40 with SMTP id fd8mr1249387wib.5.1417113770917; Thu, 27 Nov 2014 10:42:50 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.39 with SMTP id p7ls877241lap.5.gmail; Thu, 27 Nov 2014 10:42:50 -0800 (PST) X-Received: by 10.112.182.72 with SMTP id ec8mr39549839lbc.87.1417113770524; Thu, 27 Nov 2014 10:42:50 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id bf5si7992203lab.62.2014.11.27.10.42.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Nov 2014 10:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id q1so4505634lam.25 for ; Thu, 27 Nov 2014 10:42:50 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr39810971lbo.32.1417113770108; Thu, 27 Nov 2014 10:42:50 -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.184.201 with SMTP id ew9csp837993lbc; Thu, 27 Nov 2014 10:42:49 -0800 (PST) X-Received: by 10.66.150.164 with SMTP id uj4mr66054968pab.14.1417113768320; Thu, 27 Nov 2014 10:42:48 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q5si12753026pdm.153.2014.11.27.10.42.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 10:42:48 -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 1Xu40B-0000pT-3g; Thu, 27 Nov 2014 18:41:15 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xu3zm-0000dt-6a for linux-arm-kernel@lists.infradead.org; Thu, 27 Nov 2014 18:40:50 +0000 Received: by mail-la0-f42.google.com with SMTP id s18so4641506lam.29 for ; Thu, 27 Nov 2014 10:40:28 -0800 (PST) X-Received: by 10.152.21.97 with SMTP id u1mr40104170lae.84.1417113628043; Thu, 27 Nov 2014 10:40:28 -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 x1sm1682425lae.42.2014.11.27.10.40.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Nov 2014 10:40:27 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/5] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Thu, 27 Nov 2014 19:40:56 +0100 Message-Id: <1417113660-23610-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1417113660-23610-1-git-send-email-christoffer.dall@linaro.org> References: <1417113660-23610-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141127_104050_425742_86E3472A X-CRM114-Status: GOOD ( 13.18 ) 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.215.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.42 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Marc Zyngier , Peter Maydell , Christoffer Dall , kvm@vger.kernel.org, Ard Biesheuvel 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.215.52 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. Implment the expected functionality and clarify the ABI. 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 9e193c8..4dcc8c2 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_and_clear_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) vcpu->arch.pause = true; + else + vcpu->arch.pause = false; return 0; }