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  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:   Sun, 31 May 2020 06:41:41 +0530
From:   Syed Nayyar Waris <>
To:     Andy Shevchenko <>
Cc:     Andy Shevchenko <>,
        Linus Walleij <>,
        Andrew Morton <>,
        William Breathitt Gray <>,
        Arnd Bergmann <>,
        Linux-Arch <>,
        Linux Kernel Mailing List <>
Subject: Re: [PATCH v7 1/4] bitops: Introduce the the for_each_set_clump macro

On Sat, May 30, 2020 at 2:50 PM Andy Shevchenko
<> wrote:
> On Sat, May 30, 2020 at 11:45 AM Syed Nayyar Waris <> wrote:
> > On Sat, May 30, 2020 at 3:49 AM Andy Shevchenko
> > <> wrote:
> ...
> > I am still investigating more on this. Let me know if you have any suggestions.
> As far as I understand the start pointers are implementations of abs()
> macro followed by min()/max().
> I think in the latter case it's actually something which might help here.
> Sorry, right now I have no time to dive deeper.

No Problem. Thank you for sharing your initial pointers.

By the way, as I was working on it I found a way to avoid comparison
with '0' in '__builtin_constant_p'. And because of this, no
compilation warnings are getting produced.

Change the following:

#define GENMASK_INPUT_CHECK(h, l) \
        (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
                __builtin_constant_p((l) > (h)), (l) > (h), 0)))

To this:

#if (l) == 0
#define GENMASK_INPUT_CHECK(h, l)  0
#define GENMASK_INPUT_CHECK(h, l) \
        (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
                __builtin_constant_p((l) > (h)), (l) > (h), 0)))

I have verified that this works. Basically this just avoids the sanity
check when the 'lower' bound 'l' is zero. Let me know if it looks

Regarding min, max macro that you suggested I am also looking further into it.

Syed Nayyar Waris

Powered by blists - more mailing lists