Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4246734ybc; Fri, 15 Nov 2019 01:14:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwqvzoK/+MoWi/LwGqwH8Uuj16MKwrDJ7phqGnFWjoRN3rl5l8JMtrQlOlRPPbEmhjUSrU7 X-Received: by 2002:a17:906:240c:: with SMTP id z12mr12544578eja.35.1573809240598; Fri, 15 Nov 2019 01:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573809240; cv=none; d=google.com; s=arc-20160816; b=nPBka2Yy+u7rBWVA+42KU8RKb0BoVEQq/VjSpkF6VeH0m+R0MwYQL+jpT8DvdtA8tK eTwnVONu0aH9cN5GL7BV/rxa3/a9wK1wgAtdN971QTHW4sJifX1UPYUo1eVTLPxP0PsU B/pPW0D5hW6qoU82lwfcmDHFTYsbTUMtrQa7wV6aBfjIPU8ssb2YIPTEwxwFlHw7bpVy 2lDBPOoHzGmqExQ4lWFTBJ50bgAxy79hbGtiQk2r1/yH4y9Qjzh1cZwtaT5ENn6LyU1q 9pDVYEYWW6OqrO/qu+9BvQ1iEKZ8l3z2A8eGsKLe3gkF4J+4LELZfvEtMINlZAG6yprW J3VA== 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=Gf/5wAuvfs8hw/JP5S801+sj49KHIB9dOxQaYeJrJp4=; b=gi6SoZeF3ilbOQgEzO1tqJ+8BA89geCflxJR25I7jr2P+yEs3yGOo7QqnFBD6mwGqu +MtuXi+x61lGiQrkNmuu2qRGCIhe4FHKRpxypeBXml6nIVDY9RnSZWoFxWP9c+Cak05+ oifvM416AWfIchhSPYFb2MNhI6uKCVEdSyfUW4u7T1O/2yZipI98fod67NtInl8zLvL0 0takkPuZq8bPDLHSCZ1TH2t0vRotVFM+m5j72XB16wY4qar+EZEDXXgpP/XB1OcCR1rE qtXmyjwmy200I938IXvrANhiViWe6uFHkE3AijYruwJe0cUdeioyYfN4aiDEF8p7S838 /Egg== 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 i6si5740910edg.76.2019.11.15.01.13.36; Fri, 15 Nov 2019 01:14:00 -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 S1727387AbfKOJLG (ORCPT + 99 others); Fri, 15 Nov 2019 04:11:06 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:37838 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727254AbfKOJLF (ORCPT ); Fri, 15 Nov 2019 04:11:05 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 24863D4EB8CC1AEBFA11; Fri, 15 Nov 2019 17:11:03 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Fri, 15 Nov 2019 17:10:55 +0800 From: Jason Yan To: , , , , , , , , CC: , , Jason Yan Subject: [PATCH 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass Date: Fri, 15 Nov 2019 17:32:07 +0800 Message-ID: <20191115093209.26434-5-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20191115093209.26434-1-yanaijie@huawei.com> References: <20191115093209.26434-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 ad79fddb974d..76d8cdeddc69 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -907,6 +907,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