lkml.org 
[lkml]   [2018]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v6 02/10] x86/retpoline/crypto: Convert crypto assembler indirect jumps
On Sun, Jan 07, 2018 at 10:11:17PM +0000, David Woodhouse wrote:
> Convert all indirect jumps in crypto assembler code to use non-speculative
> sequences when CONFIG_RETPOLINE is enabled.
>
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> Acked-By: Arjan van de Ven <arjan@linux.intel.com>
> ---
> arch/x86/crypto/aesni-intel_asm.S | 5 +++--
> arch/x86/crypto/camellia-aesni-avx-asm_64.S | 3 ++-
> arch/x86/crypto/camellia-aesni-avx2-asm_64.S | 3 ++-
> arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 3 ++-
> 4 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
> index 16627fe..f128680 100644
> --- a/arch/x86/crypto/aesni-intel_asm.S
> +++ b/arch/x86/crypto/aesni-intel_asm.S
> @@ -32,6 +32,7 @@
> #include <linux/linkage.h>
> #include <asm/inst.h>
> #include <asm/frame.h>
> +#include <asm/nospec-branch.h>
>
> /*
> * The following macros are used to move an (un)aligned 16 byte value to/from
> @@ -2884,7 +2885,7 @@ ENTRY(aesni_xts_crypt8)
> pxor INC, STATE4
> movdqu IV, 0x30(OUTP)
>
> - call *%r11
> + NOSPEC_CALL %r11

Personally I find

CALL_NOSPEC %r11

to be more readable. The call is the action and the nospec is a detail.

And similarly for NOSPEC_JMP -> JMP_NOSPEC.

--
Josh
\
 
 \ /
  Last update: 2018-01-14 23:17    [W:0.220 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site