mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
Instead of having the pv spinlock function definitions in paravirt.h, move them into the new header paravirt-spinlock.h. Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20260105110520.21356-22-jgross@suse.com
40 lines
1.0 KiB
C
40 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_QSPINLOCK_H
|
|
#define _ASM_X86_QSPINLOCK_H
|
|
|
|
#include <linux/jump_label.h>
|
|
#include <asm/cpufeature.h>
|
|
#include <asm-generic/qspinlock_types.h>
|
|
#include <asm/paravirt.h>
|
|
#include <asm/rmwcc.h>
|
|
#ifdef CONFIG_PARAVIRT
|
|
#include <asm/paravirt-spinlock.h>
|
|
#endif
|
|
|
|
#define _Q_PENDING_LOOPS (1 << 9)
|
|
|
|
#define queued_fetch_set_pending_acquire queued_fetch_set_pending_acquire
|
|
static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lock)
|
|
{
|
|
u32 val;
|
|
|
|
/*
|
|
* We can't use GEN_BINARY_RMWcc() inside an if() stmt because asm goto
|
|
* and CONFIG_PROFILE_ALL_BRANCHES=y results in a label inside a
|
|
* statement expression, which GCC doesn't like.
|
|
*/
|
|
val = GEN_BINARY_RMWcc(LOCK_PREFIX "btsl", lock->val.counter, c,
|
|
"I", _Q_PENDING_OFFSET) * _Q_PENDING_VAL;
|
|
val |= atomic_read(&lock->val) & ~_Q_PENDING_MASK;
|
|
|
|
return val;
|
|
}
|
|
|
|
#ifndef CONFIG_PARAVIRT
|
|
static inline void native_pv_lock_init(void) { }
|
|
#endif
|
|
|
|
#include <asm-generic/qspinlock.h>
|
|
|
|
#endif /* _ASM_X86_QSPINLOCK_H */
|