From patchwork Thu May 22 11:18:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 30596 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C486220369 for ; Thu, 22 May 2014 11:23:03 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kq14sf10363903pab.2 for ; Thu, 22 May 2014 04:23:03 -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=uLi/3rvmoz/hGWXBR/0EBgOgNj9o1UWG06zgw5QuGQU=; b=b+zu2MheHdQn9beFoCpvig6FPMEACul2J4EtWCYLhiaIlWklHUTEvv1iPcpvWd95v7 lFF/z4CoSi74H85HQH9Kz7EyBhabGszqbOkNcU8tBsAFqmiEXhGfBYmRIacN1ESFe8pb Jak3I9oY9LmPGNiZdGRNAC9tF1SjZZBhamiwADoCqpejHAu94rF0ZKw2goOcKgI7D2rv Tn3sTDtI3pS3PAvuzBcyJsyjACFGdPODLcBKsEJNBWXgWriXHU1kJe1bGWYEALFw1hN1 tv4OrnfTfxRIXCmLbZrStUyJbtRVAy6MC5VIFB0VPgl2wZHQKh8aK9l3kontxR41zwMl HVSA== X-Gm-Message-State: ALoCoQkt3JmV4R35y6P5recXo7foweNhAKy5g5L3SdFDxgpvivPUqapBH+50prHNSvVp+BTaeOVO X-Received: by 10.66.138.17 with SMTP id qm17mr24553944pab.34.1400757783054; Thu, 22 May 2014 04:23:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.225 with SMTP id b88ls1133495qgb.32.gmail; Thu, 22 May 2014 04:23:02 -0700 (PDT) X-Received: by 10.58.112.8 with SMTP id im8mr1354904veb.35.1400757782940; Thu, 22 May 2014 04:23:02 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id q13si3244436vci.29.2014.05.22.04.23.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:23:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id la4so4224261vcb.13 for ; Thu, 22 May 2014 04:23:02 -0700 (PDT) X-Received: by 10.58.100.244 with SMTP id fb20mr592913veb.39.1400757782871; Thu, 22 May 2014 04:23: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.220.221.72 with SMTP id ib8csp189865vcb; Thu, 22 May 2014 04:23:02 -0700 (PDT) X-Received: by 10.224.166.9 with SMTP id k9mr77929922qay.25.1400757782096; Thu, 22 May 2014 04:23:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n6si8987142qct.3.2014.05.22.04.23.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 04:23: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]:36752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR5R-00083I-KH for patch@linaro.org; Thu, 22 May 2014 07:23:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR1z-0002dm-51 for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnR1s-0005GX-L7 for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:27 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:48805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnR1s-0005GM-GQ for qemu-devel@nongnu.org; Thu, 22 May 2014 07:19:20 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so2414094pab.38 for ; Thu, 22 May 2014 04:19:19 -0700 (PDT) X-Received: by 10.68.130.6 with SMTP id oa6mr65775076pbb.102.1400757559927; Thu, 22 May 2014 04:19:19 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id xr9sm118782087pab.5.2014.05.22.04.19.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:19:19 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Thu, 22 May 2014 16:48:03 +0530 Message-Id: <1400757486-2860-6-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400757486-2860-1-git-send-email-pranavkumar@linaro.org> References: <1400757486-2860-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.51 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 V6 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.220.182 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 1980ddc..dcf621f 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);