Merge tag 'uniphier-fixes-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / x86 / kernel / paravirt-spinlocks.c
1 /*
2  * Split spinlock implementation out into its own file, so it can be
3  * compiled in a FTRACE-compatible way.
4  */
5 #include <linux/spinlock.h>
6 #include <linux/export.h>
7 #include <linux/jump_label.h>
8
9 #include <asm/paravirt.h>
10
11 __visible void __native_queued_spin_unlock(struct qspinlock *lock)
12 {
13         native_queued_spin_unlock(lock);
14 }
15
16 PV_CALLEE_SAVE_REGS_THUNK(__native_queued_spin_unlock);
17
18 bool pv_is_native_spin_unlock(void)
19 {
20         return pv_lock_ops.queued_spin_unlock.func ==
21                 __raw_callee_save___native_queued_spin_unlock;
22 }
23
24 struct pv_lock_ops pv_lock_ops = {
25 #ifdef CONFIG_SMP
26         .queued_spin_lock_slowpath = native_queued_spin_lock_slowpath,
27         .queued_spin_unlock = PV_CALLEE_SAVE(__native_queued_spin_unlock),
28         .wait = paravirt_nop,
29         .kick = paravirt_nop,
30 #endif /* SMP */
31 };
32 EXPORT_SYMBOL(pv_lock_ops);
33
34 struct static_key paravirt_ticketlocks_enabled = STATIC_KEY_INIT_FALSE;
35 EXPORT_SYMBOL(paravirt_ticketlocks_enabled);