From patchwork Sun May 17 01:02:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 48615 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 96C6221411 for ; Sun, 17 May 2015 01:06:33 +0000 (UTC) Received: by wizk4 with SMTP id k4sf9932449wiz.2 for ; Sat, 16 May 2015 18:06:32 -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=flfqId2LfLj60ZO9JmB0WTa5tXF+wnB8limzcRlHig8=; b=RXS/XO1mlktdyYXg4WJa5DUHH6dPvmkgmKEfW8O0IfxyKhMjIWVOrxc5eBNtMHFLE8 yXlSfSrvMG9JlUO6LP5q2jreaPi5UEic/krV+xRTcayCVAJvncxYhaNSKRc6p4CAKPA0 InfZQL/p9X17pn1sR2XjQ59mupZ8rOHYipwqJuAZgRtKNFJ6doNVHEmQOJ/vyHDMFRUF 2NMV2rnU0CsmGPMsMRqlvP6ENmcfmlN1cSpsnmZAhrWKvDgLkGY1Hm3OoVY1r9ktuBr9 9Y/ewlN3ZAhDKVHfWGZtWIK9UF6RiC7cbmRtjr4kM1/6bJLSFr/TTQAkclkMDqC98sps ucVg== X-Gm-Message-State: ALoCoQmwYwsJIxNV14FyDTmWWdYOgM18lhgHbJHUlPe65YEnmQSsE3Ir3dE6+k/1ibw/adZNkjLw X-Received: by 10.112.189.131 with SMTP id gi3mr12522480lbc.6.1431824792774; Sat, 16 May 2015 18:06:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.40 with SMTP id q8ls31696lag.67.gmail; Sat, 16 May 2015 18:06:32 -0700 (PDT) X-Received: by 10.112.72.104 with SMTP id c8mr12617961lbv.77.1431824792445; Sat, 16 May 2015 18:06:32 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id x9si3915285lal.18.2015.05.16.18.06.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 May 2015 18:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lagr1 with SMTP id r1so91098026lag.0 for ; Sat, 16 May 2015 18:06:32 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr12204570lbb.76.1431824792299; Sat, 16 May 2015 18:06:32 -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 hn6csp3022127lbb; Sat, 16 May 2015 18:06:31 -0700 (PDT) X-Received: by 10.66.141.231 with SMTP id rr7mr31864017pab.86.1431824782078; Sat, 16 May 2015 18:06:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si9275368pdm.194.2015.05.16.18.06.21; Sat, 16 May 2015 18:06:22 -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 S1750711AbbEQBGR (ORCPT + 2 others); Sat, 16 May 2015 21:06:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22599 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbbEQBGQ (ORCPT ); Sat, 16 May 2015 21:06:16 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t4H16FFN017151 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 May 2015 01:06:16 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t4H16FTg012382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 17 May 2015 01:06:15 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t4H16FGF027760; Sun, 17 May 2015 01:06:15 GMT Received: from lappy.hsd1.nh.comcast.net (/10.159.157.103) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 16 May 2015 18:06:14 -0700 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: sasha.levin@oracle.com Subject: [PATCH 3.18 005/222] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Sat, 16 May 2015 21:02:26 -0400 Message-Id: <1431824764-20044-6-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1431824764-20044-1-git-send-email-sasha.levin@oracle.com> References: <1431824764-20044-1-git-send-email-sasha.levin@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] 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.215.47 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 Signed-off-by: Sasha Levin --- 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; }