Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp175847ybv; Tue, 4 Feb 2020 18:58:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyKo0uAAgaxFRyOKzgv0HPPGIhJVruYpJlczmEqiAK51dF6cpVlKlPdkUUyBbcUPIOdokj0 X-Received: by 2002:a9d:6b06:: with SMTP id g6mr24843121otp.93.1580871508846; Tue, 04 Feb 2020 18:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580871508; cv=none; d=google.com; s=arc-20160816; b=YtxIHFBUYGscVFpX04iqY+CtPfBg7DQf7VyvNHRHUt6tlBWCJvDN/a2SL/phhL+1+2 NAFkvCaXstnwyZi8ZjytaRqlHVxdcPK2o9SHxZ/TJXn5YoxIsMPz+k96xy8H+sXqAoIy S1qdLVm6IAvyyQy8BhAbY9VaiZ1Bm3XwG6jaT+ZXcikIbHEej/bGTS1VRdn07AAgbbsB lYSzdgiQWJ0069qVPKZ05WsagxAQAYHhD73wG2QZh3ZQFzqxL0EuxgIdK7YTcbNpgF2y s4o+ASQcSgLAHq2eUqa6DNxkiGGjjDyFnBtGBsJFT5EI25YhZNGd7i0UGY/qY2evFA7G PErg== 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=3kOAi0VyujqYS87UsRNraTjIjTo0IM97jEzg1uqcMPU=; b=OrkJxsEbD5Tdpiek7cHPWYWOLKUyDgxrZL1V9tLZmdFKIrywXAXSYXiRe3L+loFJ49 VZQWYd1IaYsQb/SD7PUSK42TqGrdGFlIybboDpcCtUBnjwt6zjVv0ukjVW7AgkDXqtD4 3R87h8XfTnjAcG6n8ux/DozTOkVmO3GYSCzpiQJYfycw6chW4qz9Zd3SvGh6th+ExrlE vAl3ioPAbCyZJoieYSuJSjMCPm/Lxn9iJ9O/4vNCjjTunBZZD50E35Zqtde5qszsxaaL 7eDqpCjXvEa37gyg0f/KEuPuLy9nPATbDQbzzu7ylR+zVcYre9/cIHKusOWJhkxf4BqW PyWw== 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 r14si10944378oic.12.2020.02.04.18.58.14; Tue, 04 Feb 2020 18:58:28 -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 S1727816AbgBEC4x (ORCPT + 99 others); Tue, 4 Feb 2020 21:56:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9700 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727758AbgBEC4k (ORCPT ); Tue, 4 Feb 2020 21:56:40 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AE3CF58F06CF40550DAB; Wed, 5 Feb 2020 10:56:36 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Wed, 5 Feb 2020 10:56:30 +0800 From: Jason Yan To: , , , , , , , , , CC: , , Jason Yan Subject: [PATCH v2 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass Date: Wed, 5 Feb 2020 10:55:25 +0800 Message-ID: <20200205025527.28640-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200205025527.28640-1-yanaijie@huawei.com> References: <20200205025527.28640-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 b4ececc4323d..9ae7fd8bbf7c 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