From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 08/21] xen/arm: Initialize the virtual GIC later Date: Fri, 29 Aug 2014 16:04:28 -0400 Message-ID: <5400DCCC.9080303@linaro.org> 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"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XNSPT-0000mG-ML for xen-devel@lists.xenproject.org; Fri, 29 Aug 2014 20:04:35 +0000 Received: by mail-qg0-f53.google.com with SMTP id z107so2745111qgd.40 for ; Fri, 29 Aug 2014 13:04:33 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrii Tseglytskyi Cc: Ian Campbell , Tim Deegan , Ian Jackson , Stefano Stabellini , Jan Beulich , xen-devel , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On 29/08/14 15:49, Andrii Tseglytskyi wrote: > On Fri, Aug 29, 2014 at 9:57 PM, Julien Grall wrote: >> 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. IHMO, the best solution would adding a boolean in the new DOMCTL to specify if we want to use PIRQ == VIRQ or not. Then you will have to modify vgic_allocate_irq to return the physical IRQ if the domain as this new option enabled. > 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"); With this change you may have some issue when unmap_pirq is used. I would modify vgic_allocate_irq to always return the physical IRQ number. The code will be also more clean. -- Julien Grall