[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <323dcff2-6135-4b8a-85db-bccc315ddfdf@app.fastmail.com>
Date: Wed, 06 Nov 2024 09:55:06 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Joerg Roedel" <joro@...tes.org>,
"Suravee Suthikulpanit" <suravee.suthikulpanit@....com>
Cc: linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
"Robin Murphy" <robin.murphy@....com>, vasant.hegde@....com,
"Jason Gunthorpe" <jgg@...dia.com>, "Kevin Tian" <kevin.tian@...el.com>,
jon.grimm@....com, santosh.shukla@....com, pandoh@...gle.com,
kumaranand@...gle.com, "Uros Bizjak" <ubizjak@...il.com>,
Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH v9 03/10] asm/rwonce: Introduce [READ|WRITE]_ONCE() support for
__int128
On Tue, Nov 5, 2024, at 13:30, Joerg Roedel wrote:
> On Fri, Nov 01, 2024 at 04:22:57PM +0000, Suravee Suthikulpanit wrote:
>> include/asm-generic/rwonce.h | 2 +-
>> include/linux/compiler_types.h | 8 +++++++-
>> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> This patch needs Cc:
>
> Arnd Bergmann <arnd@...db.de>
> linux-arch@...r.kernel.org
>
It also needs an update to the comment about why this is safe:
>> +++ b/include/asm-generic/rwonce.h
>> @@ -33,7 +33,7 @@
>> * (e.g. a virtual address) and a strong prevailing wind.
>> */
>> #define compiletime_assert_rwonce_type(t) \
>> - compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
>> + compiletime_assert(__native_word(t) || sizeof(t) == sizeof(__dword_type), \
>> "Unsupported access size for {READ,WRITE}_ONCE().")
As far as I can tell, 128-but words don't get stored atomically on
any architecture, so this seems wrong, because it would remove
the assertion on someone incorrectly using WRITE_ONCE() on a
128-bit variable.
Arnd
Powered by blists - more mailing lists