kernel_optimize_test/arch/mips
Maciej W. Rozycki 148b9aba99
MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression
Fix a commit 8a8158c85e ("MIPS: memset.S: EVA & fault support for
small_memset") regression and remove assembly warnings:

arch/mips/lib/memset.S: Assembler messages:
arch/mips/lib/memset.S:243: Warning: Macro instruction expanded into multiple instructions in a branch delay slot

triggering with the CPU_DADDI_WORKAROUNDS option set and this code:

	PTR_SUBU	a2, t1, a0
	jr		ra
	 PTR_ADDIU	a2, 1

This is because with that option in place the DADDIU instruction, which
the PTR_ADDIU CPP macro expands to, becomes a GAS macro, which in turn
expands to an LI/DADDU (or actually ADDIU/DADDU) sequence:

 13c:	01a4302f 	dsubu	a2,t1,a0
 140:	03e00008 	jr	ra
 144:	24010001 	li	at,1
 148:	00c1302d 	daddu	a2,a2,at
	...

Correct this by switching off the `noreorder' assembly mode and letting
GAS schedule this jump's delay slot, as there is nothing special about
it that would require manual scheduling.  With this change in place
correct code is produced:

 13c:	01a4302f 	dsubu	a2,t1,a0
 140:	24010001 	li	at,1
 144:	03e00008 	jr	ra
 148:	00c1302d 	daddu	a2,a2,at
	...

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: 8a8158c85e ("MIPS: memset.S: EVA & fault support for small_memset")
Patchwork: https://patchwork.linux-mips.org/patch/20833/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: stable@vger.kernel.org # 4.17+
2018-10-05 09:41:39 -07:00
..
alchemy
ar7
ath25
ath79
bcm47xx
bcm63xx
bmips
boot kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
cavium-octeon
cobalt
configs
crypto
dec
emma
fw
generic
include MIPS: VDSO: Always map near top of user memory 2018-09-28 12:09:00 -07:00
jazz
jz4740
kernel MIPS: Fix CONFIG_CMDLINE handling 2018-09-28 12:09:04 -07:00
kvm KVM: Remove obsolete kvm_unmap_hva notifier backend 2018-09-07 15:06:02 +02:00
lantiq MIPS: lantiq: dma: add dev pointer 2018-09-11 23:33:19 -07:00
lasat kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
lib MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression 2018-10-05 09:41:39 -07:00
loongson32
loongson64
math-emu
mm A few MIPS fixes for 4.19: 2018-08-23 14:23:08 -07:00
mti-malta
net
netlogic
oprofile
paravirt
pci
pic32
pistachio
pmcs-msp71xx
pnx833x
power
ralink
rb532
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni
tools
txx9
vdso
vr41xx
Kbuild
Kbuild.platforms
Kconfig A few MIPS fixes for 4.19: 2018-08-23 14:23:08 -07:00
Kconfig.debug
Makefile kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
Makefile.postlink