From patchwork Wed Dec 3 21:18:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 41882 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 705E725E66 for ; Wed, 3 Dec 2014 21:21:08 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf10249815lbj.7 for ; Wed, 03 Dec 2014 13:21:07 -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=KWW9GkKcZpqslCeime5wOBxtTS/fAdl6Q94M3jpqlCY=; b=ETTZVlRNSF7p/Ql3VEJw8rUVZxGeB4IH1PkWeRyfUVq15kYyXiDRmW9CRW2Zn5N1ck SZ2IkdJ4c0PqcY7HnmfUyAfoORdiwOeZd2ffL44EUEpLMWBPMfthGdZFZ0R34Hga71+I yT8pU4l6hshB7bZlPFSLLWPLC2QIvzlNJKNQXQH5DRjpbFp2sA9XLyVT8645fL6NVSvM 3GWIBfcQGtXtA2AKZwXoGcEEdUYuCyAKDyp3IhLJudzQTjqjWfA5yF7XIUYtcltnzg+K lVxz9hzV7s+IraohDuP/K1V/534oiLj7HewAH/Ice2ruFJxE9YLGRf49KgQKMMGBNYLU 39rQ== X-Gm-Message-State: ALoCoQk0SvbtqdLsMZAdYYTDuB7cBy6NPKa/0jNjdq/nqq44uM/PD4bliwJPqzYP7YojCNY/0h0V X-Received: by 10.152.43.50 with SMTP id t18mr13263lal.8.1417641667516; Wed, 03 Dec 2014 13:21:07 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.74 with SMTP id q10ls211074laq.43.gmail; Wed, 03 Dec 2014 13:21:07 -0800 (PST) X-Received: by 10.152.19.167 with SMTP id g7mr6266798lae.62.1417641667376; Wed, 03 Dec 2014 13:21:07 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id kl4si16002176lbc.134.2014.12.03.13.21.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 13:21:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so13832028lbj.41 for ; Wed, 03 Dec 2014 13:21:07 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr6034964lbc.23.1417641667291; Wed, 03 Dec 2014 13:21:07 -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 ew9csp742983lbc; Wed, 3 Dec 2014 13:21:06 -0800 (PST) X-Received: by 10.68.211.193 with SMTP id ne1mr19617209pbc.49.1417641663675; Wed, 03 Dec 2014 13:21:03 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id bw8si40231294pad.64.2014.12.03.13.21.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Dec 2014 13:21:03 -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 1XwHJx-0006pu-0q; Wed, 03 Dec 2014 21:18:49 +0000 Received: from mail-lb0-f176.google.com ([209.85.217.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwHJf-0006iW-0O for linux-arm-kernel@lists.infradead.org; Wed, 03 Dec 2014 21:18:31 +0000 Received: by mail-lb0-f176.google.com with SMTP id p9so12715537lbv.7 for ; Wed, 03 Dec 2014 13:18:06 -0800 (PST) X-Received: by 10.152.88.69 with SMTP id be5mr6292530lab.36.1417641486279; Wed, 03 Dec 2014 13:18:06 -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 j2sm6745480lbp.16.2014.12.03.13.18.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Dec 2014 13:18:05 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/6] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Wed, 3 Dec 2014 22:18:38 +0100 Message-Id: <1417641522-29056-3-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1417641522-29056-1-git-send-email-christoffer.dall@linaro.org> References: <1417641522-29056-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141203_131831_298990_708A9B88 X-CRM114-Status: GOOD ( 11.80 ) 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.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.176 listed in wl.mailspike.net] Cc: Peter Maydell , Andrew Jones , kvm@vger.kernel.org, Ard Biesheuvel , Marc Zyngier , Laszlo Ersek , Christoffer Dall 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.182 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. 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; }