From patchwork Fri Apr 24 05:27:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47540 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0683720553 for ; Fri, 24 Apr 2015 05:34:49 +0000 (UTC) Received: by wicmx19 with SMTP id mx19sf1562838wic.3 for ; Thu, 23 Apr 2015 22:34:48 -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=G/E2DjzPhhqVMsI/4vikreOO1ZAcNNhNFj5M1o5GPpM=; b=KQoII2+2EmYnreC6UAbNVDhYDe5MtG5LiD54ecTcXS9FaIoQ43mf/L1thhxZ1++fyn krcN6NjkzNG4SPPimo26O0HWvxT2Jwdwspyo7SlO7I9j+K+ZdPEvhoj3PpShsUnpW2sv kvv39LvdF6rVA9l/+HF1huKXdN7Z8WoKiIPdHi9z+T3KQ2Sl+iJ+yjMKqhggF9BLnXEl 5zmf8+Z0ORSkJKEhCwAwxdTIsRiTA7M5LU4Z9tqhy3gpcSb8NZun5OE7nJPijwxSmRkP JMEXuGpBpuXUkZvOts86eFqb9oRnZfOT0olf+K4wIFZeqSEIpzuaZzVCfiLXtjZrg1cU nNuA== X-Gm-Message-State: ALoCoQn8aT2FAHX8lWruVlve1dd8k3yWCOpPI1C1/ZlCBDlP7cvTelheVADv1iVF5D1PNk7GkmCF X-Received: by 10.180.11.101 with SMTP id p5mr163338wib.3.1429853688367; Thu, 23 Apr 2015 22:34:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.130 with SMTP id v2ls362051lae.98.gmail; Thu, 23 Apr 2015 22:34:48 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr5362977lak.29.1429853688089; Thu, 23 Apr 2015 22:34:48 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id as7si7471469lbc.107.2015.04.23.22.34.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 22:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by laat2 with SMTP id t2so27591281laa.1 for ; Thu, 23 Apr 2015 22:34:48 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr5557155lab.35.1429853688011; Thu, 23 Apr 2015 22:34:48 -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.67.65 with SMTP id l1csp978905lbt; Thu, 23 Apr 2015 22:34:47 -0700 (PDT) X-Received: by 10.70.135.168 with SMTP id pt8mr3062635pdb.8.1429853686230; Thu, 23 Apr 2015 22:34:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd10si15800741pdb.178.2015.04.23.22.34.45; Thu, 23 Apr 2015 22:34:46 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754571AbbDXFeo (ORCPT + 2 others); Fri, 24 Apr 2015 01:34:44 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35423 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754577AbbDXFeo (ORCPT ); Fri, 24 Apr 2015 01:34:44 -0400 Received: by oign205 with SMTP id n205so32424221oig.2 for ; Thu, 23 Apr 2015 22:34:44 -0700 (PDT) X-Received: by 10.182.66.106 with SMTP id e10mr5702678obt.42.1429853684055; Thu, 23 Apr 2015 22:34:44 -0700 (PDT) Received: from localhost ([167.160.116.36]) by mx.google.com with ESMTPSA id sn2sm6084428obc.11.2015.04.23.22.34.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Apr 2015 22:34:43 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: jslaby@suse.cz, christoffer.dall@linaro.org, shannon.zhao@linaro.org Subject: [PATCH for 3.12.y stable 55/63] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Fri, 24 Apr 2015 13:27:53 +0800 Message-Id: <1429853281-6136-56-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> References: <1429853281-6136-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.41 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 858aecf..0d578c0 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2299,7 +2299,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 7dc8e01..137cee9 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -678,6 +678,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; }