Re: [PATCH v2 14/15] x86/lib/memmove_64.S: Convert memmove() to ALTERNATIVE macro

From: Ingo Molnar
Date: Wed Mar 04 2015 - 02:19:58 EST



* Borislav Petkov <bp@xxxxxxxxx> wrote:

> From: Borislav Petkov <bp@xxxxxxx>
>
> Make it execute the ERMS version if support is present and we're in the
> forward memmove() part and remove the unfolded alternatives section
> definition.
>
> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> ---
> arch/x86/lib/memmove_64.S | 19 ++-----------------
> 1 file changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
> index bbfa6b269ece..0f8a0d0331b9 100644
> --- a/arch/x86/lib/memmove_64.S
> +++ b/arch/x86/lib/memmove_64.S
> @@ -5,7 +5,6 @@
> * This assembly file is re-written from memmove_64.c file.
> * - Copyright 2011 Fenghua Yu <fenghua.yu@xxxxxxxxx>
> */
> -#define _STRING_C
> #include <linux/linkage.h>
> #include <asm/dwarf2.h>
> #include <asm/cpufeature.h>
> @@ -44,6 +43,8 @@ ENTRY(__memmove)
> jg 2f
>
> .Lmemmove_begin_forward:
> + ALTERNATIVE "", "movq %rdx, %rcx; rep movsb; retq", X86_FEATURE_ERMS
> +
> /*
> * movsq instruction have many startup latency
> * so we handle small size by general register.

Btw., it might make sense to translate that comment to English, while
at it? (in a separate patch)

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/