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 Apr 2018 09:43:40 -0700
From:   Linus Torvalds <>
To:     Peter Zijlstra <>
Cc:     Matthias Kaehlcke <>,
        Arnd Bergmann <>, Ingo Molnar <>,
        Linux Kernel Mailing List <>,
        Thomas Gleixner <>,
        Andrew Morton <>,
        James Y Knight <>,
        Chandler Carruth <>,
        Stephen Hines <>,
        Nick Desaulniers <>,
        Kees Cook <>,
        Guenter Roeck <>,
        Greg Hackmann <>,
        Greg Kroah-Hartman <>
Subject: Re: [GIT PULL] x86/build changes for v4.17

On Thu, Apr 5, 2018 at 12:24 AM, Peter Zijlstra <> wrote:
> I always assumed BT was a more expensive instruction than AND with
> immediate.

Oh, absolutely. That's why we do all those "depending on immediate or not".

The reason I brought that case up is that "test_bit()" and "set_bit()"
do this "is it constant" test COMPLETELY DIFFERENTLY.

The test_bit() one is arguably much more legible, and easier to
understand. And it so happens that clang will see that it's constant
because it's a macro (well, unless that macro is then used in an
inline function).

The set_bit() pattern looks completely different, and doesn't have
that abstraction of "constant_set_bit()" vs "variable_set_bit()", like
test_bit() does.

THAT was why I pointed it out - we do different things otherwise
similar operations.

Not because it would be odd that we do different things for the
"constant bit number" vs "variable bit number".


Powered by blists - more mailing lists