mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
x86/locking: Use sfence for wmb() if SSE is available
When adding cc clobber to wmb()'s definition, the alternative()
condition to use sfence was incorrectly raised from X86_FEATURE_XMM to
X86_FEATURE_XMM2.
Restore the correct constraint for potential better performance on
machines without SSE2.
Fixes: bd922477d9 ("locking/x86: Add cc clobber for ADDL")
Signed-off-by: Yao Zi <me@ziyao.cc>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260801182953.15069-1-me@ziyao.cc
This commit is contained in:
parent
b2250d63e6
commit
d824ed1307
|
|
@ -17,7 +17,7 @@
|
|||
#define rmb() asm volatile(ALTERNATIVE("lock addl $0,-4(%%esp)", "lfence", \
|
||||
X86_FEATURE_XMM2) ::: "memory", "cc")
|
||||
#define wmb() asm volatile(ALTERNATIVE("lock addl $0,-4(%%esp)", "sfence", \
|
||||
X86_FEATURE_XMM2) ::: "memory", "cc")
|
||||
X86_FEATURE_XMM) ::: "memory", "cc")
|
||||
#else
|
||||
#define __mb() asm volatile("mfence":::"memory")
|
||||
#define __rmb() asm volatile("lfence":::"memory")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user