From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B9B154B1 for ; Wed, 31 May 2023 14:21:47 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 44D65580177; Wed, 31 May 2023 10:21:45 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 31 May 2023 10:21:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1685542905; x=1685550105; bh=EB qVSuczL8zsM7Z+quPoEDfVsyxlfcBd6Pp556uYrbw=; b=OzFEpTKSe5S3pZEmFP KK1uM3LsgMCSyqEpKXgp8mQacr9rZEDCmrd2k8BVEDg3tEc7xY/t0qJaQdSDGOT2 bU9zqMXGeLUQtd2ZGrrNxWGkpEIaVxk071lBAmfAeMQCHDxFTt1RXc0tTa+8BNvc dHGAYyoqxLWEz0DRWsqrZCl7jyQXG+IYTwZfBGL3jP6UuAq+xC/o+0owjbxmZ2CX jKHn0znJCe5sFHF0XfK674YIkVcUuVTivSqn6lMR/WSjKrRbWWAoJGIngDeXfeY4 rj3t8KhnnMw/ULtpMFDj7NVn9Ce9QDTK6Kw9M2KCXxWhhGFtgzM636rI9Ixm3L54 I9vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1685542905; x=1685550105; bh=EBqVSuczL8zsM 7Z+quPoEDfVsyxlfcBd6Pp556uYrbw=; b=oHsmrYj795DmAa232WElXIyigX6QS 0lEvQFY80QEb+Xv0tRxVq8oUZFcRlC2iXWMf6A9EQv2H5cUZwOYXI3ksFh0MS95T a/00JTDEw8+IydUghKJpXfKrc3inW8q2ucI7PDOEPvDnPWUUJno8vH4RJtk3SbTY Xo+OOCRlKmOMcOOakCRfPh4R5icttoicQwN5NjWzxihP8oZl/jY89WgumqrZIZXm 4AoaMaI7N608rPOsEyznGm2POVWr2Onut7ICia06/ESVNpGopI564yXoSbydFLpg hbe4TBBj3hxrtKP7i4wcLhqKNVYnyN+0hkR0iUv05alMTrQZU5p/u+1Vw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekledgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0E183B60086; Wed, 31 May 2023 10:21:42 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-447-ge2460e13b3-fm-20230525.001-ge2460e13 Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Message-Id: <70a69deb-7ad4-45b2-8e13-34955594a7ce@app.fastmail.com> In-Reply-To: <20230531132323.722039569@infradead.org> References: <20230531130833.635651916@infradead.org> <20230531132323.722039569@infradead.org> Date: Wed, 31 May 2023 16:21:22 +0200 From: "Arnd Bergmann" To: "Peter Zijlstra" , "Linus Torvalds" Cc: "Jonathan Corbet" , "Will Deacon" , "Boqun Feng" , "Mark Rutland" , "Catalin Marinas" , dennis@kernel.org, "Tejun Heo" , "Christoph Lameter" , "Heiko Carstens" , gor@linux.ibm.com, "Alexander Gordeev" , borntraeger@linux.ibm.com, "Sven Schnelle" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "H. Peter Anvin" , "Joerg Roedel" , suravee.suthikulpanit@amd.com, "Robin Murphy" , "David Woodhouse" , "Baolu Lu" , "Herbert Xu" , "David S . Miller" , "Pekka Enberg" , "David Rientjes" , "Joonsoo Kim" , "Andrew Morton" , "Vlastimil Babka" , "Roman Gushchin" , "Hyeonggon Yoo" <42.hyeyoo@gmail.com>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, iommu@lists.linux.dev, Linux-Arch , linux-crypto@vger.kernel.org, "Stephen Rothwell" , "Michael Ellerman" , "James E . J . Bottomley" , "Helge Deller" , linux-parisc@vger.kernel.org Subject: Re: [PATCH 07/12] percpu: #ifndef __SIZEOF_INT128__ Content-Type: text/plain On Wed, May 31, 2023, at 15:08, Peter Zijlstra wrote: > Some 64bit architectures do not advertise __SIZEOF_INT128__ on all > supported compiler versions. Notably the HPPA64 only started doing > with GCC-11. I checked the other compilers to be sure that anything else we support (gcc-5.1 and up) across all 64-bit architectures does support int128. It would be nice to have the hack more localized to parisc and guarded with a CONFIG_GCC_VERSION check so we can kill it off in the future, once we drop either gcc-10 or parisc support. > +#ifndef __SIZEOF_INT128__ > +#define raw_cpu_generic_try_cmpxchg_memcmp(pcp, ovalp, nval) \ > +({ \ > + typeof(pcp) *__p = raw_cpu_ptr(&(pcp)); \ > + typeof(pcp) __val = *__p, __old = *(ovalp); \ > + bool __ret; \ > + if (!__builtin_memcmp(&__val, &__old, sizeof(pcp))) { \ > + *__p = nval; \ > + __ret = true; \ > + } else { \ > + *(ovalp) = __val; \ > + __ret = false; \ > + } \ > + __ret; \ > +}) > + > +#define raw_cpu_generic_cmpxchg_memcmp(pcp, oval, nval) \ > +({ \ > + typeof(pcp) __old = (oval); \ > + raw_cpu_generic_try_cmpxchg_memcpy(pcp, &__old, nval); \ > + __old; \ > +}) Instead of having this in include/asm-generic under !__SIZEOF_INT128__, could you just move this into the parisc files with a compiler version check? Arnd