From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH 5/5] kvmtool: ARM/ARM64: Provide PSCI-0.2 guest when in-kernel KVM supports it Date: Thu, 7 Aug 2014 10:09:46 +0100 Message-ID: <20140807090946.GE13703@arm.com> 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=us-ascii 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: Anup Patel Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:41315 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754303AbaHGJJp (ORCPT ); Thu, 7 Aug 2014 05:09:45 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Aug 07, 2014 at 10:00:13AM +0100, Anup Patel wrote: > 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. Gotcha, thanks for the explanation. Will