From: Finn Thain <fthain@linux-m68k.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Will Deacon <will@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Boqun Feng <boqun.feng@gmail.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Linux-Arch <linux-arch@vger.kernel.org>,
linux-m68k@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Mark Rutland <mark.rutland@arm.com>, Gary Guo <gary@garyguo.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atomic: skip alignment check for try_cmpxchg() old arg
Date: Wed, 8 Oct 2025 17:24:04 +1100 (AEDT) [thread overview]
Message-ID: <7061992e-e8bd-e5e5-9e63-3fb131e0fdde@linux-m68k.org> (raw)
In-Reply-To: <20251006110740.468309-1-arnd@kernel.org>
On Mon, 6 Oct 2025, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@linux-m68k.org>
Tested-by: Finn Thain <fthain@linux-m68k.org>
> Link: https://lore.kernel.org/all/cover.1757810729.git.fthain@linux-m68k.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/linux/atomic/atomic-instrumented.h | 26 +++++++++++-----------
> scripts/atomic/gen-atomic-instrumented.sh | 11 +++++----
> 2 files changed, 20 insertions(+), 17 deletions(-)
>
next prev parent reply other threads:[~2025-10-08 6:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 11:07 [PATCH] atomic: skip alignment check for try_cmpxchg() old arg Arnd Bergmann
2025-10-08 6:24 ` Finn Thain [this message]
2025-10-21 10:35 ` [tip: locking/core] atomic: Skip " tip-bot2 for Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7061992e-e8bd-e5e5-9e63-3fb131e0fdde@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=geert@linux-m68k.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.