]> git.karo-electronics.de Git - mv-sheeva.git/commit
x86-64: Modify memcpy()/memset() alternatives mechanism
authorJan Beulich <JBeulich@novell.com>
Fri, 18 Dec 2009 16:16:03 +0000 (16:16 +0000)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Dec 2009 10:57:32 +0000 (11:57 +0100)
commit7269e8812a59f74fb1ce134465d0bcf5683b93a1
treecfa0022a98907232edc8ffbe145926a272da14f1
parent1b1d9258181bae199dc940f4bd0298126b9a73d9
x86-64: Modify memcpy()/memset() alternatives mechanism

In order to avoid unnecessary chains of branches, rather than
implementing memcpy()/memset()'s access to their alternative
implementations via a jump, patch the (larger) original function
directly.

The memcpy() part of this is slightly subtle: while alternative
instruction patching does itself use memcpy(), with the
replacement block being less than 64-bytes in size the main loop
of the original function doesn't get used for copying memcpy_c()
over memcpy(), and hence we can safely write over its beginning.

Also note that the CFI annotations are fine for both variants of
each of the functions.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4B2BB8D30200007800026AF2@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/lib/memcpy_64.S
arch/x86/lib/memset_64.S