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

Re: [Xen-devel] [PATCH v4 17/33] xen/arm: vgic: Add spi_to_pending



On Thu, 2015-03-19 at 19:29 +0000, Julien Grall wrote:
> Introduce spi_to_pending in order retrieve the irq_pending structure for
> a specific SPI.
> 
> It's not possible to re-use irq_to_pending because it's required a VCPU

"it requires"

> and some call of the new function may during domain destruction after
> the VCPUs are freed.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Although given the name I would expect it to take an spi (i.e. -32) not
an irq. I can't think of a better name though and perhaps that just
makes things harder for the caller.

Ian.

> 
> ---
>     Changes in v4:
>         - Patch added
> ---
>  xen/arch/arm/vgic.c        | 7 +++++++
>  xen/include/asm-arm/vgic.h | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 74751e0..fc283ec 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -371,6 +371,13 @@ struct pending_irq *irq_to_pending(struct vcpu *v, 
> unsigned int irq)
>      return n;
>  }
>  
> +struct pending_irq *spi_to_pending(struct domain *d, unsigned int irq)
> +{
> +    ASSERT(irq >= NR_LOCAL_IRQS);
> +
> +    return &d->arch.vgic.pending_irqs[irq - 32];
> +}
> +
>  void vgic_clear_pending_irqs(struct vcpu *v)
>  {
>      struct pending_irq *p, *t;
> diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
> index 647f2fe..8d22532 100644
> --- a/xen/include/asm-arm/vgic.h
> +++ b/xen/include/asm-arm/vgic.h
> @@ -185,6 +185,7 @@ extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned 
> int virq);
>  extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq);
>  extern void vgic_clear_pending_irqs(struct vcpu *v);
>  extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
> +extern struct pending_irq *spi_to_pending(struct domain *d, unsigned int 
> irq);
>  extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, 
> int s);
>  extern struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq);
>  extern int vgic_emulate(struct cpu_user_regs *regs, union hsr hsr);



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