x86/MSI: fix locking in pci_restore_msi_state()
PATCH 1/1 x86/MSI: fix locking in pci_restore_msi_state()
Right after the loop the lock is being dropped, so all loop exits should happen with the lock still held.
xen/arch/x86/msi.c +1 -1
@@ -1158,11 +1158,11 @@ int pci_restore_msi_state(struct pci_devfor ( i =0 ; ; ) {msi_set_mask_bit (desc, entry[i].msi_attrib.masked); -spin_unlock_irqrestore (&desc->lock, flags);if ( !--nr )break ; +spin_unlock_irqrestore (&desc->lock, flags); desc = &irq_desc[entry[++i].irq];spin_lock_irqsave (&desc->lock, flags);if ( desc->msi_desc != entry + i )
x86/MSI: fix locking in pci_restore_msi_state()
Right after the loop the lock is being dropped, so all loop exits should happen with the lock still held.
xen/arch/x86/msi.c +1 -1
@@ -1158,11 +1158,11 @@ int pci_restore_msi_state(struct pci_devfor ( i =0 ; ; ) {msi_set_mask_bit (desc, entry[i].msi_attrib.masked); -spin_unlock_irqrestore (&desc->lock, flags);if ( !--nr )break ; +spin_unlock_irqrestore (&desc->lock, flags); desc = &irq_desc[entry[++i].irq];spin_lock_irqsave (&desc->lock, flags);if ( desc->msi_desc != entry + i )
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 6 lines · Jan Beulich
Right after the loop the lock is being dropped, so all loop exits should happen with the lock still held.
Reported-by Kristoffer Egefelt <[email protected]>Signed-off-by Jan Beulich <[email protected]>Tested-by Kristoffer Egefelt <[email protected]>
Quoted 21 lines
xen/arch/x86/msi.c +1
-1@@ -1158,11 +1158,11 @@ int pci_restore_msi_state(struct pci_devfor ( i =0 ; ; ) {msi_set_mask_bit (desc, entry[i].msi_attrib.masked); -spin_unlock_irqrestore (&desc->lock, flags);if ( !--nr )break ; +spin_unlock_irqrestore (&desc->lock, flags); desc = &irq_desc[entry[++i].irq];spin_lock_irqsave (&desc->lock, flags);if ( desc->msi_desc != entry + i )
Quoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel