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: 5433471 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D796BEEA8 for ; Wed, 3 Dec 2014 21:18:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B216E202F2 for ; Wed, 3 Dec 2014 21:18:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE7D020253 for ; Wed, 3 Dec 2014 21:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751343AbaLCVSJ (ORCPT ); Wed, 3 Dec 2014 16:18:09 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:42851 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbaLCVSI (ORCPT ); Wed, 3 Dec 2014 16:18:08 -0500 Received: by mail-lb0-f172.google.com with SMTP id u10so13100960lbd.17 for ; Wed, 03 Dec 2014 13:18:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bfNq6j/24tNppiTK+0kekiBqQuLyy/shJUyZ8No3FDg=; b=HYcL/0SqdaTrVvdVmoq/c/ABBXRIzg/UCh9VhO3DAU67CrwHByO74bWF/0SthlwzWm 1PLGQVeAxS3HGUdlWiuWWsbGlcedKcm/+pxFXaVeeyJXjuk5mU3fTEa954urWNrnJ2aL txXme8mjWJFKeU27HUdZt0esltxkT5PyFCDqU6LYqq4anl5hQm+oyDFwIwBPKbo0pzEJ Dx1ZAJJOOvtDss6BOSwlBkbUQVO++7jIjajN5qwctsLjfa69sOvrrkC1pLDuG+G3DCKW Zt7f+Vd9Aw2yZoQ3k2qsEFkZyqkoAf+yRvrjWI2I9LRs2jpOu76v6jtgwDb7ThL9S3hV BnIQ== X-Gm-Message-State: ALoCoQmEvK2Ft5hj8grwfFQLfuJTSpQWp3fPY/8xmcx4Gl5An5oK4t+mfF5kI7AKzqNZY+Y+4qLD 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 Cc: kvm@vger.kernel.org, Ard Biesheuvel , Peter Maydell , Marc Zyngier , Laszlo Ersek , Andrew Jones , Christoffer Dall 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Marc Zyngier --- 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; }