Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp468744pxu; Tue, 5 Jan 2021 16:54:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJydCv5NVTF1d6T2/l11keK9Yb5WNxHctKOsnY4MHageVxI7pTglCdYbD+QluLeNILPXNZvX X-Received: by 2002:a17:906:814a:: with SMTP id z10mr1282388ejw.96.1609894448995; Tue, 05 Jan 2021 16:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609894448; cv=none; d=google.com; s=arc-20160816; b=AFOfH4nPYfU9wBXHnvSrOF082VXeVBDlH/f829Gi/D7xoJ9m/kBE7XSDuCmBx6AQej gThmjSR+Ex3Z3Isx8biPg8kOSOU97ZWDJXfJCrsosdcUL/7qteTn/mC4NT1kK+ARjIrt Y3/ZVa6ob+TPqlMBVMXtCHjlCcFn5ZgKO1ASMaNpDhcGVDETJGwQEoA3PW0MCLfk8ZNQ t6FJakeErVkCEtVDtOUPLRcJKpQzlS807eEsOMuwV5g0RZRoe+lanM70cgtgXXJNq9ZW vms9afQSk4QobidJWT/rGFWgPJXsGK0CwKlWA96oThqe6gSR43hXU+dtUJQGPOhIS607 /OLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=vegAji/WkYxNn/u0cHjwsDgmfLe8OfBh/eboOlc3MwM=; b=MEgbdow8DaCKkoeTmaxWj/FdO3+PRh2Svrq8bbnSPoxZpVLno61LKTMnRJGNlNyBbT IlGqMLXH4g+alTe+lueHa1PAANvJzSWWzUFSWEffyUMSBmk48sMoN6/GAVdNH38smlGA YfkOqV0fjbAV5b9Dzn+rRqu/DqUOBX4r32VN8GRiwWWLvduMkXc7gwbXJbwJWjd9C5d8 lF0ac4gvImflfprB7ej0Qo8DevxPbY6/NBPlpz+kyZEpqiZan9o8C9xRqf5ji+UP/aJs ZA30ArGD1FTmvTw+HjTNuQLRgaY/75C0eOG1UjLbCrmpNZ3tUBmLQt32B0M8qnXjR76x S7Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si313147edp.95.2021.01.05.16.53.45; Tue, 05 Jan 2021 16:54:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbhAFAs1 (ORCPT + 99 others); Tue, 5 Jan 2021 19:48:27 -0500 Received: from mail.loongson.cn ([114.242.206.163]:60848 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725906AbhAFAs0 (ORCPT ); Tue, 5 Jan 2021 19:48:26 -0500 Received: from loongson.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx++SuCPVf2AMAAA--.177S2; Wed, 06 Jan 2021 08:47:43 +0800 (CST) From: Jinyang He To: Thomas Bogendoerfer , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: zboot: Avoid endless loop in clear BSS. Date: Wed, 6 Jan 2021 08:47:39 +0800 Message-Id: <1609894059-6112-1-git-send-email-hejinyang@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Dx++SuCPVf2AMAAA--.177S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtFyUtw1kAw4UCFyrJF1DKFg_yoW3KrXEg3 4Iqw1DWws5Gr1qgFW3urn3KFyUu34j9w15AF1kXr1ava4rZFWfXFWDJ34UZr1DWrWjk3yf Krn5uw1FkFsF9jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb7xYjsxI4VWkKwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z2 80aVCY1x0267AKxVW8JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY02Avz4vE14v_twCF04k20xvY 0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcV CF04k26cxKx2IYs7xG6Fyj6rWUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv 6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07brXd8UUUUU= X-CM-SenderInfo: pkhmx0p1dqwqxorr0wxvrqhubq/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/mips/boot/compressed/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/boot/compressed/head.S b/arch/mips/boot/compressed/head.S index 070b2fb..5795d0a 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 */ -- 2.1.0