x86: Prepare inline-asm for straight-line-speculation

Replace all ret/retq instructions with ASM_RET in preparation of
making it more than a single instruction.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211204134907.964635458@infradead.org
This commit is contained in:
Peter Zijlstra
2021-12-04 14:43:41 +01:00
committed by Borislav Petkov
parent f94909ceb1
commit b17c2baa30
11 changed files with 19 additions and 14 deletions

View File

@ -31,7 +31,7 @@ asm (
" call my_direct_func1\n"
" leave\n"
" .size my_tramp1, .-my_tramp1\n"
" ret\n"
ASM_RET
" .type my_tramp2, @function\n"
" .globl my_tramp2\n"
" my_tramp2:"
@ -39,7 +39,7 @@ asm (
" movq %rsp, %rbp\n"
" call my_direct_func2\n"
" leave\n"
" ret\n"
ASM_RET
" .size my_tramp2, .-my_tramp2\n"
" .popsection\n"
);

View File

@ -31,7 +31,7 @@ asm (
" popq %rsi\n"
" popq %rdi\n"
" leave\n"
" ret\n"
ASM_RET
" .size my_tramp, .-my_tramp\n"
" .popsection\n"
);

View File

@ -25,7 +25,7 @@ asm (
" call my_direct_func\n"
" popq %rdi\n"
" leave\n"
" ret\n"
ASM_RET
" .size my_tramp, .-my_tramp\n"
" .popsection\n"
);