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] [day] [month] [year] [list]
Message-ID: <20181201102329.GD11614@hirez.programming.kicks-ass.net>
Date:   Sat, 1 Dec 2018 11:23:29 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Andrea Parri <andrea.parri@...rulasolutions.com>
Cc:     linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
        Palmer Dabbelt <palmer@...ive.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Will Deacon <will.deacon@....com>,
        Boqun Feng <boqun.feng@...il.com>
Subject: Re: [PATCH] riscv, atomic: Add #define's for the
 atomic_{cmp,}xchg_*() variants

On Sat, Dec 01, 2018 at 01:01:56AM +0100, Andrea Parri wrote:
> If an architecture does not define the atomic_{cmp,}xchg_*() variants,
> the generic implementation defaults them to the fully-ordered version.
> 
> riscv's had its own variants since "the beginning", but it never told
> (#define-d these for) the generic implementation: it is time to do so.
> 
> Signed-off-by: Andrea Parri <andrea.parri@...rulasolutions.com>
> Cc: Palmer Dabbelt <palmer@...ive.com>
> Cc: Albert Ou <aou@...s.berkeley.edu>
> Cc: Will Deacon <will.deacon@....com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Boqun Feng <boqun.feng@...il.com>

Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>

> ---
>  arch/riscv/include/asm/atomic.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h
> index c452359c9cb8a..93826771b616a 100644
> --- a/arch/riscv/include/asm/atomic.h
> +++ b/arch/riscv/include/asm/atomic.h
> @@ -303,6 +303,15 @@ c_t atomic##prefix##_cmpxchg(atomic##prefix##_t *v, c_t o, c_t n)	\
>  
>  ATOMIC_OPS()
>  
> +#define atomic_xchg_relaxed atomic_xchg_relaxed
> +#define atomic_xchg_acquire atomic_xchg_acquire
> +#define atomic_xchg_release atomic_xchg_release
> +#define atomic_xchg atomic_xchg
> +#define atomic_cmpxchg_relaxed atomic_cmpxchg_relaxed
> +#define atomic_cmpxchg_acquire atomic_cmpxchg_acquire
> +#define atomic_cmpxchg_release atomic_cmpxchg_release
> +#define atomic_cmpxchg atomic_cmpxchg
> +
>  #undef ATOMIC_OPS
>  #undef ATOMIC_OP
>  
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ