Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1004991ybv; Wed, 5 Feb 2020 19:01:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzT8stfw381OS8JfOkVGuJa3hKZ5dcZ7DsLo8JKGdiqI4E9Uekv4VOw5x/tTf/4hGPi17dp X-Received: by 2002:a9d:268:: with SMTP id 95mr29295641otb.183.1580958101732; Wed, 05 Feb 2020 19:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580958101; cv=none; d=google.com; s=arc-20160816; b=H2dPu80x8t/NapHphdnxZdLo2AP4LpwGl5jc4RJx+uwuNfOCNkVwn3qGskOH+b7C2I MhSmhHEXfpQtZ3FWE4BkLIH3ZGHCEh/aWHBeM9JS/89oHkpB30DRxfn46i3aLhOHdAhY Mp1c3HZIl3LM4PcJa5FKzzmvoiHDcMgXbmQAwh+QkggvEF4o42WY88eXG8QkOG523UX5 OpV88iUbkc43SUL2CiNFB5jYxnUtPW6lL9V6vPIdfJH/A33WVwHjN1q73ruq1D0oKAlf +fs2t51zPdqHca179yAJRhuz42N1Pr4wkQDZfr7Xu+dvGQg4imy0P+kk/Vb/EcXwGqZv 8kww== 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=dWOvwBoPpnBf0bS/friBIcRcGoSP6owuycFR/30e904=; b=HsXuB8vyajm4QvpRmeB5Zu5TflYMXeF6H781DDgc4+Eo3mZMt3ND3YpjZ3iAVC5tfT YI9gqVilH4t5Uw/uiL/oOqsoxCjXlB7/9a4G0TFMKghQLgNA3hZlQcQSIecdxA1MC9J5 EaNmu+sJbGU4rmWGLzx1tts9NTrrIYqDFDzpbGiaZLHcE8cJzye/dz4L6+wIOKgHcu77 56bL2jzKeiFq61MeCRWNJypGRss2jZpRY+D77LuBPjinIIGQaMyMlFzKLdg6BMMNsJe7 DehrsTm5lJ1LooYCpci/jJl2UZtO3AJxURSB1FCp849FUMZHUvXu5Hxg1KQcqdGK7P3Q mh8Q== 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 i12si1209867otk.215.2020.02.05.19.01.29; Wed, 05 Feb 2020 19:01:41 -0800 (PST) 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 S1727789AbgBFC7j (ORCPT + 99 others); Wed, 5 Feb 2020 21:59:39 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:38866 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727770AbgBFC7i (ORCPT ); Wed, 5 Feb 2020 21:59:38 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2004A7B2BCFD0EE927FF; Thu, 6 Feb 2020 10:59:35 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 6 Feb 2020 10:59:28 +0800 From: Jason Yan To: , , , , , , , , , CC: , , Jason Yan Subject: [PATCH v3 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass Date: Thu, 6 Feb 2020 10:58:23 +0800 Message-ID: <20200206025825.22934-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200206025825.22934-1-yanaijie@huawei.com> References: <20200206025825.22934-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 744624140fb8..8c644e7c3eaf 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -914,6 +914,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) + lwz r3,0(r3) + LOAD_REG_IMMEDIATE(r4, KERNELBASE) + cmpw 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