1 // SPDX-License-Identifier: GPL-2.0
3 * Split spinlock implementation out into its own file, so it can be
4 * compiled in a FTRACE-compatible way.
6 #include <linux/spinlock.h>
7 #include <linux/export.h>
8 #include <linux/jump_label.h>
10 #include <asm/paravirt.h>
12 __visible
void __native_queued_spin_unlock(struct qspinlock
*lock
)
14 native_queued_spin_unlock(lock
);
16 PV_CALLEE_SAVE_REGS_THUNK(__native_queued_spin_unlock
);
18 bool pv_is_native_spin_unlock(void)
20 return pv_ops
.lock
.queued_spin_unlock
.func
==
21 __raw_callee_save___native_queued_spin_unlock
;
24 __visible
bool __native_vcpu_is_preempted(long cpu
)
28 PV_CALLEE_SAVE_REGS_THUNK(__native_vcpu_is_preempted
);
30 bool pv_is_native_vcpu_is_preempted(void)
32 return pv_ops
.lock
.vcpu_is_preempted
.func
==
33 __raw_callee_save___native_vcpu_is_preempted
;
36 void __init
paravirt_set_cap(void)
38 if (!pv_is_native_spin_unlock())
39 setup_force_cpu_cap(X86_FEATURE_PVUNLOCK
);
41 if (!pv_is_native_vcpu_is_preempted())
42 setup_force_cpu_cap(X86_FEATURE_VCPUPREEMPT
);