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 <[email protected]>
> Acked-By: Arjan van de Ven <[email protected]>
> ---
>  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

Reply via email to