lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <70a69deb-7ad4-45b2-8e13-34955594a7ce@app.fastmail.com>
Date:   Wed, 31 May 2023 16:21:22 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Peter Zijlstra" <peterz@...radead.org>,
        "Linus Torvalds" <torvalds@...ux-foundation.org>
Cc:     "Jonathan Corbet" <corbet@....net>,
        "Will Deacon" <will@...nel.org>,
        "Boqun Feng" <boqun.feng@...il.com>,
        "Mark Rutland" <mark.rutland@....com>,
        "Catalin Marinas" <catalin.marinas@....com>, dennis@...nel.org,
        "Tejun Heo" <tj@...nel.org>, "Christoph Lameter" <cl@...ux.com>,
        "Heiko Carstens" <hca@...ux.ibm.com>, gor@...ux.ibm.com,
        "Alexander Gordeev" <agordeev@...ux.ibm.com>,
        borntraeger@...ux.ibm.com, "Sven Schnelle" <svens@...ux.ibm.com>,
        "Thomas Gleixner" <tglx@...utronix.de>,
        "Ingo Molnar" <mingo@...hat.com>, "Borislav Petkov" <bp@...en8.de>,
        "Dave Hansen" <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, "Joerg Roedel" <joro@...tes.org>,
        suravee.suthikulpanit@....com,
        "Robin Murphy" <robin.murphy@....com>,
        "David Woodhouse" <dwmw2@...radead.org>,
        "Baolu Lu" <baolu.lu@...ux.intel.com>,
        "Herbert Xu" <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        "Pekka Enberg" <penberg@...nel.org>,
        "David Rientjes" <rientjes@...gle.com>,
        "Joonsoo Kim" <iamjoonsoo.kim@....com>,
        "Andrew Morton" <akpm@...ux-foundation.org>,
        "Vlastimil Babka" <vbabka@...e.cz>,
        "Roman Gushchin" <roman.gushchin@...ux.dev>,
        "Hyeonggon Yoo" <42.hyeyoo@...il.com>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-s390@...r.kernel.org, iommu@...ts.linux.dev,
        Linux-Arch <linux-arch@...r.kernel.org>,
        linux-crypto@...r.kernel.org,
        "Stephen Rothwell" <sfr@...b.auug.org.au>,
        "Michael Ellerman" <mpe@...erman.id.au>,
        "James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
        "Helge Deller" <deller@....de>, linux-parisc@...r.kernel.org
Subject: Re: [PATCH 07/12] percpu: #ifndef __SIZEOF_INT128__

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ