From patchwork Mon May 12 12:37:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 29977 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D2AC2238EB for ; Mon, 12 May 2014 12:42:16 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf41200313pab.7 for ; Mon, 12 May 2014 05:42:16 -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=grlYDF/ZbQJYduLGLRsspFuxU1sMqKmaCtaM31cku6s=; b=IT6KDn5a4TrX17CxhhcVXPqbeyufVJZV8C4jb4lbVCIK+ZM55DOjH8CMcQi0DTcpY3 ZYwzzV9DiSIxBoWKlI/wfhk829JUT5xcumBkgUNu4uI0RlcEW9qNnb6RkGqSM2vsCw1A JWssmSdqNBv7rsIeQsmBaIz9Uaset5wJ5jU1u+By8Nn6h3JvAzPkbVKenuMHsuEng7TH hArGcYX6KKfVgu9VTAJd5s9LuDY/acqV3+gLU++OAJ7rC+aCj0xdLsAZsDdAS/oX7Bnu MKYV1oMrq8Q5aRAEsaD2vC4rj80P6do/ntihAwKd7amS2ewNvpEt+nhxv4iNv3saIJoT Xwzg== X-Gm-Message-State: ALoCoQklv5HlnHopBTiv+q4FYrxPbH7/7H+oqmHOMojhLCSyzsg6WNH/Lh8arwCmqYWpQOROA9xV X-Received: by 10.66.189.163 with SMTP id gj3mr11014425pac.32.1399898536147; Mon, 12 May 2014 05:42:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.67 with SMTP id g61ls1429114qgg.12.gmail; Mon, 12 May 2014 05:42:16 -0700 (PDT) X-Received: by 10.52.249.76 with SMTP id ys12mr311992vdc.63.1399898536012; Mon, 12 May 2014 05:42:16 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id uc9si1407270vdc.120.2014.05.12.05.42.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 05:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db11so8534643veb.8 for ; Mon, 12 May 2014 05:42:15 -0700 (PDT) X-Received: by 10.52.3.42 with SMTP id 10mr310167vdz.78.1399898535917; Mon, 12 May 2014 05:42:15 -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.220.221.72 with SMTP id ib8csp65865vcb; Mon, 12 May 2014 05:42:15 -0700 (PDT) X-Received: by 10.140.96.51 with SMTP id j48mr35509360qge.24.1399898535345; Mon, 12 May 2014 05:42:15 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s10si5904016qak.175.2014.05.12.05.42.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 12 May 2014 05:42:15 -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]:37477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpYd-0006SU-0p for patch@linaro.org; Mon, 12 May 2014 08:42:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpV1-0001ID-QT for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjpUv-0002Sf-T9 for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:31 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:64819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjpUv-0002Sb-O7 for qemu-devel@nongnu.org; Mon, 12 May 2014 08:38:25 -0400 Received: by mail-pa0-f48.google.com with SMTP id rd3so8472623pab.7 for ; Mon, 12 May 2014 05:38:25 -0700 (PDT) X-Received: by 10.66.137.109 with SMTP id qh13mr54809028pab.39.1399898305111; Mon, 12 May 2014 05:38:25 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ek2sm22718531pbd.30.2014.05.12.05.38.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 05:38:24 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Mon, 12 May 2014 18:07:24 +0530 Message-Id: <1399898246-4831-7-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1399898246-4831-1-git-send-email-pranavkumar@linaro.org> References: <1399898246-4831-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.220.48 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] [RFC PATCH V5 6/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.177 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 --- 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 cc9cdfa..afc248b 100644 --- a/target-arm/kvm32.c +++ b/target-arm/kvm32.c @@ -179,6 +179,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 528536f..917d256 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);