Commit e0fc17a936334c08b2729fff87168c03fdecf5b6

Authored by Konrad Rzeszutek Wilk
Committed by David Vrabel
1 parent c0914e6166

xen/spinlock: Don't enable them unconditionally.

The git commit a945928ea2709bc0e8e8165d33aed855a0110279
('xen: Do not enable spinlocks before jump_label_init() has executed')
was added to deal with the jump machinery. Earlier the code
that turned on the jump label was only called by Xen specific
functions. But now that it had been moved to the initcall machinery
it gets called on Xen, KVM, and baremetal - ouch!. And the detection
machinery to only call it on Xen wasn't remembered in the heat
of merge window excitement.

This means that the slowpath is enabled on baremetal while it should
not be.

Reported-by: Waiman Long <waiman.long@hp.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
CC: stable@vger.kernel.org
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

arch/x86/xen/spinlock.c
... ... @@ -274,7 +274,7 @@
274 274 printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
275 275 return;
276 276 }
277   -
  277 + printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
278 278 pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning);
279 279 pv_lock_ops.unlock_kick = xen_unlock_kick;
280 280 }
... ... @@ -288,6 +288,9 @@
288 288 static __init int xen_init_spinlocks_jump(void)
289 289 {
290 290 if (!xen_pvspin)
  291 + return 0;
  292 +
  293 + if (!xen_domain())
291 294 return 0;
292 295  
293 296 static_key_slow_inc(&paravirt_ticketlocks_enabled);