From patchwork Thu Apr 30 09:25:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47781 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 71B8920553 for ; Thu, 30 Apr 2015 09:25:50 +0000 (UTC) Received: by wiun10 with SMTP id n10sf2956785wiu.1 for ; Thu, 30 Apr 2015 02:25:49 -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=WPMg40HCm7voVuv8IXqz16OBrLfrkgAyKGOd9an05lY=; b=fHDUUUUWd1aulEaRa6rP0RUhKf2rRrn+B/bXgZy2gfRZFq3ghb5wAJBT6GF1jpC1Am KCmuaE8oOQMSJthX9lkOYf0cUOLCBqyl6TmUyQm+Pbkpm6ghbzmwFAwZikItE/IFJya/ jXhHSGzsa0xDyZ4Ba2iRD1Sxu3GR+Ev9dAEdNvzEU5CqIzIrnxHGEwZ6o4OYjDymvzhA AOBb9KHJZUv85wozw5m6faFoZGBzYOAYihwj3LuGgfXwylN/Aw33LJ/C3f7As3RpfKHv 15ToBnaGMsuRJovdwV1vqNWCByrlf7UxpCxHR3vdd/YmyieG9YM9iC9K1riyNCQNEftF ZCzA== X-Gm-Message-State: ALoCoQkiD2enVz1TTYrYNvTpNUK88ScPT7H14X4LA/R11fwp/r/X6U++xUOFdRB6dRHR2eXLIcNT X-Received: by 10.180.88.226 with SMTP id bj2mr1197757wib.7.1430385949800; Thu, 30 Apr 2015 02:25:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.99 with SMTP id c3ls324387laf.96.gmail; Thu, 30 Apr 2015 02:25:49 -0700 (PDT) X-Received: by 10.112.147.201 with SMTP id tm9mr3035772lbb.40.1430385949672; Thu, 30 Apr 2015 02:25:49 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id pc6si1305344lbc.178.2015.04.30.02.25.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 02:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbuc2 with SMTP id uc2so39785523lbb.2 for ; Thu, 30 Apr 2015 02:25:49 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr2934222lah.76.1430385949580; Thu, 30 Apr 2015 02:25:49 -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 l1csp2995467lbt; Thu, 30 Apr 2015 02:25:48 -0700 (PDT) X-Received: by 10.68.57.201 with SMTP id k9mr6418093pbq.135.1430385932256; Thu, 30 Apr 2015 02:25:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nf2si2640288pbc.149.2015.04.30.02.25.31; Thu, 30 Apr 2015 02:25:32 -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 S1751291AbbD3JZ1 (ORCPT + 2 others); Thu, 30 Apr 2015 05:25:27 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:52992 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751294AbbD3JZO (ORCPT ); Thu, 30 Apr 2015 05:25:14 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YnkiW-0005PR-ER; Thu, 30 Apr 2015 11:25:12 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Christoffer Dall , Shannon Zhao , Jiri Slaby Subject: [patch added to the 3.12 stable tree] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Thu, 30 Apr 2015 11:25:03 +0200 Message-Id: <1430385911-20480-55-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1430385911-20480-1-git-send-email-jslaby@suse.cz> References: <1430385911-20480-1-git-send-email-jslaby@suse.cz> 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: patch@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.179 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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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 Signed-off-by: Jiri Slaby --- 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 858aecf21db2..0d578c0f5749 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 7dc8e010c200..137cee9f3fd2 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; }