linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/boot: drop memset from copy.S
@ 2019-01-07  7:40 Cao jin
  2019-01-07  7:59 ` hpa
  2019-01-08  8:46 ` Cao jin
  0 siblings, 2 replies; 7+ messages in thread
From: Cao jin @ 2019-01-07  7:40 UTC (permalink / raw)
  To: x86, linux-kernel; +Cc: tglx, mingo, bp, hpa

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
-- 
2.17.0




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-11  3:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07  7:40 [PATCH] x86/boot: drop memset from copy.S Cao jin
2019-01-07  7:59 ` hpa
2019-01-07  8:52   ` Cao jin
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).