mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: x86@kernel.org, tony.luck@intel.com, pjt@google.com
Cc: linux-kernel@vger.kernel.org, r.marek@assembler.cz,
	jpoimboe@redhat.com, jikos@kernel.org
Subject: Re: [RFC][PATCH 1/2] x86/retpoline: Simplify retpolines
Date: Mon, 22 Feb 2021 12:36:43 +0100	[thread overview]
Message-ID: <YDOXSw2vNLzRNdPN@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210218172151.835108198@infradead.org>

On Thu, Feb 18, 2021 at 05:59:39PM +0100, Peter Zijlstra wrote:
> Currently out retpolines consist of 2 symbols,
> __x86_indirect_thunk_\reg, which is the compiler target, and
> __x86_retpoline_\reg, which is the actual retpoline. Both are
> consecutive in code and aligned such that for any one register they
> both live in the same cacheline:
> 
>   0000000000000000 <__x86_indirect_thunk_rax>:
>    0:   ff e0                   jmpq   *%rax
>    2:   90                      nop
>    3:   90                      nop
>    4:   90                      nop
> 
>   0000000000000005 <__x86_retpoline_rax>:
>    5:   e8 07 00 00 00          callq  11 <__x86_retpoline_rax+0xc>
>    a:   f3 90                   pause
>    c:   0f ae e8                lfence
>    f:   eb f9                   jmp    a <__x86_retpoline_rax+0x5>
>   11:   48 89 04 24             mov    %rax,(%rsp)
>   15:   c3                      retq
>   16:   66 2e 0f 1f 84 00 00 00 00 00   nopw   %cs:0x0(%rax,%rax,1)
> 
> The thunk is an alternative_2, where one option is a jmp to the
> retpoline.

So the reason I originally did that was because objtool could not deal
with alternatives with stack ops. But we've recently fixed that.

  reply	other threads:[~2021-02-22 11:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 16:59 [RFC][PATCH 0/2] x86/retpoline: Retpoline on a diet Peter Zijlstra
2021-02-18 16:59 ` [RFC][PATCH 1/2] x86/retpoline: Simplify retpolines Peter Zijlstra
2021-02-22 11:36   ` Peter Zijlstra [this message]
2021-02-18 16:59 ` [RFC][PATCH 2/2] x86/retpoline: Compress retpolines Peter Zijlstra
2021-02-19  7:14   ` Borislav Petkov
2021-02-22 11:27     ` Peter Zijlstra
2021-02-18 18:46 ` [RFC PATCH] x86/retpolines: Prevent speculation after RET Borislav Petkov
2021-02-18 19:02   ` Peter Zijlstra
2021-02-18 19:11     ` Borislav Petkov
2021-02-19  8:15       ` Peter Zijlstra
2021-02-19 12:08         ` Andrew Cooper
2021-02-19  9:28     ` David Laight

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=YDOXSw2vNLzRNdPN@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjt@google.com \
    --cc=r.marek@assembler.cz \
    --cc=tony.luck@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

Powered by JetHome