[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180108134923.p2zt3pgpehzjv3vn@treble>
Date: Mon, 8 Jan 2018 07:49:23 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: David Woodhouse <dwmw@...zon.co.uk>
Cc: Andi Kleen <ak@...ux.intel.com>, Paul Turner <pjt@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...ux-foundation.org>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>, tglx@...utronix.de,
Kees Cook <keescook@...gle.com>,
Rik van Riel <riel@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...capital.net>,
Jiri Kosina <jikos@...nel.org>, gnomes@...rguk.ukuu.org.uk
Subject: Re: [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@...zon.co.uk>
> Acked-By: Arjan van de Ven <arjan@...ux.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
Powered by blists - more mailing lists