From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Pranavkumar Sawargaonkar Date: Mon, 16 Jun 2014 12:23:22 +0530 Message-Id: <1402901605-24551-6-git-send-email-pranavkumar@linaro.org> In-Reply-To: <1402901605-24551-1-git-send-email-pranavkumar@linaro.org> References: <1402901605-24551-1-git-send-email-pranavkumar@linaro.org> Subject: [Qemu-devel] [PATCH V7 5/8] target-arm: Enable KVM_ARM_VCPU_PSCI_0_2 feature when possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, robherring2@gmail.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, 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 --- 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); -- 1.9.1