x86/pvqspinlock: Use LOCK_PREFIX in __pv_queued_spin_unlock assembly code
PATCH 1/1 x86/pvqspinlock: Use LOCK_PREFIX in __pv_queued_spin_unlock assembly code
The LOCK_PREFIX macro should be used in the assembly __raw_callee_save___pv_queued_spin_unlock code so that the lock prefix can be patched out on UP systems.
--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/qspinlock_paravirt.h +1 -1
@@ -43,7 +43,7 @@"push %rdx;" "mov $0x1,%eax;" "xor %edx,%edx;" -"lock cmpxchg %dl,(%rdi);" +LOCK_PREFIX "cmpxchg %dl,(%rdi);" "cmp $0x1,%al;" "jne .slowpath;" "pop %rdx;"
Signature · 1 line
1.8.3.1
Quoted 3 lines · Waiman Long
The
LOCK_PREFIXmacro should be used in the assembly__raw_callee_save___pv_queued_spin_unlockcode so that the lock prefix can be patched out on UP systems.
True; but does paravirt locking realy make sense on UP guests?
Quoted 21 lines
Signed-off-by Waiman Long <[email protected]>--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/include/asm/qspinlock_paravirt.h +1
-1@@ -43,7 +43,7 @@"push %rdx;" "mov $0x1,%eax;" "xor %edx,%edx;" -"lock cmpxchg %dl,(%rdi);" +LOCK_PREFIX "cmpxchg %dl,(%rdi);" "cmp $0x1,%al;" "jne .slowpath;" "pop %rdx;" Signature · 1 line
1.8.3.1
Quoted 6 lines · Peter Zijlstra
Quoted 3 lines · Waiman Long
The
LOCK_PREFIXmacro should be used in the assembly__raw_callee_save___pv_queued_spin_unlockcode so that the lock prefix can be patched out on UP systems.True; but does paravirt locking realy make sense on UP guests?
Yes, it doesn't make sense. That is why I have another kvm patch that turns off pvqspinlock for UP guest. However, I am not that familiar with the Xen code. So I don't have a corresponding one for Xen.
Cheers,
Longman
tip-bot for Waiman Long
merge bot[tip:locking/urgent] locking/pvqspinlock/x86: Use LOCK_PREFIX in __pv_queued_spin_unlock() assembly code
In reply to Waiman Longlocking/pvqspinlock/x86: Use LOCK_PREFIX in __pv_queued_spin_unlock() assembly code
Commit-ID: c0dc373a780f4ec63e45a573b9551763abd8cd1a Gitweb: https://git.kernel.org/tip/c0dc373a780f4ec63e45a573b9551763abd8cd1a Author: Waiman Long <[email protected]> AuthorDate: Tue, 17 Jul 2018 16:16:00 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 25 Jul 2018 11:22:20 +0200
locking/pvqspinlock/x86: Use LOCK_PREFIX in __pv_queued_spin_unlock() assembly code
The LOCK_PREFIX macro should be used in the __raw_callee_save___pv_queued_spin_unlock() assembly code, so that the lock prefix can be patched out on UP systems.
--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/qspinlock_paravirt.h +1 -1
@@ -43,7 +43,7 @@ asm (".pushsection .text;""push %rdx;" "mov $0x1,%eax;" "xor %edx,%edx;" -"lock cmpxchg %dl,(%rdi);" +LOCK_PREFIX "cmpxchg %dl,(%rdi);" "cmp $0x1,%al;" "jne .slowpath;" "pop %rdx;"