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]
Date:   Fri, 9 Apr 2021 14:03:46 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     David Malcolm <dmalcolm@...hat.com>
Cc:     Ard Biesheuvel <ardb@...nel.org>, linux-toolchains@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Jason Baron <jbaron@...mai.com>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>
Subject: Re: static_branch/jump_label vs branch merging

On Fri, Apr 09, 2021 at 07:55:42AM -0400, David Malcolm wrote:
> On Fri, 2021-04-09 at 13:12 +0200, Peter Zijlstra wrote:
> > On Fri, Apr 09, 2021 at 11:57:22AM +0200, Ard Biesheuvel wrote:
> > > On Thu, 8 Apr 2021 at 18:53, Peter Zijlstra <peterz@...radead.org>
> > > wrote:
> > 
> > > > Is there *any* way in which we can have the compiler recognise
> > > > that the
> > > > asm_goto only depends on its arguments and have it merge the
> > > > branches
> > > > itself?
> > > > 
> > > > I do realize that asm-goto being volatile this is a fairly huge
> > > > ask, but
> > > > I figured I should at least raise the issue, if only to raise
> > > > awareness.
> > > > 
> > > 
> > > Wouldn't that require the compiler to interpret the contents of the
> > > asm() block?
> > 
> > Yeah, this is more or less asking for ponies :-) One option would be
> > some annotation that conveys the desired semantics without it having
> > to
> > untangle the mess in the asm block.
> > 
> > The thing the compiler needs to know is that the branch is constant
> > for
> > any @key, and hence allow the obvious optimizations. I'm not sure if
> > this is something compiler folks would be even willing to consider,
> > but
> > I figured asking never hurts.
> > 
> 
> Sorry if this is a dumb question, but does the function attribute:
>   __attribute__ ((pure)) 
> help here?  It's meant to allow multiple calls to a predicate to be
> merged - though I'd be nervous of using it here, the predicate isn't
> 100% pure, since AIUI the whole point of what you've built is for
> predicates that very rarely change - but can change occasionally.

I actually tried that, but it doesn't seem to work. Given the function
arguments are all compile time constants it should DTRT AFAICT, but
alas.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ