lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bb8f61a-f93c-4b30-9990-ecf5a8ddc998@cn.fujitsu.com>
Date:   Tue, 8 Jan 2019 16:46:13 +0800
From:   Cao jin <caoj.fnst@...fujitsu.com>
To:     <x86@...nel.org>, <linux-kernel@...r.kernel.org>
CC:     <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
        <hpa@...or.com>
Subject: Re: [PATCH] x86/boot: drop memset from copy.S

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.

-- 
Sincerely,
Cao jin

On 1/7/19 3:40 PM, Cao jin wrote:
> According to objdump output of setup, function memset is not used in
> setup code. Currently, all usage of memset in setup come from macro
> definition of string.h.
> 
> Signed-off-by: Cao jin <caoj.fnst@...fujitsu.com>
> ---
> Compiled and booted under x86_64; compiled under i386.
> 
> Questions: now there is 2 definition of memcpy, one lies in copy.S,
> another lies in string.h which is mapped to gcc builtin function. Do we
> still need 2 definition? Could we move the content of copy.S to
> boot/string.c?
> 
> At first glance, the usage of string.{c.h} of setup is kind of confusing,
> they are also used in compressed/ and purgatory/
> 
>  arch/x86/boot/copy.S | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
> index 15d9f74b0008..5157d08b0ff2 100644
> --- a/arch/x86/boot/copy.S
> +++ b/arch/x86/boot/copy.S
> @@ -33,21 +33,6 @@ GLOBAL(memcpy)
>  	retl
>  ENDPROC(memcpy)
>  
> -GLOBAL(memset)
> -	pushw	%di
> -	movw	%ax, %di
> -	movzbl	%dl, %eax
> -	imull	$0x01010101,%eax
> -	pushw	%cx
> -	shrw	$2, %cx
> -	rep; stosl
> -	popw	%cx
> -	andw	$3, %cx
> -	rep; stosb
> -	popw	%di
> -	retl
> -ENDPROC(memset)
> -
>  GLOBAL(copy_from_fs)
>  	pushw	%ds
>  	pushw	%fs
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ