From: Peter Zijlstra <peterz@infradead.org>
To: Waiman Long <longman@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Tim Chen <tim.c.chen@linux.intel.com>,
Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case
Date: Fri, 7 Dec 2018 09:52:09 +0100 [thread overview]
Message-ID: <20181207085209.GB2237@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <3732de84-a14f-e32a-61de-29c5965dd405@redhat.com>
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?
next prev parent reply other threads:[~2018-12-07 8:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 19:49 [PATCH 1/2] x86/speculation: Change STIPB to STIBP Waiman Long
2018-12-05 19:49 ` [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case Waiman Long
2018-12-06 8:41 ` Peter Zijlstra
2018-12-06 15:38 ` Waiman Long
2018-12-07 8:52 ` Peter Zijlstra [this message]
2018-12-07 9:33 ` Thomas Gleixner
2018-12-06 11:06 ` [tip:x86/pti] x86/speculation: Change misspelled STIPB to STIBP tip-bot for Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181207085209.GB2237@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox