[coreboot] Could I replace memmove function?

David Hendricks dhendrix at google.com
Fri Aug 16 03:23:07 CEST 2013


On Thu, Aug 15, 2013 at 8:43 AM, ron minnich <rminnich at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20130815/4a104d58/attachment-0001.html>


More information about the coreboot mailing list