[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 08/21] xen/arm: Initialize the virtual GIC later



On Fri, Aug 29, 2014 at 9:57 PM, Julien Grall <julien.grall@xxxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.