From patchwork Mon Jun 16 06:53:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 31916 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85C98206A0 for ; Mon, 16 Jun 2014 06:58:03 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id tr6sf30814174ieb.11 for ; Sun, 15 Jun 2014 23:58:02 -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:cc: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=BRXf/PuqFDWAkwAMTIuY8eb+mX5SdwlgPYaKjG/GZas=; b=JmyZ3u0gWAw3/DOJTX6TXH5sk87CzFziv0/e+OEJZE+NIivSeiztPgitWhxbfvB0k5 OH37RAEQTCeDl6CqNC21Ta88x2dq9s41L935sRW7gGNOt1Agb9eYxw/iP+UKLQ7cDDGT 1MjWAaC2DQXkwZsdgIjSntBTe3o88csutAnWareOIK0ciMI7lcvPtoofY+kIW992guln P8OaA077Cy54/rY8Al2zMrepuyxTHrpN82cMb1QT5wXCVK4pIBRDrDV5ec2aDr8kYihL eA+4YvyKPLXmf64cKLbkd93flRUBILj3nuYfhes+1O5yClfZgR8YStCzfBCFTuVzLjHt 7QMw== X-Gm-Message-State: ALoCoQlaSZ2liA3DspGyO8NhlqHjW586wMYF8Za1DXg/aaP5T7C0BHNV2KADb6Ym+8p4xqefEq2U X-Received: by 10.182.135.167 with SMTP id pt7mr4433269obb.14.1402901882947; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.247 with SMTP id l110ls4098519qgf.90.gmail; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr12250774vdc.1.1402901882856; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id ij19si3755587vec.99.2014.06.15.23.58.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so5665837veb.31 for ; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) X-Received: by 10.58.195.172 with SMTP id if12mr14746714vec.12.1402901882767; Sun, 15 Jun 2014 23:58:02 -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 vs6csp114161vcb; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) X-Received: by 10.140.87.5 with SMTP id q5mr22659269qgd.43.1402901882151; Sun, 15 Jun 2014 23:58:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 6si8098721qch.20.2014.06.15.23.58.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:58:02 -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]:41863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQrh-0004rB-Rb for patch@linaro.org; Mon, 16 Jun 2014 02:58:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQo5-00072y-Fe for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwQnz-0003cw-12 for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:17 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:49863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwQny-0003cs-SP for qemu-devel@nongnu.org; Mon, 16 Jun 2014 02:54:10 -0400 Received: by mail-pd0-f177.google.com with SMTP id y10so2638853pdj.36 for ; Sun, 15 Jun 2014 23:54:10 -0700 (PDT) X-Received: by 10.66.147.99 with SMTP id tj3mr17114510pab.47.1402901649928; Sun, 15 Jun 2014 23:54:09 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id op3sm16777787pbc.40.2014.06.15.23.54.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Jun 2014 23:54:09 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 16 Jun 2014 12:23:22 +0530 Message-Id: <1402901605-24551-6-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402901605-24551-1-git-send-email-pranavkumar@linaro.org> References: <1402901605-24551-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.177 Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, robherring2@gmail.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [PATCH V7 5/8] 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: pranavkumar@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.172 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 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 --- 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);