[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7061992e-e8bd-e5e5-9e63-3fb131e0fdde@linux-m68k.org>
Date: Wed, 8 Oct 2025 17:24:04 +1100 (AEDT)
From: Finn Thain <fthain@...ux-m68k.org>
To: Arnd Bergmann <arnd@...nel.org>
cc: Will Deacon <will@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Linux-Arch <linux-arch@...r.kernel.org>, linux-m68k@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>, Mark Rutland <mark.rutland@....com>,
Gary Guo <gary@...yguo.net>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atomic: skip alignment check for try_cmpxchg() old arg
On Mon, 6 Oct 2025, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> The 'old' argument in atomic_try_cmpxchg() and related functions is a
> pointer to a normal non-atomic integer number, which does not require
> to be naturally aligned, unlike the atomic_t/atomic64_t types themselves.
>
> In order to add an alignment check with CONFIG_DEBUG_ATOMIC into the
> normal instrument_atomic_read_write() helper, change this check to use
> the non-atomic instrument_read_write(), the same way that was done
> earlier for try_cmpxchg() in commit ec570320b09f ("locking/atomic:
> Correct (cmp)xchg() instrumentation").
>
> This prevents warnings on m68k calling the 32-bit atomic_try_cmpxchg()
> with 16-bit aligned arguments as well as several more architectures
> including x86-32 when calling atomic64_try_cmpxchg() with 32-bit
> aligned u64 arguments.
>
> Reported-by: Finn Thain <fthain@...ux-m68k.org>
Tested-by: Finn Thain <fthain@...ux-m68k.org>
> Link: https://lore.kernel.org/all/cover.1757810729.git.fthain@linux-m68k.org/
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> include/linux/atomic/atomic-instrumented.h | 26 +++++++++++-----------
> scripts/atomic/gen-atomic-instrumented.sh | 11 +++++----
> 2 files changed, 20 insertions(+), 17 deletions(-)
>
Powered by blists - more mailing lists