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

Re: [Xen-devel] [PATCH v1] xen/arm: Fix deadlock in gic_set_guest_irq()



On Mon, 2014-02-03 at 19:33 +0200, Oleksandr Tyshchenko wrote:
> The possible deadlock scenario is explained below:
> 
> non interrupt context:    interrupt contex        interrupt context
>                           (CPU0):                 (CPU1):
> vgic_distr_mmio_write()   do_trap_irq()           do_softirq()
>   |                         |                       |
>   vgic_disable_irqs()       ...                     ...
>     |                         |                       |
>     gic_remove_from_queues()  vgic_vcpu_inject_irq()  vgic_vcpu_inject_irq()
>     |  ...                      |                       |
>     |  spin_lock(...)           gic_set_guest_irq()     gic_set_guest_irq()
>     |  ...                        ...                     ...
>     |  ... <----------------.---- spin_lock_irqsave(...)  ...
>     |  ... 
> <----------------.-.---------------------------spin_lock_irqsave(...)
>     |  ...                  . .       Oops! The lock has already taken.
>     |  spin_unlock(...)     . .
>     |  ...                  . .
>     gic_irq_disable()       . .
>        ...                  . .
>        spin_lock(...)       . .
>        ...                  . .
>        ... <----------------. .
>        ... <------------------.
>        ...
>        spin_unlock(...)
> 
> Since the gic_remove_from_queues() and gic_irq_disable() called from
> non interrupt context and they acquire the same lock as gic_set_guest_irq()
> which called from interrupt context we must disable interrupts in these
> functions to avoid possible deadlocks.
> 
> Change-Id: Ia354d87bb44418956e30cd7e49cc76616c359cc9

What is this?

> Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@xxxxxxxxxxxxxxx>

Applied with acks from Stefano, Julien and myself.

Was there anything else arising from "xen/arm: maintenance_interrupt SMP
fix" which is a target for 4.4? I don't think so, the IPI priority
raising is targeted at 4.5.




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