[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7/ijxXMGqYCqSRe@hirez.programming.kicks-ass.net>
Date: Thu, 12 Jan 2023 11:35:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Mark Rutland <mark.rutland@....com>
Cc: torvalds@...ux-foundation.org, corbet@....net, will@...nel.org,
boqun.feng@...il.com, catalin.marinas@....com, dennis@...nel.org,
tj@...nel.org, cl@...ux.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, Herbert Xu <herbert@...dor.apana.org.au>,
davem@...emloft.net, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, joro@...tes.org, suravee.suthikulpanit@....com,
robin.murphy@....com, dwmw2@...radead.org,
baolu.lu@...ux.intel.com, Arnd Bergmann <arnd@...db.de>,
penberg@...nel.org, rientjes@...gle.com, iamjoonsoo.kim@....com,
Andrew Morton <akpm@...ux-foundation.org>, vbabka@...e.cz,
roman.gushchin@...ux.dev, 42.hyeyoo@...il.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-s390@...r.kernel.org,
linux-crypto@...r.kernel.org, iommu@...ts.linux.dev,
linux-arch@...r.kernel.org
Subject: Re: [RFC][PATCH 05/12] arch: Introduce
arch_{,try_}_cmpxchg128{,_local}()
On Mon, Jan 09, 2023 at 06:50:24PM +0000, Mark Rutland wrote:
> Similarly, I'd suggest:
>
> | #define __CMPXCHG128(name, mb, cl...) \
> | static __always_inline u128 \
> | __lse__cmpxchg128##name(volatile u128 *ptr, u128 old, u128 new) \
> | { \
> | asm volatile( \
> | __LSE_PREAMBLE \
> | " casp" #mb "\t%[old], %H[old], %[new], %H[new], %[v]\n" \
> | : [old] "+&r" (old), \
> | [v] "+Q" (*(u128 *)ptr) \
> | : [new] "r" (new) \
> | : cl); \
> | \
> | return old; \
> | }
> |
> | __CMPXCHG128( , )
> | __CMPXCHG128(_mb, al, "memory")
> |
> | #undef __CMPXCHG128
clang-16 seems to hate on this like:
arch/arm64/include/asm/atomic_lse.h:342:1: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
arch/arm64/include/asm/atomic_lse.h:334:17: note: expanded from macro '__CMPXCHG128'
: [old] "+&r" (old), \
^
(much the same for the ll_sc version; if you want the full build thing,
holler and I'll bounce you the robot mail).
Powered by blists - more mailing lists