On Tue, 9 Sept 2025 at 18:55, John Paul Adrian Glaubitz glaubitz@physik.fu-berlin.de wrote:
On Tue, 2025-09-09 at 12:46 -0400, Kent Overstreet wrote:
On Tue, Sep 09, 2025 at 10:52:43PM +0800, Lance Yang wrote:
From: Lance Yang lance.yang@linux.dev
The blocker tracking mechanism assumes that lock pointers are at least 4-byte aligned to use their lower bits for type encoding.
However, as reported by Eero Tamminen, some architectures like m68k only guarantee 2-byte alignment of 32-bit values. This breaks the assumption and causes two related WARN_ON_ONCE checks to trigger.
Isn't m68k the only architecture that's weird like this?
Yes, and it does this on Linux only. I have been trying to change it upstream though as the official SysV ELF ABI for m68k requires a 4-byte natural alignment [1].
M68k does this on various OSes and ABIs that predate or are not explicitly compatible with the SysV ELF ABI.
Other architectures like CRIS (1-byte alignment!) are no longer supported by Linux.
FWIW, doubles (and doublewords) are not naturally aligned in the SysV ELF ABI for i386, while doubles (no mention of doublewords) are naturally aligned in the SysV ELF ABI for m68k.
Gr{oetje,eeting}s,
Geert