[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXWkkofG2M3zqxo6DmiZc7OJ8-2p+kJ1gxan0_nVFoiCA@mail.gmail.com>
Date: Tue, 2 Sep 2025 16:14:02 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Lance Yang <lance.yang@...ux.dev>
Cc: Finn Thain <fthain@...ux-m68k.org>, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, mhiramat@...nel.org, oak@...sinkinet.fi,
peterz@...radead.org, stable@...r.kernel.org, will@...nel.org,
Lance Yang <ioworker0@...il.com>, linux-m68k@...ts.linux-m68k.org
Subject: Re: [PATCH] atomic: Specify natural alignment for atomic_t
Hi Lance,
On Tue, 2 Sept 2025 at 15:31, Lance Yang <lance.yang@...ux.dev> wrote:
> On 2025/9/1 16:45, Geert Uytterhoeven wrote:
> > On Thu, 28 Aug 2025 at 04:05, Lance Yang <lance.yang@...ux.dev> wrote:
> >> This proves the problem can happen in practice (e.g., with packed structs),
> >> so we need to ignore the unaligned pointers on the architectures that don't
> >> trap for now.
> >
> > Putting locks inside a packed struct is definitely a Very Bad Idea
> > and a No Go. Packed structs are meant to describe memory data and
>
> Right. That's definitely not how packed structs should be used ;)
>
> > MMIO register layouts, and must not contain control data for critical
> > sections.
>
> Unfortunately, this patten was found in an in-tree driver, as reported[1]
> by kernel test robot, and there might be other undiscovered instances ...
>
> [1]
> https://lore.kernel.org/oe-kbuild-all/202508240539.ARmC1Umu-lkp@intel.com
That one is completely bogus, and should be removed.
Currently it would crash on any platform that does not support
unaligned accesses.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists