lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aeb17f15-de44-e46e-cb3a-0edc1551d3e1@linux-m68k.org>
Date: Wed, 17 Sep 2025 11:23:28 +1000 (AEST)
From: Finn Thain <fthain@...ux-m68k.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
cc: Arnd Bergmann <arnd@...db.de>, Peter Zijlstra <peterz@...radead.org>, 
    Will Deacon <will@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, 
    Boqun Feng <boqun.feng@...il.com>, Jonathan Corbet <corbet@....net>, 
    Mark Rutland <mark.rutland@....com>, linux-kernel@...r.kernel.org, 
    Linux-Arch <linux-arch@...r.kernel.org>, linux-m68k@...r.kernel.org, 
    John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>
Subject: Re: [RFC v2 3/3] atomic: Add alignment check to instrumented atomic
 operations


On Tue, 16 Sep 2025, Geert Uytterhoeven wrote:

> On Tue, 16 Sept 2025 at 02:16, Finn Thain <fthain@...ux-m68k.org> wrote:
> > On Mon, 15 Sep 2025, Arnd Bergmann wrote:
> > >
> > > Has there been any progress on building m68k kernels with 
> > > -mint-align?
> >
> > Not that I know of.
> >
> > > IIRC there are only a small number of uapi structures that need 
> > > __packed annotations to maintain the existing syscall ABI.
> >
> > Packing uapi structures (and adopting -malign-int) sounds easier than 
> > the alternative, which might be to align certain internal kernel 
> > struct members, on a case-by-case basis, where doing so could be shown 
> > to improve performance on some architecture or other (while keeping 
> > -mno-align-int).
> 
> indeed.
> 

Well, it "sounds easier". But I doubt that it really is easier.

> > Well, it's easy to find all the structs that belong to the uapi, but 
> > it's not easy to find all the internal kernel structs that describe 
> > MMIO registers. For -malign-int, both kinds of structs are a problem.
> 
> For structures under arch/m68k/include/asm/, just create a single C file 
> that calculates sizeof() of each structure, and compare the generated 
> code with and without -malign-int.  Any differences should be 
> investigated, and attributed when needed.
> 
> For structures inside m68k-specific drivers, do something similar inside 
> those drivers ('git grep "struct\s*[a-zA-Z0-9_]*\s*{"' is your friend).
> 

There's something to be said for adding static_assert() checks for the 
structs that belong to all fixed interfaces. The patches to actually pack 
of struct members could take place after that.

All of which is a lot of work, compared to specifying alignment for those 
core kernel data structures where doing so improves performance. This 
approach is platform neutral; it's not just m68k that benefits.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ