mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Jason Baron <jbaron@akamai.com>
Cc: Ingo Molnar <mingo@kernel.org>, x86-ml <x86@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH] Flipped jump labels
Date: Mon, 11 Aug 2014 10:42:58 +0200	[thread overview]
Message-ID: <20140811084258.GA4236@nazgul.tnic> (raw)
In-Reply-To: <53E8394F.4020600@akamai.com>

On Sun, Aug 10, 2014 at 11:32:31PM -0400, Jason Baron wrote:
> That is correct. We don't currently support having the default
> branch direction or the fast path be different from how the
> 'static_key' is initialized.
> 
> If I understand your use-case correctly,  you can't have the tsc
> path be the default *before* tsc_init() is called?

Yes. And also have it come first in the function so that after nopping
out the JMP later turns it into a 0-cost path.

> If not, another thought on the implementation here might be
> to re-visit the work the Steven Rostedt  proposed a while back,
> to use jump instead of no-ops by default, and then convert
> the jumps to no-ops in a post-processing phase in order to
> reduce code size (by having 2-byte jumps for example on
> x86). Potentially, we could then avoid converting some of the
> jumps, if they didn't match the default branch direction.
> See: http://www.serverphorums.com/read.php?12,759207

Haha, so I did a very similar thing too, independently from Steve (patch
at the end):

https://lkml.kernel.org/r/20140809105742.GA5910@pd.tnic

but mine is dumber.

I'll dig out Steve's version and play with it a bit.

> In that way there is no API change, we are just relaxing the
> restriction that the default branch direction must match the
> way that the keys are initialized.

Which would make the change even smaller and invisible to users, good!

Thanks.

      reply	other threads:[~2014-08-11  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09 10:57 Borislav Petkov
2014-08-10  6:11 ` Ingo Molnar
2014-08-10  6:13   ` Ingo Molnar
2014-08-10 15:35     ` Borislav Petkov
2014-08-10 15:45       ` Ingo Molnar
2014-08-10 16:07         ` Borislav Petkov
2014-08-11  3:32           ` Jason Baron
2014-08-11  8:42             ` Borislav Petkov [this message]

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=20140811084258.GA4236@nazgul.tnic \
    --to=bp@alien8.de \
    --cc=akpm@linux-foundation.org \
    --cc=jbaron@akamai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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

all inboxes | Powered by JetHome®