From patchwork Thu Jun 19 17:36:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 32239 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06CFC206A0 for ; Thu, 19 Jun 2014 17:42:38 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id j107sf5553368qga.0 for ; Thu, 19 Jun 2014 10:42:38 -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:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=emVPXR9xGnhBQibxJHuYi/vuM0y0rb8B/LQXZSV8dO0=; b=eBW3IPoepKFangq1hnPjlef3DIhwi622NsEVKR2drcm6xeqx5OVCd/RcUqj3vGFQJY 0ssV5y61JhqMjJkh3peFo/6zPpT/oa1Gozabrwybhz+bjOtFMZRxdd19EbW3kYvNfCYZ xM1bKFDHXQ6wQ8tbEFHLoeMafowamIDSuyxiTHY/PstwUdoJw8Z8YnE/J99SaxsA9ECW nZgfObneMMucs2/1osLVHaztHxiVets8zBpH4UwhLbeXadj7rCFjpjRSu4F5+4+hSNtY rLJpCJNyUFvE8JDWl0DhKN627fQ/+2bf65ysIxDOW7gfdrqSRZbUKxKfx+APJ1x2TlRo +TZw== X-Gm-Message-State: ALoCoQmMTEH6+ZPYH7QJ3DgcCv/I7L/7uJz2EGUjT8gdBnOB4jQZ/27+T99JjgX602/5T0TM1hD0 X-Received: by 10.236.101.148 with SMTP id b20mr2642775yhg.46.1403199758810; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.181 with SMTP id 50ls656458qgr.92.gmail; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr5208913vch.22.1403199758714; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id f5si2732567vee.90.2014.06.19.10.42.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id i13so2649658veh.29 for ; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr1577033vca.45.1403199758608; Thu, 19 Jun 2014 10:42:38 -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.221.54.6 with SMTP id vs6csp379300vcb; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) X-Received: by 10.229.70.196 with SMTP id e4mr9552917qcj.16.1403199758082; Thu, 19 Jun 2014 10:42:38 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 9si7495816qan.42.2014.06.19.10.42.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:37005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgM9-0008FF-Nu for patch@linaro.org; Thu, 19 Jun 2014 13:42:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGs-0000tl-U1 for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxgGo-0004tI-Px for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:10 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGo-0004k9-JV for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:06 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WxgGg-0002Jj-3C for qemu-devel@nongnu.org; Thu, 19 Jun 2014 18:36:58 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 19 Jun 2014 18:36:53 +0100 Message-Id: <1403199417-8833-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> References: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 10/14] target-arm: Enable KVM_ARM_VCPU_PSCI_0_2 feature when possible X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@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.128.170 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 From: Pranavkumar Sawargaonkar Latest linux kernel supports in-kernel emulation of PSCI v0.2 but to enable it we need to select KVM_ARM_VCPU_PSCI_0_2 feature using KVM_ARM_VCPU_INIT ioctl. Also, we can use KVM_ARM_VCPU_PSCI_0_2 feature for VCPU only when linux kernel has KVM_CAP_ARM_PSCI_0_2 capability. This patch updates kvm_arch_init_vcpu() to enable KVM_ARM_VCPU_PSCI_0_2 feature for VCPU when KVM ARM/ARM64 has KVM_CAP_ARM_PSCI_0_2 capability. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel Reviewed-by: Peter Maydell Message-id: 1402901605-24551-6-git-send-email-pranavkumar@linaro.org Signed-off-by: Peter Maydell --- target-arm/kvm32.c | 3 +++ target-arm/kvm64.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/target-arm/kvm32.c b/target-arm/kvm32.c index b142e90..52d626c 100644 --- a/target-arm/kvm32.c +++ b/target-arm/kvm32.c @@ -183,6 +183,9 @@ int kvm_arch_init_vcpu(CPUState *cs) if (cpu->start_powered_off) { cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF; } + if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) { + cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2; + } /* Do KVM_ARM_VCPU_INIT ioctl */ ret = kvm_arm_vcpu_init(cs); diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index 9936aa8..828ffb6 100644 --- a/target-arm/kvm64.c +++ b/target-arm/kvm64.c @@ -91,6 +91,9 @@ int kvm_arch_init_vcpu(CPUState *cs) if (cpu->start_powered_off) { cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF; } + if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) { + cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PSCI_0_2; + } /* Do KVM_ARM_VCPU_INIT ioctl */ ret = kvm_arm_vcpu_init(cs);