linux/arch
Juergen Gross a856531951 xen: make xen_qlock_wait() nestable
xen_qlock_wait() isn't safe for nested calls due to interrupts. A call
of xen_qlock_kick() might be ignored in case a deeper nesting level
was active right before the call of xen_poll_irq():

CPU 1:                                   CPU 2:
spin_lock(lock1)
                                         spin_lock(lock1)
                                         -> xen_qlock_wait()
                                            -> xen_clear_irq_pending()
                                            Interrupt happens
spin_unlock(lock1)
-> xen_qlock_kick(CPU 2)
spin_lock_irqsave(lock2)
                                         spin_lock_irqsave(lock2)
                                         -> xen_qlock_wait()
                                            -> xen_clear_irq_pending()
                                               clears kick for lock1
                                            -> xen_poll_irq()
spin_unlock_irq_restore(lock2)
-> xen_qlock_kick(CPU 2)
                                            wakes up
                                         spin_unlock_irq_restore(lock2)
                                         IRET
                                           resumes in xen_qlock_wait()
                                           -> xen_poll_irq()
                                           never wakes up

The solution is to disable interrupts in xen_qlock_wait() and not to
poll for the irq in case xen_qlock_wait() is called in nmi context.

Cc: stable@vger.kernel.org
Cc: Waiman.Long@hp.com
Cc: peterz@infradead.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2018-10-24 10:18:04 +02:00
..
alpha Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-08-24 09:25:39 -07:00
arc First batch of dma-mapping changes for 4.20: 2018-10-22 18:16:03 +01:00
arm Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-10-23 19:32:10 +01:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-10-24 06:47:44 +01:00
c6x dma-mapping: merge direct and noncoherent ops 2018-09-20 09:01:15 +02:00
h8300 Kbuild updates for v4.19 (2nd) 2018-08-25 13:40:38 -07:00
hexagon First batch of dma-mapping changes for 4.20: 2018-10-22 18:16:03 +01:00
ia64 Miscellaneous ia64 fixes from Christoph 2018-10-23 11:06:43 +01:00
m68k First batch of dma-mapping changes for 4.20: 2018-10-22 18:16:03 +01:00
microblaze dma-mapping: consolidate the dma mmap implementations 2018-09-20 09:01:16 +02:00
mips Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-10-24 06:47:44 +01:00
nds32 dma-mapping: merge direct and noncoherent ops 2018-09-20 09:01:15 +02:00
nios2 dma-mapping: merge direct and noncoherent ops 2018-09-20 09:01:15 +02:00
openrisc dma-mapping: merge direct and noncoherent ops 2018-09-20 09:01:15 +02:00
parisc Merge branch 'parisc-4.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2018-10-23 20:02:03 +01:00
powerpc libnvdimm/dax 4.19-rc8 2018-10-14 08:34:31 +02:00
riscv RISCV: Fix end PFN for low memory 2018-10-02 12:50:01 -07:00
s390 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-10-23 13:08:53 +01:00
sh regulator: Regulator updates for next release 2018-10-23 01:54:44 +01:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2018-10-24 06:42:00 +01:00
um ubd: remove use of blk_rq_map_sg 2018-10-18 15:13:12 -06:00
unicore32 unicore32: remove swiotlb support 2018-09-30 16:07:35 -07:00
x86 xen: make xen_qlock_wait() nestable 2018-10-24 10:18:04 +02:00
xtensa Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-10-23 13:08:53 +01:00
.gitignore
Kconfig jump_label: Implement generic support for relative references 2018-09-27 17:56:47 +02:00