Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 6006/1: ARM: Use the correct NOP size in memmove for Thumb-2 kernel builds

When compiling the kernel to Thumb-2, using a 16-bit NOP in the
memmove() implementation causes the preceding ADD PC instruction to
branch incorrectly in the middle of a 32-bit LDR or STR instruction. The
memmove() code is now similar to the memcpy() template.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Catalin Marinas and committed by
Russell King
fd522a8d 782a0fd1

+2 -2
+2 -2
arch/arm/lib/memmove.S
··· 74 74 rsb ip, ip, #32 75 75 addne pc, pc, ip @ C is always clear here 76 76 b 7f 77 - 6: nop 77 + 6: W(nop) 78 78 W(ldr) r3, [r1, #-4]! 79 79 W(ldr) r4, [r1, #-4]! 80 80 W(ldr) r5, [r1, #-4]! ··· 85 85 86 86 add pc, pc, ip 87 87 nop 88 - nop 88 + W(nop) 89 89 W(str) r3, [r0, #-4]! 90 90 W(str) r4, [r0, #-4]! 91 91 W(str) r5, [r0, #-4]!