Re: [PATCH v5 02/12] x86/retpoline: Add initial retpoline support

From: David Woodhouse
Date: Sat Jan 06 2018 - 12:33:13 EST


On Sat, 2018-01-06 at 11:49 +0000, David Woodhouse wrote:
>
> +#if defined(CONFIG_X86_64) && defined(RETPOLINE)
> +/*
> + * Since the inline asm uses the %V modifier which is only in newer GCC,
> + * the 64-bit one is dependent on RETPOLINE not CONFIG_RETPOLINE.
> + */
> +# define NOSPEC_CALL ALTERNATIVE(ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ\
> +ÂÂÂÂÂÂÂ"call *%[thunk_target]\n",ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ\
> +ÂÂÂÂÂÂÂ"call __x86.indirect_thunk.%V[thunk_target]\n",ÂÂÂÂÂÂÂÂÂ\
> +ÂÂÂÂÂÂÂX86_FEATURE_RETPOLINE)
> +# define THUNK_TARGET(addr) [thunk_target] "r" (addr)
> +#elif defined(CONFIG_X86_64) && defined(CONFIG_RETPOLINE)

        Â^^^^^^^^^^^^^Â

Arse. That'll invalidate my 32-bit test runs somewhat. I knew I should
have also repeated the "deliberately break the ASM and check it
crashes" tests. V6 coming in a little while, with 32-bit fixed
properly...

> +/*
> + * For i386 we use the original ret-equivalent retpoline, because
> + * otherwise we'll run out of registers. We don't care about CET
> + * here, anyway.
> + */

Attachment: smime.p7s
Description: S/MIME cryptographic signature