Re: [PATCH] atomic: Specify natural alignment for atomic_t

From: Peter Zijlstra
Date: Mon Aug 25 2025 - 07:42:02 EST


On Mon, Aug 25, 2025 at 06:03:23PM +1000, Finn Thain wrote:
>
> On Mon, 25 Aug 2025, Peter Zijlstra wrote:
>
> >
> > And your architecture doesn't trap on unaligned atomic access ?!!?!
> >
>
> Right. This port doesn't do SMP.

There is RMW_INSN which seems to imply a compare-and-swap instruction of
sorts. That is happy to work on unaligned storage?

Anyway, it might make sense to add an alignment check to
arch/m68k/include/asm/atomic.h somewhere, perhaps dependent on
some DEBUG flag or other.