aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/cmpxchg_32.h
diff options
context:
space:
mode:
authorGravatar Peter Zijlstra <peterz@infradead.org> 2022-10-21 13:36:24 +0200
committerGravatar Dave Hansen <dave.hansen@linux.intel.com> 2022-12-15 10:37:27 -0800
commitd4a72e7fe61a1ea9ad4accf3532411ca685eaead (patch)
tree58dbd4e342f31cbb412fabf323533208dafbab2f /arch/x86/include/asm/cmpxchg_32.h
parentx86_64: Remove pointless set_64bit() usage (diff)
downloadlinux-d4a72e7fe61a1ea9ad4accf3532411ca685eaead.tar.gz
linux-d4a72e7fe61a1ea9ad4accf3532411ca685eaead.tar.bz2
linux-d4a72e7fe61a1ea9ad4accf3532411ca685eaead.zip
x86/mm/pae: Get rid of set_64bit()
Recognise that set_64bit() is a special case of our previously introduced pxx_xchg64(), so use that and get rid of set_64bit(). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20221022114425.233481884%40infradead.org
Diffstat (limited to 'arch/x86/include/asm/cmpxchg_32.h')
-rw-r--r--arch/x86/include/asm/cmpxchg_32.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index 215f5a65790f..6ba80ce9438d 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -7,34 +7,6 @@
* you need to test for the feature in boot_cpu_data.
*/
-/*
- * CMPXCHG8B only writes to the target if we had the previous
- * value in registers, otherwise it acts as a read and gives us the
- * "new previous" value. That is why there is a loop. Preloading
- * EDX:EAX is a performance optimization: in the common case it means
- * we need only one locked operation.
- *
- * A SIMD/3DNOW!/MMX/FPU 64-bit store here would require at the very
- * least an FPU save and/or %cr0.ts manipulation.
- *
- * cmpxchg8b must be used with the lock prefix here to allow the
- * instruction to be executed atomically. We need to have the reader
- * side to see the coherent 64bit value.
- */
-static inline void set_64bit(volatile u64 *ptr, u64 value)
-{
- u32 low = value;
- u32 high = value >> 32;
- u64 prev = *ptr;
-
- asm volatile("\n1:\t"
- LOCK_PREFIX "cmpxchg8b %0\n\t"
- "jnz 1b"
- : "=m" (*ptr), "+A" (prev)
- : "b" (low), "c" (high)
- : "memory");
-}
-
#ifdef CONFIG_X86_CMPXCHG64
#define arch_cmpxchg64(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg64((ptr), (unsigned long long)(o), \