From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl Date: Thu, 18 Oct 2012 14:20:53 +0200 Message-ID: <507FF425.1090603@redhat.com> References: <1350173065-35350-1-git-send-email-c.dall@virtualopensystems.com> <1350173065-35350-2-git-send-email-c.dall@virtualopensystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, peter.maydell@linaro.org, marc.zyngier@arm.com To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754508Ab2JRMVM (ORCPT ); Thu, 18 Oct 2012 08:21:12 -0400 In-Reply-To: <1350173065-35350-2-git-send-email-c.dall@virtualopensystems.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/14/2012 02:04 AM, Christoffer Dall wrote: > Used to initialize the in-kernel interrupt controller. On ARM we need to > map the virtual generic interrupt controller (vGIC) into Hyp the guest's > physicall address space so the guest can access the virtual cpu > interface. This must be done after the IRQ chips is create and after a > base address has been provided for the emulated platform (patch is > following), but before the CPU is initally run. > > > +4.79 KVM_INIT_IRQCHIP > + > +Capability: KVM_CAP_INIT_IRQCHIP > +Architectures: arm > +Type: vm ioctl > +Parameters: none > +Returns: 0 on success, -1 on error > + > +Initialize the in-kernel interrupt controller. On ARM we need to map the > +virtual generic interrupt controller (vGIC) into Hyp the guest's physicall > +address space so the guest can access the virtual cpu interface. This must be > +done after the IRQ chips is create and after a base address has been provided > +for the emulated platofrm (see KVM_SET_DEVICE_ADDRESS), but before the CPU is > +initally run. > + What enforces this? Can it be done automatically? issue a kvm_make_request(KVM_REQ_INIT_IRQCHIP) on vcpu creation, and you'll automatically be notified before the first guest entry. Having an ioctl that must be called after point A but before point B seems pointless, when A and B are both known. > + > 5. The kvm_run structure > ------------------------ > > diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c > index f8c377b..85c76e4 100644 > --- a/arch/arm/kvm/arm.c > +++ b/arch/arm/kvm/arm.c > @@ -195,6 +195,7 @@ int kvm_dev_ioctl_check_extension(long ext) > switch (ext) { > #ifdef CONFIG_KVM_ARM_VGIC > case KVM_CAP_IRQCHIP: > + case KVM_CAP_INIT_IRQCHIP: This could be part of a baseline, if you don't envision ever taking it out. -- error compiling committee.c: too many arguments to function