From: Andi Kleen <ak@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: fix bpf side of SSB
Date: Mon, 21 May 2018 13:35:56 -0700 [thread overview]
Message-ID: <20180521203556.GH4486@tassilo.jf.intel.com> (raw)
In-Reply-To: <20180520153714.qegrchfomqe7dhw6@ast-mbp>
> My understanding that retpoline is a stronger version of lfence
> (since it has pause+lfence speculative loop which cpu always takes).
> In my microbenchmarks retpoline is 20+ cycles whereas indirect jmp
> is 1 cycle. These extra cycles cpu spends in undoing speculative
> jmp + pause + lfence.
Micro benchmarks are very difficult for these things because
it depends on many factors in the pipeline.
It's better to measure it directly in a larger context with
timed lbrs if you can.
> So anything that is being called via indirect jmp is essentially
> being lfenced before execution reaches the callee function.
Yes that is true.
But random lfences do not really help with SSB, you would
lfences placed between the specific loads and stores.
-Andi
prev parent reply other threads:[~2018-05-21 20:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 22:07 [MODERATED] fix bpf side of SSB Alexei Starovoitov
2018-05-19 19:13 ` Thomas Gleixner
2018-05-19 23:57 ` [MODERATED] " Alexei Starovoitov
2018-05-20 7:04 ` Thomas Gleixner
2018-05-20 15:37 ` [MODERATED] " Alexei Starovoitov
2018-05-20 17:00 ` Linus Torvalds
2018-05-21 20:35 ` Andi Kleen [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=20180521203556.GH4486@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--cc=speck@linutronix.de \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).