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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHirt9hLATcnSw9HXSo-TZ+buNHJXJvFtJEy56_Bi+mOfckNjw@mail.gmail.com>
Date:   Thu, 29 Jul 2021 20:31:11 +0800
From:   hev <r@....cc>
To:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc:     Rui Wang <wangrui@...ngson.cn>,
        Peter Zijlstra <peterz@...radead.org>,
        Will Deacon <will@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>,
        linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org
Subject: Re: [RFC PATCH] locking/atomic: arch/mips: Fix atomic{_64,}_sub_if_positive

Hi, Thomas,

On Thu, Jul 29, 2021 at 5:53 PM Thomas Bogendoerfer
<tsbogend@...ha.franken.de> wrote:
>
> On Thu, Jul 29, 2021 at 04:25:49PM +0800, Rui Wang wrote:
> > This looks like a typo and that caused atomic64 test failed.
> >
> > Signed-off-by: Rui Wang <wangrui@...ngson.cn>
> > Signed-off-by: hev <r@....cc>
> > ---
> >  arch/mips/include/asm/atomic.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
> > index 95e1f7f3597f..a0b9e7c1e4fc 100644
> > --- a/arch/mips/include/asm/atomic.h
> > +++ b/arch/mips/include/asm/atomic.h
> > @@ -206,7 +206,7 @@ ATOMIC_OPS(atomic64, xor, s64, ^=, xor, lld, scd)
> >   * The function returns the old value of @v minus @i.
> >   */
> >  #define ATOMIC_SIP_OP(pfx, type, op, ll, sc)                         \
> > -static __inline__ int arch_##pfx##_sub_if_positive(type i, pfx##_t * v)      \
> > +static __inline__ type arch_##pfx##_sub_if_positive(type i, pfx##_t * v)     \
> >  {                                                                    \
> >       type temp, result;                                              \
> >                                                                       \
>
> sub_if_postive looks unused to me. Could you send a patch removing it
> instead ? riscv also has a sub_if_positive implementation, which looks
> unused.
I found atomic{_64,}_dec_if_postive is based on sub_if_postive, and
used in many places:

kernel/kmod.c:    if (atomic_dec_if_positive(&kmod_concurrent_max) < 0) {
kernel/kmod.c:
atomic_dec_if_positive(&kmod_concurrent_max) >= 0,
kernel/module.c:        ret = atomic_dec_if_positive(&module->refcnt);
...
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:
atomic64_dec_if_positive(&esw->user_count);
drivers/net/netdevsim/fib.c:        atomic64_dec_if_positive(&entry->num);
drivers/net/netdevsim/fib.c:        atomic64_dec_if_positive(&entry->num);

Are you sure to remove it?

Regards,
Rui

>
> Thomas.
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ