It wouldn't be terrible to have a generally better memmove implementation either.

Gabe


On Thu, Aug 15, 2013 at 6:23 PM, David Hendricks <dhendrix@google.com> wrote:



On Thu, Aug 15, 2013 at 8:43 AM, ron minnich <rminnich@gmail.com> wrote:
It seems to me you could improve our memmove?

Also, if we want to define another Kconfig variable this is pretty easy to fix.

There is CONFIG_CPU_DMP_VORTEX86EX which might be useful.

Maybe Andrew can try something like this:

diff --git a/src/arch/x86/lib/Makefile.inc b/src/arch/x86/lib/Makefile.inc
index 8588c76..b529d35 100644
--- a/src/arch/x86/lib/Makefile.inc
+++ b/src/arch/x86/lib/Makefile.inc
@@ -6,7 +6,6 @@ ramstage-y += exception.c
 ramstage-$(CONFIG_IOAPIC) += ioapic.c
 ramstage-y += memset.c
 ramstage-y += memcpy.c
-ramstage-y += memmove.c
 ramstage-y += ebda.c
 ramstage-y += rom_media.c
 ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c
@@ -16,16 +15,26 @@ romstage-$(CONFIG_EARLY_CONSOLE) += romstage_console.c
 romstage-y += cbfs_and_run.c
 romstage-y += memset.c
 romstage-y += memcpy.c
-romstage-y += memmove.c
 romstage-y += rom_media.c
 
 smm-y += memset.c
 smm-y += memcpy.c
-smm-y += memmove.c
 smm-y += rom_media.c
 
 rmodules-y += memset.c
 rmodules-y += memcpy.c
 rmodules-y += memmove.c
 
+ifeq ($(CONFIG_CPU_DMP_VORTEX86EX),y)
+# Old memmove implementation from Linux always use REP MOVSL
+# which is much faster on some CPUs.
+ramstage-y += memmove_old.c
+romstage-y += memmove_old.c
+smm-y += memmove_old.c
+else
+ramstage-y += memmove.c
+romstage-y += memmove.c
+smm-y += memmove.c
+endif
+

--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot