From patchwork Tue Jun 30 10:49:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 50462 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C4D3229DF for ; Tue, 30 Jun 2015 10:51:09 +0000 (UTC) Received: by wiar9 with SMTP id r9sf5161512wia.1 for ; Tue, 30 Jun 2015 03:51:08 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=yBC0L48I5MDD9w8cqRu2XVSnDuOyYOf5Fg9bd3U1Fyw=; b=Z6ntpMVwzOn3tFkr5/ziRe1+QBTs/VS7M45z/ObhntEPN/1h8Axkyqr1z84fUIMCmd gODwelCCclP/oeK2+Iq6GlKRqJ+jgqRafj/m2I79XKL4lwFpUOjZK53xHFOOOo18oEOc DlB87+HqxgiLz7lfODsynCSpRou1r7YSVvjFyITGqw+472w2o2Q21f2Z+6ZK0a1pcq8y /m9Lu7VN8kOL9i67+kVk711r6G5dB4Fn2b799y/QctCKeulQ7qxbor61Svba1uxVJXYL H7XYChMbpTnjP0Hu3BXyzEUGhjDY283r/5ny2N+vpTBGixYdT1dUbM50WSlQbeuuHrPv f58Q== X-Gm-Message-State: ALoCoQmpKRGB4ZMI7CYbLh98y5qsKb3UYlKu26y02H8pErchH1vPtiQzNGv4oncMbILk2RL0xjBh X-Received: by 10.181.12.104 with SMTP id ep8mr11472761wid.7.1435661468581; Tue, 30 Jun 2015 03:51:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.7 with SMTP id bc7ls25657lab.74.gmail; Tue, 30 Jun 2015 03:51:08 -0700 (PDT) X-Received: by 10.152.205.67 with SMTP id le3mr18920156lac.50.1435661468292; Tue, 30 Jun 2015 03:51:08 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id kg7si37767628lbc.176.2015.06.30.03.51.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 03:51:08 -0700 (PDT) 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 laar3 with SMTP id r3so8206085laa.0 for ; Tue, 30 Jun 2015 03:51:08 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr18797749lbc.117.1435661468156; Tue, 30 Jun 2015 03:51:08 -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.108.230 with SMTP id hn6csp2353112lbb; Tue, 30 Jun 2015 03:51:07 -0700 (PDT) X-Received: by 10.66.63.71 with SMTP id e7mr41424379pas.57.1435661466748; Tue, 30 Jun 2015 03:51:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si66313267par.87.2015.06.30.03.51.05; Tue, 30 Jun 2015 03:51:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbbF3KvE (ORCPT + 2 others); Tue, 30 Jun 2015 06:51:04 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35699 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbbF3KvE (ORCPT ); Tue, 30 Jun 2015 06:51:04 -0400 Received: by pactm7 with SMTP id tm7so3811696pac.2 for ; Tue, 30 Jun 2015 03:51:03 -0700 (PDT) X-Received: by 10.68.203.231 with SMTP id kt7mr42362264pbc.58.1435661463558; Tue, 30 Jun 2015 03:51:03 -0700 (PDT) Received: from localhost ([120.136.36.232]) by mx.google.com with ESMTPSA id y1sm45230330pdy.2.2015.06.30.03.51.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 03:51:02 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, christoffer.dall@linaro.org, shannon.zhao@linaro.org Subject: [PATCH for 3.14.y stable 14/22] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Tue, 30 Jun 2015 18:49:02 +0800 Message-Id: <1435661350-8060-15-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1435661350-8060-1-git-send-email-shannon.zhao@linaro.org> References: <1435661350-8060-1-git-send-email-shannon.zhao@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Christoffer Dall 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 --- 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 6cd63a9..bc6d617 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2344,7 +2344,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 4a7f538..9c58125 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -680,6 +680,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; }