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]
Date:   Wed, 25 Oct 2023 12:32:29 +0200
From:   John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>
To:     Mark Rutland <mark.rutland@....com>,
        Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        "wuqiang . matt" <wuqiang.matt@...edance.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-sh@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-trace-kernel@...r.kernel.org,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: Re: [PATCH] locking/atomic: sh: Use generic_cmpxchg_local for
 arch_cmpxchg_local()

On Wed, 2023-10-25 at 11:30 +0100, Mark Rutland wrote:
> On Wed, Oct 25, 2023 at 08:42:55AM +0900, Masami Hiramatsu wrote:
> > On Tue, 24 Oct 2023 16:08:12 +0100
> > Mark Rutland <mark.rutland@....com> wrote:
> > 
> > > On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google) wrote:
> > > > From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> > > > 
> > > > Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation
> > > > in SH architecture because it does not implement arch_cmpxchg_local().
> > > 
> > > I do not think this is correct.
> > > 
> > > The implementation in <asm-generic/cmpxchg-local.h> is UP-only (and it only
> > > disables interrupts), whereas arch/sh can be built SMP. We should probably add
> > > some guards into <asm-generic/cmpxchg-local.h> for that as we have in
> > > <asm-generic/cmpxchg.h>.
> > 
> > Isn't cmpxchg_local for the data which only needs to ensure to do cmpxchg
> > on local CPU?
> > So I think it doesn't care about the other CPUs (IOW, it should not touched by
> > other CPUs), so it only considers UP case. E.g. on x86, arch_cmpxchg_local() is
> > defined as raw "cmpxchg" without lock prefix.
> > 
> > #define __cmpxchg_local(ptr, old, new, size)                            \
> >         __raw_cmpxchg((ptr), (old), (new), (size), "")
> > 
> 
> Yes, you're right; sorry for the noise.
> 
> For your original patch:
> 
> Acked-by: Mark Rutland <mark.rutland@....com>
> 

Geert, what's your opinion on this?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Powered by blists - more mailing lists