[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



Hi Julien,

If I need to use 1 to 1 IRQ mapping in domU, I got an error in the
following code:

> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index e19e2f4..b0491c3 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -23,6 +23,25 @@
>  #define DT_IRQ_TYPE_LEVEL_HIGH     0x00000004
>  #define DT_IRQ_TYPE_LEVEL_LOW      0x00000008
>
> +int libxl__arch_domain_create_pre(libxl__gc *gc, libxl_domain_config 
> *d_config,
> +                                  libxl__domain_build_state *state,
> +                                  uint32_t domid)
> +{
> +    uint32_t nr_spis = 0;
> +
> +    nr_spis += d_config->b_info.num_irqs;

I have 4 IRQS for domU, they numbers are 53, 173, 174. With this
change there will be 3 SPIs for domU, and below code will configure
vgic for 32 lines.

> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 17cde7a..a037ecc 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -60,16 +60,16 @@ static void vgic_init_pending_irq(struct pending_irq *p, 
> unsigned virq)
>      p->irq = virq;
>  }
>
> -int domain_vgic_init(struct domain *d)
> +int domain_vgic_init(struct domain *d, unsigned int nr_spis)
>  {
>      int i;
>
>      d->arch.vgic.ctlr = 0;
>
> -    if ( is_hardware_domain(d) )
> -        d->arch.vgic.nr_spis = gic_number_lines() - 32;
> -    else
> -        d->arch.vgic.nr_spis = 0; /* We don't need SPIs for the guest */
> +    /* The number of SPIs as to be aligned to 32 see
> +     * GICD_TYPER.ITLinesNumber definition
> +     */
> +    d->arch.vgic.nr_spis = ROUNDUP(nr_spis, 32);

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 ?

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®.