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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 7 Dec 2018 09:52:09 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the
 likely case

On Thu, Dec 06, 2018 at 10:38:00AM -0500, Waiman Long wrote:
> On 12/06/2018 03:41 AM, Peter Zijlstra wrote:
> > On Wed, Dec 05, 2018 at 02:49:28PM -0500, Waiman Long wrote:
> >> Since conditional STIBP is the default, it should be treated as
> >> the likely case. Changes the use of static_branch_unlikely() to
> >> static_branch_likely() for switch_to_cond_stibp.
> > So now you're making kernels on 'fixed' or unaffected hardware slower.
> 
> Good point.
> 
> The reason I sent out this patch is because of the inconsistency in the
> use of likely/unlikely hints.
> 
> arch/x86/kernel/cpu/bugs.c:156:        if
> (static_branch_unlikely(&switch_to_cond_stibp))
> arch/x86/kernel/process.c:440:       
> static_branch_unlikely(&switch_to_cond_stibp)) {
> arch/x86/kernel/process.h:26:        if
> (!static_branch_likely(&switch_to_cond_stibp)) {
> 
> So if we are aiming to optimize for "fixed" or unaffected hardware,
> maybe we should modify the likely hint to unlikely then.

Right, I think that makes sense, Thomas?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ