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] [day] [month] [year] [list]
Date:   Fri, 31 Aug 2018 23:35:08 +0300
From:   Igor Stoppa <igor.stoppa@...il.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        igor.stoppa@...wei.com, Aaro Koskinen <aaro.koskinen@....fi>,
        Alasdair Kergon <agk@...hat.com>,
        Al Viro <viro@...iv.linux.org.uk>,
        Andrew Jeffery <andrew@...id.au>,
        Archit Taneja <architt@...eaurora.org>, asolokha@...kras.ru,
        bvanassche@....org,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        chien.tin.tung@...el.com, chunkeey@...glemail.com,
        Christoph Lameter <cl@...ux.com>,
        David Airlie <airlied@...ux.ie>,
        David Daney <ddaney@...iumnetworks.com>,
        Dennis Zhou <dennisszhou@...il.com>, dima@...sta.com,
        Doug Ledford <dledford@...hat.com>,
        "Latif, Faisal" <faisal.latif@...el.com>,
        gregkh <gregkh@...uxfoundation.org>,
        Daode Huang <huangdaode@...ilicon.com>,
        Inaky Perez-Gonzalez <inaky.perez-gonzalez@...el.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        James Hogan <jhogan@...nel.org>,
        Jason Gunthorpe <jgg@...pe.ca>, ejt@...hat.com,
        Kalle Valo <kvalo@...eaurora.org>,
        Kees Cook <keescook@...omium.org>,
        Larry Finger <Larry.Finger@...inger.net>,
        Linus Walleij <linus.walleij@...aro.org>,
        Madalin-Cristian Bucur <madalin.bucur@....com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        "Michael S. Tsirkin" <mst@...hat.com>, michal.kazior@...to.com,
        Mike Snitzer <snitzer@...hat.com>,
        Paul Burton <paul.burton@...s.com>,
        Paul Mackerras <paulus@...ba.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Rob Clark <robdclark@...il.com>, rolandd@...co.com,
        Salil Mehta <salil.mehta@...wei.com>,
        Shuah Khan <shuah@...nel.org>,
        srivatsa.bhat@...ux.vnet.ibm.com, sviau@...eaurora.org,
        Tejun Heo <tj@...nel.org>, yisen.zhuang@...wei.com,
        zijun_hu@....com
Subject: Re: [PATCH 00/23] Make use of unlikely() more consistently.

On 31/08/18 17:09, Arnd Bergmann wrote:

[...]

>> #define assert(condition)
>> ...
>>          if (unlikely(!(condition)))
>>                  error_action()
>> ...
> 
> There is a potential that this introduces false-postive -Wmaybe-uninitialized
> warnings when CONFIG_PROFILE_ANNOTATED_BRANCHES is
> set, since that turns unlikely() into a complex operation that in turn
> confuses the compiler so it no longer keeps track of which variables
> are initialized or not.
> 
> It's possible that none of your patches do that, but one needs to be aware
> of the problem, and possibly revert some of your patches if it does cause
> warning regressions in drivers that don't actually benefit from the
> micro-optimization.

I see.
But if such case might arise, it might be possible, instead of reverting 
these patches, to locally - and conditionally - turn unlikely() into an 
identity macro.

For example:

#ifdef CONFIG_PROFILE_ANNOTATOED_BRANCHES
#define unlikely(x) (x)
#endif

Without giving up the hint for the case of normal compilation.

--
igor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ