lkml.org 
[lkml]   [2021]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/2] x86/retpoline: Simplify retpolines
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.

\
 
 \ /
  Last update: 2021-02-22 12:39    [W:0.079 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site