Re: [PATCH] x86/boot: drop memset from copy.S

From: Cao jin
Date: Thu Jan 10 2019 - 22:40:40 EST


On 1/8/19 4:46 PM, Cao jin wrote:
> One more question: in compressed/, for mem*(), it seems we both use the
> macros of boot/string.h, and the functions of compressed/string.c. Is
> that what we want?
>
> compressed/ is compiled with -O2, so it cannot be told by objdump -d,
> but still can be confirmed by nm <*.o>, for example:
>
> $nm arch/x86/boot/compressed/eboot.o
> U memcpy
> U memset
>
> $nm arch/x86/boot/compressed/pgtable_64.o
> # No entry of mem*()
>
> both of eboot.c and pgtable_64.c #include "../string.h", and use some of
> mem*(), it is counter-intuitive to me. Very appreciate it someone can
> leave a hint.
>

Well, I think HPA's previous answer is also suitable for this question,
with -O2, sometimes __builtin_mem*() is optimized as inline code, while
sometimes just emit a call to corresponding self-defined mem*() functions.

--
Sincerely,
Cao jin