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

Re: [Xen-devel] [PATCH 05/12] ARM: VGIC: move gic_remove_from_lr_pending()



On Thu, 19 Oct 2017, Andre Przywara wrote:
> gic_remove_from_lr_pending() was not only misnamed, it also had the wrong
> abstraction, as it should not live in gic.c.
> Move it into vgic.c and vgic.h, where it belongs, and rename it on the
> way.
> 
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

Like gic_clear_pending_irqs, gic_remove_from_lr_pending belongs to
gic.c. However, I agree with you that it is misnamed. I would rename it
to something like gic_clear_one_pending.


> ---
>  xen/arch/arm/gic.c         |  7 -------
>  xen/arch/arm/vgic-v3-its.c |  2 +-
>  xen/arch/arm/vgic.c        | 13 ++++++++++---
>  xen/include/asm-arm/gic.h  |  1 -
>  xen/include/asm-arm/vgic.h |  1 +
>  5 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index ef041354ea..59dd255c2c 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -404,13 +404,6 @@ static inline void gic_add_to_lr_pending(struct vcpu *v, 
> struct pending_irq *n)
>      list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
>  }
>  
> -void gic_remove_from_lr_pending(struct vcpu *v, struct pending_irq *p)
> -{
> -    ASSERT(spin_is_locked(&v->arch.vgic.lock));
> -
> -    list_del_init(&p->lr_queue);
> -}
> -
>  void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq)
>  {
>      struct pending_irq *n = irq_to_pending(v, virtual_irq);
> diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
> index d8fa44258d..5b77594723 100644
> --- a/xen/arch/arm/vgic-v3-its.c
> +++ b/xen/arch/arm/vgic-v3-its.c
> @@ -449,7 +449,7 @@ static void update_lpi_vgic_status(struct vcpu *v, struct 
> pending_irq *p)
>              gic_raise_guest_irq(v, p->irq, p->lpi_priority);
>      }
>      else
> -        gic_remove_from_lr_pending(v, p);
> +        vgic_remove_from_lr_pending(v, p);
>  }
>  
>  static int its_handle_inv(struct virt_its *its, uint64_t *cmdptr)
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index cd50b90d67..2cdaca7480 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -345,7 +345,7 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
>          spin_lock_irqsave(&v_target->arch.vgic.lock, flags);
>          p = irq_to_pending(v_target, irq);
>          clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
> -        gic_remove_from_lr_pending(v_target, p);
> +        vgic_remove_from_lr_pending(v_target, p);
>          desc = p->desc;
>          spin_unlock_irqrestore(&v_target->arch.vgic.lock, flags);
>  
> @@ -505,18 +505,25 @@ void vgic_clear_pending_irqs(struct vcpu *v)
>      list_for_each_entry_safe ( p, t, &v->arch.vgic.inflight_irqs, inflight )
>          list_del_init(&p->inflight);
>      list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
> -        gic_remove_from_lr_pending(v, p);
> +        vgic_remove_from_lr_pending(v, p);
>      v->arch.lr_mask = 0;
>      spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
>  }
>  
> +void vgic_remove_from_lr_pending(struct vcpu *v, struct pending_irq *p)
> +{
> +    ASSERT(spin_is_locked(&v->arch.vgic.lock));
> +
> +    list_del_init(&p->lr_queue);
> +}
> +
>  void vgic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p)
>  {
>      ASSERT(spin_is_locked(&v->arch.vgic.lock));
>  
>      clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
>      list_del_init(&p->inflight);
> -    gic_remove_from_lr_pending(v, p);
> +    vgic_remove_from_lr_pending(v, p);
>  }
>  
>  void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq)
> diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
> index 030c1d86a7..4b2a60ee64 100644
> --- a/xen/include/asm-arm/gic.h
> +++ b/xen/include/asm-arm/gic.h
> @@ -242,7 +242,6 @@ extern void init_maintenance_interrupt(void);
>  extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq,
>          unsigned int priority);
>  extern void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq);
> -extern void gic_remove_from_lr_pending(struct vcpu *v, struct pending_irq 
> *p);
>  
>  /* Accept an interrupt from the GIC and dispatch its handler */
>  extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
> diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
> index 8d0ff65708..0d3810e6af 100644
> --- a/xen/include/asm-arm/vgic.h
> +++ b/xen/include/asm-arm/vgic.h
> @@ -205,6 +205,7 @@ extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, 
> unsigned int virq);
>  extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq);
>  extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq);
>  void vgic_remove_irq_from_queues(struct vcpu *v, struct pending_irq *p);
> +void vgic_remove_from_lr_pending(struct vcpu *v, struct pending_irq *p);
>  extern void vgic_clear_pending_irqs(struct vcpu *v);
>  extern void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq);
>  extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
> -- 
> 2.14.1
> 

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

 


Rackspace

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