Re: [PATCH 4/4] sparc32: add the sparc_atomic_cmpxchg_32 system call
From: John Paul Adrian Glaubitz
Date: Thu Oct 15 2026 - 05:39:26 EST
On Thu, 2026-10-15 at 11:21 +0200, Arnd Bergmann wrote:
> On Thu, Oct 15, 2026, at 10:55, Ramin Moussavi wrote:
> > User space built for v8 has no compare-and-swap. C libraries emulate it
> > with ldstub locks of their own, and those have two problems the kernel
> > cannot see. They are not async-signal-safe: a handler that reaches an
> > atomic while the code it interrupted holds the lock spins forever. And
> > the kernel does not know them: FUTEX_WAKE_OP and robust futexes write
> > the same words without taking those locks.
>
> As far as I know, the baseline in sparc32 glibc has been leon3 or
> sparcv9 for a long time, so CASA should always be available.
>
> Any remaining sun4m users are on an ancient userspace with a
> pre-futex glibc.
There are several contributors that are trying to revive Linux on pre-Leon
32-bit SPARC machines. Recently, Magnus Lindholm made some contributions
to be able to boot a modern kernel on his old SuperSPARC workstation [1].
The changes have already been merged into Andreas' tree for linux-next [2].
Adrian
> [1] https://lore.kernel.org/all/20261007174128.959307-1-linmag7@xxxxxxxxx/
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc.git/log/?h=for-next
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913