lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] futex: ensure futex_atomic_cmpxchg_inatomic() is present
On Tue, Oct 26, 2021 at 3:04 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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@arndb.de>
> ---
> 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@gmail.com>

--
Thanks.
-- Max

\
 
 \ /
  Last update: 2021-10-26 14:31    [W:0.077 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site