From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrii Tseglytskyi Subject: Re: [PATCH v2 08/21] xen/arm: Initialize the virtual GIC later Date: Fri, 29 Aug 2014 22:49:48 +0300 Message-ID: References: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> <1406818852-31856-9-git-send-email-julien.grall@linaro.org> <5400CD17.5060909@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XNSBE-0000N5-G7 for xen-devel@lists.xenproject.org; Fri, 29 Aug 2014 19:49:52 +0000 Received: by mail-qc0-f180.google.com with SMTP id c9so2845632qcz.25 for ; Fri, 29 Aug 2014 12:49:48 -0700 (PDT) In-Reply-To: <5400CD17.5060909@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Ian Campbell , Tim Deegan , Ian Jackson , Stefano Stabellini , Jan Beulich , xen-devel , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Fri, Aug 29, 2014 at 9:57 PM, Julien Grall wrote: > On 29/08/14 09:09, Andrii Tseglytskyi wrote: >> >> Hi Julien, > > > Hi Andrii, > > >> Here I got 32 lines for 3 SPIs >> >> And this will break checking for IRQ validity in >> xen/arch/arm/irq.c:route_irq_to_guest() call. I will not be able to >> use IRQ with number greater than 63. >> >> Can this be handled somehow? Or maybe it is already handled and I >> missed something ? > > > You will have to modify the function for your purpose. If you plan to PIRQ > == VIRQ every time, you could do smth like: > > > d->arch.vgic.nr_spis = gic_number_lines() - 32; > > I assume, you already modified vgic_allocate_irq to return directly the > pirq, and do nothing in vgic_free_irq. Yes, locally I did the same as you mentioned, but I'm thinking about solution which will allow me to have 1 to 1 irq mapping and which will be acceptable for Xen mainline. My local diff is: diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c index 9333aa0..50ff100 100644 --- a/xen/arch/arm/physdev.c +++ b/xen/arch/arm/physdev.c @@ -46,16 +46,13 @@ static int physdev_map_pirq(domid_t domid, int type, int index, int *pirq_p) virq = vgic_allocate_virq(d, irq); ret = -EMFILE; if ( virq == -1 ) goto free_domain; - ret = route_irq_to_guest(d, virq, irq, "routed IRQ"); + ret = route_irq_to_guest(d, irq, irq, "routed IRQ"); if ( !ret ) *pirq_p = virq; diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 644742e..33f190b 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -69,7 +69,7 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis) /* The number of SPIs as to be aligned to 32 see * GICD_TYPER.ITLinesNumber definition */ - d->arch.vgic.nr_spis = ROUNDUP(nr_spis, 32); + d->arch.vgic.nr_spis = gic_number_lines() - 32; switch ( gic_hw_version() ) Regards, Andrii -- Andrii Tseglytskyi | Embedded Dev GlobalLogic www.globallogic.com