From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: <hpa@zytor.com>, <x86@kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>
Subject: Re: [PATCH] x86/boot: drop memset from copy.S
Date: Mon, 7 Jan 2019 16:52:57 +0800 [thread overview]
Message-ID: <28158fd7-8569-e0c1-75d0-c423330e256d@cn.fujitsu.com> (raw)
In-Reply-To: <000CE7C8-33F3-404A-9E7D-F2CCB0BA110E@zytor.com>
Hi,
On 1/7/19 3:59 PM, hpa@zytor.com wrote:
> On January 6, 2019 11:40:56 PM PST, Cao jin <caoj.fnst@cn.fujitsu.com> 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@cn.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
>
> This is dependent on both gcc version and flags.
>
Thanks for your info, but I still don't quite get your point. All files
who has memset reference in setup will also #include "string.h", so how
gcc version and flags will associate memset reference to the assembly
function by force? Hope to get a little more details when you are
convenient:)
next prev parent reply other threads:[~2019-01-07 8:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 7:40 Cao jin
2019-01-07 7:59 ` hpa
2019-01-07 8:52 ` Cao jin [this message]
2019-01-08 8:38 ` hpa
2019-01-10 8:28 ` Cao jin
2019-01-08 8:46 ` Cao jin
2019-01-11 3:40 ` Cao jin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=28158fd7-8569-e0c1-75d0-c423330e256d@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®