lkml.org 
[lkml]   [2020]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 6/7] x86/retpoline: Out-of-line retpoline

Bah, chunks went missing, I'll make sure to push out a working version.

On Thu, Apr 16, 2020 at 05:07:58PM +0200, Peter Zijlstra wrote:
> --- a/arch/x86/lib/retpoline.S
> +++ b/arch/x86/lib/retpoline.S
> @@ -7,15 +7,30 @@
> #include <asm/alternative-asm.h>
> #include <asm/export.h>
> #include <asm/nospec-branch.h>
> +#include <asm/unwind_hints.h>
> +#include <asm/frame.h>
>
> .macro THUNK reg
> .section .text.__x86.indirect_thunk
>
> + .align 32
> SYM_FUNC_START(__x86_indirect_thunk_\reg)
> - CFI_STARTPROC
> - JMP_NOSPEC %\reg
> - CFI_ENDPROC
> + JMP_NOSPEC \reg
> SYM_FUNC_END(__x86_indirect_thunk_\reg)
> +
> +SYM_FUNC_START_NOALIGN(__x86_retpoline_\reg)
> + ANNOTATE_INTRA_FUNCTION_CALL
> + call .Ldo_rop_\@
> +.Lspec_trap_\@:
UNWIND_HINT_EMPTY
> + pause
> + lfence
> + jmp .Lspec_trap_\@
> +.Ldo_rop_\@:
> + mov %\reg, (%_ASM_SP)
> + UNWIND_HINT_RET_OFFSET
> + ret
> +SYM_FUNC_END(__x86_retpoline_\reg)
> +
> .endm
>
> /*

\
 
 \ /
  Last update: 2020-04-16 17:40    [W:1.657 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site