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] [day] [month] [year] [list]
Message-ID: <d702acea-0aac-abc3-c48e-21f0e44d5870@gmail.com>
Date:   Mon, 10 Sep 2018 12:45:03 +0300
From:   Igor Stoppa <igor.stoppa@...il.com>
To:     Paul Burton <paul.burton@...s.com>
Cc:     David Daney <ddaney@...iumnetworks.com>,
        Igor Stoppa <igor.stoppa@...wei.com>,
        Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>, linux-mips@...ux-mips.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mips: bug: add unlikely() to BUG_ON()

Hi Paul,

On 08/09/18 01:02, Paul Burton wrote:

> I'm not sure this will actually do anything.
> 
> __BUG_ON() doesn't use the value of its condition argument for regular
> control flow unless it's compile-time constant anyway, in which case
> unlikely() should be redundant because the compiler knows the value
> already.
> 
> If the condition isn't compile-time constant then we just emit a tne
> (trap-if-not-equal) instruction using inline asm. That will generate an
> exception if the value is non-zero at runtime. I don't see how adding
> unlikely() is going to help the compiler do anything differently with
> that.

Thank you for the explanation. Please discard this patch.

--
igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ