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: <2fbe86b7-70f0-46cd-b7b7-9d67e78d72f3@paulmck-laptop>
Date: Tue, 4 Jun 2024 14:14:06 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-team@...a.com, elver@...gle.com, akpm@...ux-foundation.org,
	tglx@...utronix.de, peterz@...radead.org, dianders@...omium.org,
	pmladek@...e.com, torvalds@...ux-foundation.org, arnd@...db.de,
	Mark Brown <broonie@...nel.org>,
	Naresh Kamboju <naresh.kamboju@...aro.org>,
	Nathan Chancellor <nathan@...nel.org>,
	"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
	Andrew Davis <afd@...com>, Eric DeVolder <eric.devolder@...cle.com>,
	Rob Herring <robh@...nel.org>, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 cmpxchg 4/4] ARM: Emulate one-byte cmpxchg

On Tue, Jun 04, 2024 at 10:52:23PM +0200, Linus Walleij wrote:
> Hi Paul,
> 
> thanks for your patch! This caught my eye:
> 
> On Tue, Jun 4, 2024 at 7:04 PM Paul E. McKenney <paulmck@...nel.org> wrote:
> 
> > Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on ARM systems
> > with ARCH < ARMv6K.
> 
> ARCH == ARMv6.
> 
> This ARCH < ARMv6K comes from inversion of the the a bit terse
> comment for ifndef CONFIG_CPU_V6, which means "out of the
> post-v6 CPUs, the following applies to those > V6".
> 
> The code in the patch, IIUC make use of cmpxchg_emu_u8()
> if and only if the CPU is V6.
> 
> > -#ifndef CONFIG_CPU_V6  /* min ARCH >= ARMv6K */
> > +#ifdef CONFIG_CPU_V6   /* min ARCH < ARMv6K */
> 
> This is now a set with one member so this comment should say:
> 
> /* ARCH == ARMv6 */
> 
> After this change.

Thank you for looking this over!  Does the following patch (to be merged
into the original) capture it properly?

							Thanx, Paul

------------------------------------------------------------------------

diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
index a428e06fe94ee..9beb64d305866 100644
--- a/arch/arm/include/asm/cmpxchg.h
+++ b/arch/arm/include/asm/cmpxchg.h
@@ -163,11 +163,11 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 	prefetchw((const void *)ptr);
 
 	switch (size) {
-#ifdef CONFIG_CPU_V6	/* min ARCH < ARMv6K */
+#ifdef CONFIG_CPU_V6	/* ARCH == ARMv6 */
 	case 1:
 		oldval = cmpxchg_emu_u8((volatile u8 *)ptr, old, new);
 		break;
-#else /* min ARCH >= ARMv6K */
+#else /* min ARCH > ARMv6 */
 	case 1:
 		do {
 			asm volatile("@ __cmpxchg1\n"

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ