Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1994261ybb; Sun, 29 Mar 2020 19:23:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt7dbDoyzdwwJpkmJ0XMDG4SaSF8mXfYyyLpJjMdpP6biV5FFKInQZW7MwQhKQsK4Yrhkmp X-Received: by 2002:a4a:7555:: with SMTP id g21mr8087803oof.46.1585534994966; Sun, 29 Mar 2020 19:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585534994; cv=none; d=google.com; s=arc-20160816; b=GBZ5c3cBcdvTBVolXBSxc/bvJ2yX+7ch3Zu/SDbGYCz1hsHZsAjoDGZlAq2eFvG3Mh 0gxIcU3gnBRhEmTxiptF7X9K2WMgmvqtUNmRgB1v4yvWzQ5HlReEhCO9HjghxrXHQZUu OvwOl2EiYGESfGQVbCg3eV/B08pA3Q2h9M+7jGh6Ics4pFUYmUBEHbuKLHjh3FUkZltP 2d2sgDDZ3+6vKZoFuEjjCgDrIP3XAD0wGHMKfMB5PDRYXBTBfFeOq55nppoXarZaAYI2 IBtHTewGMD1B5d4KChj7VLng0V1CTYJ+lBLgBvv3ug7P1VhZEzgW909gr9wRoXh73FWF uk0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=B0nLjtcd0Hi+ObIDiYoiT//hvCdIBHyC6QI8oCJaWQE=; b=gQeu7WUiyxkeZRI+Hv2gUXtEXc6sq2TCaP3kTnCb1eM+Qn+0QIm0B7bspuFgsxqgSa +FMVw7af/TcjqmgAS7JH0goObCRMKNOtQAnnlEvOuXj6qKBQhbtKcXfFv8BgqynEeCqh qu3TnwAW0cV4H+NQg4GZuKAaKmgeFhJD71PblOX1XCEQdQx2pvgLhwPPIWwM6rvkhQ5o tix+sY/iF+IsUGxrpa+ijfhiUPZczzUO9JlFnu/qjvjc5TZRhBM4DjpJUqXqNfJJzl3y zcFxiObJ4mmlOD678kBVcnGA+MT8cmDS2a2WODVF/C4FULWHJeWZqG/R4Cj7x7eerbBv YDEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si2241613otp.138.2020.03.29.19.23.02; Sun, 29 Mar 2020 19:23:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729019AbgC3CWk (ORCPT + 99 others); Sun, 29 Mar 2020 22:22:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12213 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728969AbgC3CWh (ORCPT ); Sun, 29 Mar 2020 22:22:37 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 720D6D4EAA7F6DBC7B08; Mon, 30 Mar 2020 10:22:33 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 30 Mar 2020 10:22:22 +0800 From: Jason Yan To: , , , , , , , , , CC: , , , Jason Yan Subject: [PATCH v5 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass Date: Mon, 30 Mar 2020 10:20:21 +0800 Message-ID: <20200330022023.3691-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200330022023.3691-1-yanaijie@huawei.com> References: <20200330022023.3691-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The BSS section has already cleared out in the first pass. No need to clear it again. This can save some time when booting with KASLR enabled. Signed-off-by: Jason Yan Cc: Scott Wood Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- arch/powerpc/kernel/head_64.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 454129a3c259..9354c292b709 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -913,6 +913,13 @@ start_here_multiplatform: bl relative_toc tovirt(r2,r2) + /* Do not clear the BSS for the second pass if randomized */ + LOAD_REG_ADDR(r3, kernstart_virt_addr) + ld r3,0(r3) + LOAD_REG_IMMEDIATE(r4, KERNELBASE) + cmpd r3,r4 + bne 4f + /* Clear out the BSS. It may have been done in prom_init, * already but that's irrelevant since prom_init will soon * be detached from the kernel completely. Besides, we need -- 2.17.2