From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Subject: Re: [PATCH 5/5] kvmtool: ARM/ARM64: Provide PSCI-0.2 guest when in-kernel KVM supports it Date: Thu, 7 Aug 2014 14:30:13 +0530 Message-ID: References: <1407228599-25065-1-git-send-email-anup.patel@linaro.org> <1407228599-25065-6-git-send-email-anup.patel@linaro.org> <20140806125633.GQ25953@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , "patches@apm.com" , Marc Zyngier , "penberg@kernel.org" , "christoffer.dall@linaro.org" , "pranavkumar@linaro.org" To: Will Deacon Return-path: Received: from mail-wg0-f44.google.com ([74.125.82.44]:43660 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754650AbaHGJAP (ORCPT ); Thu, 7 Aug 2014 05:00:15 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so3766716wgh.27 for ; Thu, 07 Aug 2014 02:00:13 -0700 (PDT) In-Reply-To: <20140806125633.GQ25953@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 6 August 2014 18:26, Will Deacon wrote: > On Tue, Aug 05, 2014 at 09:49:59AM +0100, Anup Patel wrote: >> If in-kernel KVM support PSCI-0.2 emulation then we should set >> KVM_ARM_VCPU_PSCI_0_2 feature for each guest VCPU and also >> provide "arm,psci-0.2","arm,psci" as PSCI compatible string. >> >> This patch updates kvm_cpu__arch_init() and setup_fdt() as >> per above. >> >> Signed-off-by: Pranavkumar Sawargaonkar >> Signed-off-by: Anup Patel >> --- >> tools/kvm/arm/fdt.c | 39 +++++++++++++++++++++++++++++++++------ >> tools/kvm/arm/kvm-cpu.c | 5 +++++ >> 2 files changed, 38 insertions(+), 6 deletions(-) > > [...] > >> diff --git a/tools/kvm/arm/kvm-cpu.c b/tools/kvm/arm/kvm-cpu.c >> index 7478f8f..76c28a0 100644 >> --- a/tools/kvm/arm/kvm-cpu.c >> +++ b/tools/kvm/arm/kvm-cpu.c >> @@ -74,6 +74,11 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id) >> die("preferred target not available\n"); >> } >> >> + /* Set KVM_ARM_VCPU_PSCI_0_2 if available */ >> + if (kvm__supports_extension(kvm, KVM_CAP_ARM_PSCI_0_2)) { >> + vcpu_init.features[0] |= (1UL << KVM_ARM_VCPU_PSCI_0_2); >> + } > > Where is this used? If we want to provide PSCI-0.2 to Guest then we should inform in-kernel KVM ARM/ARM64 using init features. By default KVM ARM/ARM64 provides PSCI-0.1 to Guest. If we don't set this feature then Guest will get undefined exception for PSCI-0.2 calls. -- Anup > > Will