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:   Thu, 5 Jul 2018 10:58:08 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Will Deacon <will.deacon@....com>
Cc:     linux-kernel@...r.kernel.org, peterz@...radead.org,
        boqun.feng@...il.com, Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCHv2 11/11] arm64: use instrumented atomics

On Wed, Jul 04, 2018 at 06:41:34PM +0100, Will Deacon wrote:
> On Wed, Jul 04, 2018 at 05:37:23PM +0100, Mark Rutland wrote:
> > On Wed, Jul 04, 2018 at 04:24:22PM +0100, Will Deacon wrote:
> > > This is mostly straightforward, but the cmpxchg/cmpxchg_double cases grow
> > > an 'arch' prefix which suggests that they're part of the API with the core
> > > atomics and also makes them horribly ugly.
> > 
> > I agree this isn't nice.
> > 
> > > This just looks to be an artifact of __LL_SC_CALL pasting that in. Can
> > > you drop that auto pasting of 'arch', and instead change the
> > > non-cmpxchg-case callers of the macro to include the arch prefix
> > > instead, please?
> > 
> > That leads to having an arch___llsc_ prefix in some cases, which is
> > equally hideous.
> 
> Yuck, how does that come about?
> 
> > How about I remove the prefix mangling entirely, and always give
> > functions an __llsc_ or __lse_ prefix. Then, unify the two in our
> > atomic.h with:
> > 
> > #ifdef CONFIG_ARM64_LSE
> > #define ATOMIC_PFX	__lse_
> > #else
> > #define ATOMIC_PFX	__ll_sc_
> > #endif
> > 
> > #define arch_atomic_foo		ATOMIC_PFX##atomic_foo
> > #define arch_atomic_bar		ATOMIC_PFX##atomic_bar
> > 
> > ... which clearly delineates the implementation from core API.
> > 
> > Does that sound ok to you?
> 
> Why do we need two prefixes? The only reason we throw out __ll_sc_ at the
> moment is so the out-of-line atomics have a different name from the inlined
> ones. What I'd like is:
> 
> 	atomic_foo
> 	-> arch_atomic_foo
> 	   -> optionally calls __ll_sc_arch_atomic_foo
> 
> which I think is very similar to what we already do (i.e. the inlined macro
> is always called arch_atomic_foo, regardless of lse or ll/sc).

Sure; so long as you're happy with __ll_sc_arch_atomic_foo, that works.

I'll rework things to that effect for v3.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ