|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 6/6] xen/arm: disable a physical IRQ when the guest disables the corresponding IRQ
On Fri, 2013-12-06 at 17:26 +0000, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> ---
> xen/arch/arm/vgic.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 5b533ea..9ac24b0 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -360,6 +360,21 @@ read_as_zero:
> return 1;
> }
>
> +static void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
Does this function need a permission check to make sure it owns the
interrupt which it is disabling?
Perhaps p->desc != NULL indicates that? If so then a comment would be
nice.
> +{
> + struct pending_irq *p;
> + unsigned int irq;
> + int i = 0;
> +
> + while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32
> ) {
> + irq = i + (32 * n);
> + p = irq_to_pending(v, irq);
> + if ( p->desc != NULL )
> + p->desc->handler->disable(p->desc);
> + i++;
> + }
> +}
> +
> static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
> {
> struct pending_irq *p;
> @@ -494,8 +509,10 @@ static int vgic_distr_mmio_write(struct vcpu *v,
> mmio_info_t *info)
> rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
> if ( rank == NULL) goto write_ignore;
> vgic_lock_rank(v, rank);
> + tr = rank->ienable;
> rank->ienable &= ~*r;
> vgic_unlock_rank(v, rank);
> + vgic_disable_irqs(v, (*r) & (~tr), gicd_reg - GICD_ICENABLER);
> return 1;
>
> case GICD_ISPENDR ... GICD_ISPENDRN:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |