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]
Message-ID: <20210312043057.GA137474@yury-ThinkPad>
Date:   Thu, 11 Mar 2021 20:30:57 -0800
From:   Yury Norov <yury.norov@...il.com>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     linux-kernel@...r.kernel.org, linux-m68k@...ts.linux-m68k.org,
        linux-arch@...r.kernel.org, linux-sh@...r.kernel.org,
        Alexey Klimov <aklimov@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Arnd Bergmann <arnd@...db.de>, David Sterba <dsterba@...e.com>,
        Dennis Zhou <dennis@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Jianpeng Ma <jianpeng.ma@...el.com>,
        Joe Perches <joe@...ches.com>,
        John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Rich Felker <dalias@...c.org>,
        Stefano Brivio <sbrivio@...hat.com>,
        Wei Yang <richard.weiyang@...ux.alibaba.com>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: Re: [PATCH 04/14] lib: introduce BITS_{FIRST,LAST} macro

On Thu, Feb 18, 2021 at 11:51:43PM +0100, Rasmus Villemoes wrote:
> On 18/02/2021 05.05, Yury Norov wrote:
> > BITMAP_{LAST,FIRST}_WORD_MASK() in linux/bitmap.h duplicates the
> > functionality of GENMASK(). The scope of there macros is wider
> > than just bitmap. This patch defines 4 new macros: BITS_FIRST(),
> > BITS_LAST(), BITS_FIRST_MASK() and BITS_LAST_MASK() in linux/bits.h
> > on top of GENMASK() and replaces BITMAP_{LAST,FIRST}_WORD_MASK()
> > to avoid duplication and increase the scope of the macros.
> > 
> 
> Please include some info on changes in generated code, if any. When the
> parameter to the macro is a constant I'm sure it all folds to a
> compile-time constant either way, but when it's not, I'm not sure gcc
> can do the same optimizations when the expressions become more complicated.

After applying all patches till "tools: introduce SMALL_CONST() macro",
there's no visible changes in code generation:

scripts/bloat-o-meter vmlinux.before vmlinux
add/remove: 1/2 grow/shrink: 2/0 up/down: 17/-16 (1)
Function                                     old     new   delta
ethtool_get_drvinfo                          900     908      +8
e843419@...2_0001309d_7f0                      -       8      +8
vermagic                                      48      49      +1
e843419@...5_000138bb_f68                      8       -      -8
e843419@...9_00012bce_198c                     8       -      -8
Total: Before=26092016, After=26092017, chg +0.00%

The build is arm64, and the compilerr is:
aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ