linux/arch
David S. Miller 1ca2893325 sparc64: Fix several bugs in memmove().
[ Upstream commit 2077cef4d5 ]

Firstly, handle zero length calls properly.  Believe it or not there
are a few of these happening during early boot.

Next, we can't just drop to a memcpy() call in the forward copy case
where dst <= src.  The reason is that the cache initializing stores
used in the Niagara memcpy() implementations can end up clearing out
cache lines before we've sourced their original contents completely.

For example, considering NG4memcpy, the main unrolled loop begins like
this:

     load   src + 0x00
     load   src + 0x08
     load   src + 0x10
     load   src + 0x18
     load   src + 0x20
     store  dst + 0x00

Assume dst is 64 byte aligned and let's say that dst is src - 8 for
this memcpy() call.  That store at the end there is the one to the
first line in the cache line, thus clearing the whole line, which thus
clobbers "src + 0x28" before it even gets loaded.

To avoid this, just fall through to a simple copy only mildly
optimized for the case where src and dst are 8 byte aligned and the
length is a multiple of 8 as well.  We could get fancy and call
GENmemcpy() but this is good enough for how this thing is actually
used.

Reported-by: David Ahern <david.ahern@oracle.com>
Reported-by: Bob Picco <bpicco@meloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 15:00:55 +01:00
..
alpha arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
arc ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE 2015-03-06 14:40:52 -08:00
arm hx4700: regulator: declare full constraints 2015-03-06 14:40:52 -08:00
arm64 arm64: compat Fix siginfo_t -> compat_siginfo_t conversion on big endian 2015-03-06 14:40:52 -08:00
avr32 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
blackfin blackfin updates for Linux 3.10 2013-05-10 07:21:16 -07:00
c6x arch: c6x: mm: include "asm/uaccess.h" to pass compiling 2013-07-21 18:21:29 -07:00
cris arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
frv arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
h8300 We get rid of the general module prefix confusion with a binary config option, 2013-05-05 10:58:06 -07:00
hexagon arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
ia64 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
m32r arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
m68k arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
metag metag: Fix KSTK_EIP() and KSTK_ESP() macros 2015-03-06 14:40:53 -08:00
microblaze arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
mips KVM: MIPS: Fix trace event to save PC directly 2015-03-18 13:22:29 +01:00
mn10300 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
openrisc arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
parisc arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
powerpc axonram: Fix bug in direct_access 2015-03-06 14:40:50 -08:00
s390 crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:57 -08:00
score arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
sh arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
sparc sparc64: Fix several bugs in memmove(). 2015-03-26 15:00:55 +01:00
tile arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
um um: Skip futex_atomic_cmpxchg_inatomic() test 2015-01-27 07:52:33 -08:00
unicore32 arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
x86 KVM: emulate: fix CMPXCHG8B on 32-bit hosts 2015-03-18 13:22:29 +01:00
xtensa arch: mm: pass userspace fault flag to generic fault handler 2014-11-21 09:22:56 -08:00
.gitignore
Kconfig microblaze: fix clone syscall 2013-08-20 08:43:02 -07:00