On Tue, Oct 26, 2021 at 3:04 AM Arnd Bergmann <arnd@xxxxxxxxxx> wrote: > > From: Arnd Bergmann <arnd@xxxxxxxx> > > The boot-time detection of futex_atomic_cmpxchg_inatomic() > has a bug on some 32-bit arm builds, and Thomas Gleixner > suggested that setting CONFIG_HAVE_FUTEX_CMPXCHG would > avoid the problem, as it is always present anyway. > > Looking into which other architectures could do the same > showed that almost all architectures have it, the exceptions > being: > > - some old 32-bit MIPS uniprocessor cores without ll/sc > - one xtensa variant with no SMP > - 32-bit SPARC when built for SMP > > Fix MIPS And Xtensa by rearranging the generic code to let it be used > as a fallback. > > For SPARC, the SMP definition just ends up turning off futex anyway, > so this can be done at Kconfig time instead. Note that sparc32 > glibc requires the CASA instruction for its mutexes anyway, > which is only available when running on SPARCv9 or LEON CPUs, > but needs to be implemented in the sparc32 kernel for those. > > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx> > --- > arch/mips/include/asm/futex.h | 29 ++++++++++++++++++----------- > arch/xtensa/include/asm/futex.h | 8 ++++++-- > include/asm-generic/futex.h | 31 +++++++++++-------------------- > init/Kconfig | 1 + > 4 files changed, 36 insertions(+), 33 deletions(-) For xtensa: Acked-by: Max Filippov <jcmvbkbc@xxxxxxxxx> -- Thanks. -- Max