locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
PATCH 1/1 locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
Use _Q_LOCKED_VAL instead of hardcoded $0x1 in PV_UNLOCK_ASM macro.
No functional changes intended.
--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/qspinlock_paravirt.h +1 -1
@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \ "push %rdx\n\t" \ - "mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ "xor %edx,%edx\n\t" \ LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ "jne .slowpath\n\t" \
Signature · 1 line
2.42.0
Quoted 19 lines · Uros Bizjak
Use
_Q_LOCKED_VALinstead of hardcoded $0x1 inPV_UNLOCK_ASMmacro.No functional changes intended.
Signed-off-by Uros Bizjak <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Ingo Molnar <[email protected]>Cc Will Deacon <[email protected]>Cc Waiman Long <[email protected]>Cc Boqun Feng <[email protected]>--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/include/asm/qspinlock_paravirt.h +0
-0
arch/x86/include/asm/qspinlock_paravirt.h __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · line 46
Quoted 8 lines
arch/x86/include/asm/qspinlock_paravirt.h +1
-1@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \ "push %rdx\n\t" \ - "mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ "xor %edx,%edx\n\t" \ LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ "jne .slowpath\n\t" \
There is also a "cmp $0x1,%al" afterwards.
Regards,
Boqun
Quoted 3 lines
Signature · 1 line
2.42.0
Quoted 7 lines · Boqun Feng
Quoted 7 lines
arch/x86/include/asm/qspinlock_paravirt.h +0
-0@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \
Quoted 8 lines
arch/x86/include/asm/qspinlock_paravirt.h __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · line 46
Quoted 6 lines
arch/x86/include/asm/qspinlock_paravirt.h +1
-1"push %rdx\n\t" \ -"mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \"xor %edx,%edx\n\t" \LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \"jne .slowpath\n\t" \There is also a "cmp $0x1,%al" afterwards.
Not anymore. Please note that the patch is against -tip, where we have:
Thanks,
Uros.
Quoted 18 lines · Uros Bizjak
Quoted 7 lines · Boqun Feng
Quoted 7 lines
arch/x86/include/asm/qspinlock_paravirt.h +0
-0@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \Quoted 8 lines
arch/x86/include/asm/qspinlock_paravirt.h __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · line 46
Quoted 6 lines
arch/x86/include/asm/qspinlock_paravirt.h +1
-1"push %rdx\n\t" \ -"mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \"xor %edx,%edx\n\t" \LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \"jne .slowpath\n\t" \There is also a "cmp $0x1,%al" afterwards.
Quoted 2 lines
Not anymore. Please note that the patch is against -tip, where we have:
Oh, thanks for the information. Maybe it makes sense to mention the patches dependency in the commit log?
Regards,
Boqun
Quoted 20 lines · Boqun Feng
Quoted 18 lines · Uros Bizjak
Quoted 15 lines · Boqun Feng
arch/x86/include/asm/qspinlock_paravirt.h __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · line 46
Quoted 13 lines
arch/x86/include/asm/qspinlock_paravirt.h +1
-1@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \ "push %rdx\n\t" \ - "mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ "xor %edx,%edx\n\t" \ LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ "jne .slowpath\n\t" \There is also a "cmp $0x1,%al" afterwards.
Quoted 5 lines
Quoted 2 lines
Not anymore. Please note that the patch is against -tip, where we have:
Oh, thanks for the information. Maybe it makes sense to mention the patches dependency in the commit log?
Hm, yes ... I should mention this as "[PATCH -tip]" in the subject line to avoid confusion with this particular patch.
Thanks,
Uros.
Boqun Feng
Acked-byQuoted 21 lines · Uros Bizjak
Quoted 20 lines · Boqun Feng
Quoted 18 lines · Uros Bizjak
Quoted 15 lines · Boqun Feng
arch/x86/include/asm/qspinlock_paravirt.h __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · line 46
Quoted 13 lines
arch/x86/include/asm/qspinlock_paravirt.h +1
-1@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \ "push %rdx\n\t" \ - "mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ "xor %edx,%edx\n\t" \ LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ "jne .slowpath\n\t" \There is also a "cmp $0x1,%al" afterwards.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Not anymore. Please note that the patch is against -tip, where we have:
Oh, thanks for the information. Maybe it makes sense to mention the patches dependency in the commit log?
Hm, yes ... I should mention this as "[PATCH -tip]" in the subject line to avoid confusion with this particular patch.
Anyway, the code looks good to me.
Regards,
Boqun
Quoted 2 lines
Thanks,
Uros.
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 532453e7aa78f3962fb4d86caf40ff81ebf62160 Gitweb: https://git.kernel.org/tip/532453e7aa78f3962fb4d86caf40ff81ebf62160 Author: Uros Bizjak <[email protected]> AuthorDate: Mon, 22 Apr 2024 17:17:35 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 24 Apr 2024 11:48:08 +02:00
locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro
Use _Q_LOCKED_VAL instead of hardcoded $0x1 in PV_UNLOCK_ASM macro.
No functional changes intended.
--- arch/x86/include/asm/qspinlock_paravirt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/qspinlock_paravirt.h +1 -1
@@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text");#define PV_UNLOCK_ASM \ FRAME_BEGIN \ "push %rdx\n\t" \ - "mov $0x1,%eax\n\t" \ + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ "xor %edx,%edx\n\t" \ LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ "jne .slowpath\n\t" \