[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wg37rxdKbvLDR2OuzYOD_15Fycko4e1Yg=2Gj3TU=muPA@mail.gmail.com>
Date: Tue, 10 Feb 2026 17:12:19 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Thomas Gleixner <tglx@...nel.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [GIT pull] timers/vdso for v7.0-rc1
On Mon, 9 Feb 2026 at 05:06, Thomas Gleixner <tglx@...nel.org> wrote:
>
> - Switch get/put_unaligned() from packed struct to memcpy()
>
> The packed struct violates strict aliasing rules which requires to pass
> -fno-strict-aliasing to the compiler. As this are scalar values
> __builtin_memcpy() turns them into simple loads and stores
I've pulled this, but I really don't like this part of it.
The argument that "it requires -fno-strict-aliasing" is not an
argument. That's lille saying that "it requires a working C compiler".
The strict aliasing rules are garbage and need to just die. Anybody
who thinks they should compile the kernel with strict aliasing is just
wrong.
Yes, maybe __builtin_memcpy() does the right thing, but we've had
issues with that too.
Many more issues than we've ever had with "turn off the garbage that
is strict aliasing" which never caused any issues.
For example, memcpy() does *not* work with different address spaces
and has silently generated buggy code, so if somebody uses
get_unaligned() with a per-cpu pointer or something like that, you now
probably broke it.
Put another way: you have subtly broken the unaligned helpers for
special cases, and the argument for that breakage was just garbage.
Maybe those special cases aren't used.
Maybe.
Please reconsider.
Linus
Powered by blists - more mailing lists