From: Jinyang He Date: Wed, 6 Jan 2021 00:47:39 +0000 (+0800) Subject: MIPS: zboot: Avoid endless loop in clear BSS. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fdd85e04df3fdd55bb7f32786890fdfb200c40f0;p=linux.git MIPS: zboot: Avoid endless loop in clear BSS. Commit 2ee1503e546f ("MIPS: zboot: head.S clean up"). After .noreorder removed, clear BSS fall into endless loop. The bne instruction will add nop to the delay slot at compile time. So a0 register will not increment by 4. Fix it and clear BSS from _edata to (_end - 1). Signed-off-by: Jinyang He Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer --- diff --git a/arch/mips/boot/compressed/head.S b/arch/mips/boot/compressed/head.S index 070b2fbabae4c..5795d0af1e1b2 100644 --- a/arch/mips/boot/compressed/head.S +++ b/arch/mips/boot/compressed/head.S @@ -26,8 +26,8 @@ PTR_LA a0, _edata PTR_LA a2, _end 1: sw zero, 0(a0) + addiu a0, a0, 4 bne a2, a0, 1b - addiu a0, a0, 4 PTR_LA a0, (.heap) /* heap address */ PTR_LA sp, (.stack + 8192) /* stack address */