lkml.org 
[lkml]   [2018]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/7] x86,nospec: Annotate indirect calls/jumps
From
Date


On Thu, 2018-02-01 at 15:34 +0100, Peter Zijlstra wrote:
>
>   * These are the bare retpoline primitives for indirect jmp and call.
>   * Do not use these directly; they only exist to make the ALTERNATIVE
>   * invocation below less ugly.
> @@ -102,9 +114,9 @@
>  .macro JMP_NOSPEC reg:req
>  #ifdef CONFIG_RETPOLINE
>         ANNOTATE_NOSPEC_ALTERNATIVE
> -       ALTERNATIVE_2 __stringify(jmp *\reg),                           \
> +       ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *\reg),  \
>                 __stringify(RETPOLINE_JMP \reg), X86_FEATURE_RETPOLINE, \
> -               __stringify(lfence; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
> +               __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; jmp *\reg), X86_FEATURE_RETPOLINE_AMD
>  #else
>         jmp     *\reg
>  #endif

The first one, yes. But the second one for the AMD retpoline is
redundant, isn't it? Objtool isn't going to look there.[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2018-02-01 15:55    [W:0.182 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site