Merge branch 'x86-spinlocks-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 spinlock update from Ingo Molnar:
"Convert an NMI lock to raw"

[ Clarification: it's not that the lock itself is NMI-safe, it's about
NMI registration called from RT contexts - Linus ]

* 'x86-spinlocks-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/nmi: Use raw lock

+9 -9
+9 -9
arch/x86/kernel/nmi.c
··· 39 #include <trace/events/nmi.h> 40 41 struct nmi_desc { 42 - spinlock_t lock; 43 struct list_head head; 44 }; 45 46 static struct nmi_desc nmi_desc[NMI_MAX] = 47 { 48 { 49 - .lock = __SPIN_LOCK_UNLOCKED(&nmi_desc[0].lock), 50 .head = LIST_HEAD_INIT(nmi_desc[0].head), 51 }, 52 { 53 - .lock = __SPIN_LOCK_UNLOCKED(&nmi_desc[1].lock), 54 .head = LIST_HEAD_INIT(nmi_desc[1].head), 55 }, 56 { 57 - .lock = __SPIN_LOCK_UNLOCKED(&nmi_desc[2].lock), 58 .head = LIST_HEAD_INIT(nmi_desc[2].head), 59 }, 60 { 61 - .lock = __SPIN_LOCK_UNLOCKED(&nmi_desc[3].lock), 62 .head = LIST_HEAD_INIT(nmi_desc[3].head), 63 }, 64 ··· 163 164 init_irq_work(&action->irq_work, nmi_max_handler); 165 166 - spin_lock_irqsave(&desc->lock, flags); 167 168 /* 169 * Indicate if there are multiple registrations on the ··· 181 else 182 list_add_tail_rcu(&action->list, &desc->head); 183 184 - spin_unlock_irqrestore(&desc->lock, flags); 185 return 0; 186 } 187 EXPORT_SYMBOL(__register_nmi_handler); ··· 192 struct nmiaction *n; 193 unsigned long flags; 194 195 - spin_lock_irqsave(&desc->lock, flags); 196 197 list_for_each_entry_rcu(n, &desc->head, list) { 198 /* ··· 207 } 208 } 209 210 - spin_unlock_irqrestore(&desc->lock, flags); 211 synchronize_rcu(); 212 } 213 EXPORT_SYMBOL_GPL(unregister_nmi_handler);
··· 39 #include <trace/events/nmi.h> 40 41 struct nmi_desc { 42 + raw_spinlock_t lock; 43 struct list_head head; 44 }; 45 46 static struct nmi_desc nmi_desc[NMI_MAX] = 47 { 48 { 49 + .lock = __RAW_SPIN_LOCK_UNLOCKED(&nmi_desc[0].lock), 50 .head = LIST_HEAD_INIT(nmi_desc[0].head), 51 }, 52 { 53 + .lock = __RAW_SPIN_LOCK_UNLOCKED(&nmi_desc[1].lock), 54 .head = LIST_HEAD_INIT(nmi_desc[1].head), 55 }, 56 { 57 + .lock = __RAW_SPIN_LOCK_UNLOCKED(&nmi_desc[2].lock), 58 .head = LIST_HEAD_INIT(nmi_desc[2].head), 59 }, 60 { 61 + .lock = __RAW_SPIN_LOCK_UNLOCKED(&nmi_desc[3].lock), 62 .head = LIST_HEAD_INIT(nmi_desc[3].head), 63 }, 64 ··· 163 164 init_irq_work(&action->irq_work, nmi_max_handler); 165 166 + raw_spin_lock_irqsave(&desc->lock, flags); 167 168 /* 169 * Indicate if there are multiple registrations on the ··· 181 else 182 list_add_tail_rcu(&action->list, &desc->head); 183 184 + raw_spin_unlock_irqrestore(&desc->lock, flags); 185 return 0; 186 } 187 EXPORT_SYMBOL(__register_nmi_handler); ··· 192 struct nmiaction *n; 193 unsigned long flags; 194 195 + raw_spin_lock_irqsave(&desc->lock, flags); 196 197 list_for_each_entry_rcu(n, &desc->head, list) { 198 /* ··· 207 } 208 } 209 210 + raw_spin_unlock_irqrestore(&desc->lock, flags); 211 synchronize_rcu(); 212 } 213 EXPORT_SYMBOL_GPL(unregister_nmi_handler);