Skip to content

Commit e0fc17a

Browse files
konradwilkDavid Vrabel
authored andcommitted
xen/spinlock: Don't enable them unconditionally.
The git commit a945928 ('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 <[email protected]> Acked-by: Steven Rostedt <[email protected]> CC: [email protected] CC: Boris Ostrovsky <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> Signed-off-by: David Vrabel <[email protected]>
1 parent c0914e6 commit e0fc17a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/xen/spinlock.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void __init xen_init_spinlocks(void)
274274
printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
275275
return;
276276
}
277-
277+
printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
278278
pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning);
279279
pv_lock_ops.unlock_kick = xen_unlock_kick;
280280
}
@@ -290,6 +290,9 @@ static __init int xen_init_spinlocks_jump(void)
290290
if (!xen_pvspin)
291291
return 0;
292292

293+
if (!xen_domain())
294+
return 0;
295+
293296
static_key_slow_inc(&paravirt_ticketlocks_enabled);
294297
return 0;
295298
}

0 commit comments

Comments
 (0)