Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'cmpxchg.2024.07.12a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu

Pull arm byte cmpxchg from Paul McKenney:
"ARM: Provide one-byte cmpxchg emulation

This provides emulated one-byte cmpxchg() support for ARM using the
cmpxchg_emu_u8() function that uses a four-byte cmpxchg() to emulate
the one-byte variant.

Similar patches for emulation of one-byte cmpxchg() for arc, sh, and
xtensa have not yet received maintainer acks, so they are slated for
the v6.12 merge window"

* tag 'cmpxchg.2024.07.12a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
ARM: Emulate one-byte cmpxchg

+7 -1
+1
arch/arm/Kconfig
··· 34 34 select ARCH_MIGHT_HAVE_PC_PARPORT 35 35 select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX 36 36 select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 37 + select ARCH_NEED_CMPXCHG_1_EMU if CPU_V6 37 38 select ARCH_SUPPORTS_ATOMIC_RMW 38 39 select ARCH_SUPPORTS_CFI_CLANG 39 40 select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
+6 -1
arch/arm/include/asm/cmpxchg.h
··· 5 5 #include <linux/irqflags.h> 6 6 #include <linux/prefetch.h> 7 7 #include <asm/barrier.h> 8 + #include <linux/cmpxchg-emu.h> 8 9 9 10 #if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) 10 11 /* ··· 163 162 prefetchw((const void *)ptr); 164 163 165 164 switch (size) { 166 - #ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */ 165 + #ifdef CONFIG_CPU_V6 /* ARCH == ARMv6 */ 166 + case 1: 167 + oldval = cmpxchg_emu_u8((volatile u8 *)ptr, old, new); 168 + break; 169 + #else /* min ARCH > ARMv6 */ 167 170 case 1: 168 171 do { 169 172 asm volatile("@ __cmpxchg1\n"