[PATCH 1/1] x86/paravirt: Use static_branch_unlikely() for virt_spin_lock_key test

From: Qiuxu Zhuo
Date: Tue Aug 13 2024 - 23:27:46 EST


Commit

e639222a5119 ("x86/paravirt: Fix incorrect virt spinlock setting on bare metal")

sets virt_spin_lock_key to false by default. Use static_branch_unlikely() for
virt_spin_lock_key test.

Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx>
---
arch/x86/include/asm/qspinlock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h
index 68da67df304d..b6f336a227da 100644
--- a/arch/x86/include/asm/qspinlock.h
+++ b/arch/x86/include/asm/qspinlock.h
@@ -89,7 +89,7 @@ static inline bool virt_spin_lock(struct qspinlock *lock)
{
int val;

- if (!static_branch_likely(&virt_spin_lock_key))
+ if (!static_branch_unlikely(&virt_spin_lock_key))
return false;

/*
--
2.17.1