Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5189855ybf; Wed, 4 Mar 2020 19:16:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vsUBfbtTiXRgxszsjR717XNAIFKl3Ih2wqwM13oGKcX7q8EP5Yl9I4ATHMicrlt/UxUcyJ2 X-Received: by 2002:a9d:12b4:: with SMTP id g49mr5218276otg.50.1583378176100; Wed, 04 Mar 2020 19:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583378176; cv=none; d=google.com; s=arc-20160816; b=JP7eP7GR2/BB+MiUeF1OwHFxFOg2P9ljqcIJi0O2BevO+rnTKZ5ffcQKof2lQLV8h4 UCbAACug91pWH+CibalbFNMj+X5Rq/LNp0peG1sNkM2TiNxE8kkr4qAbZ2fDEYEiLXYe iflJdTgh4Qu4bCBtkkmcUG4GbgylBIaLSHt+yMvOSLz88BsiAde+Qs4KRZoTEeCcqhX5 xRbIrWXm7jEXWrZcwn4FMdZ70g/lrAwG5Jzb1ceN3BsgNJKKDwgtHbciunbPV7Ox148U yZsZ4zKzYeDizghVW1K8o8mkRYCb+yCwHx/qb9Hna9g8LHQ0smUeUhOrdxXNZ86Mc3ta h65g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=rarTm2994SqMWWTcfXAiByglpScg6AwOFwd30l6IfGI=; b=yTtki1pZ020aY5v9PfHqwAI86jT/dHxswHcyeMZMoiCHpZzX+nmZO4D+swlpl1J88Y JtWVV9xwg80dDPSYevU4oYmNA4BwgNSQiwHnTMjgO0r0p+J62NIeOINYBSeIiW5HcmUC gFPB+PFdOE+euRhMkf6QEpmCS+hOFzZ44mdKNaMv92fyxQbVXs1D2x9oGOZgdMzRmKXk 8oxGKq38sJH7vdxz5OhS2kDmCWdu8Lgt89KiKitUa7QllcYI9RbTxaUOaZFWOPsLALv8 yTPcdWiCiyBGGOCMGR8paFWXZSpd9UuxcM5tVvkgcw16/Q6xhzd64e2ZCTaxeKyiymfM DfGA== 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 e21si2662813oti.124.2020.03.04.19.16.03; Wed, 04 Mar 2020 19:16:16 -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 S1725893AbgCEDPO (ORCPT + 99 others); Wed, 4 Mar 2020 22:15:14 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:42170 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725844AbgCEDPO (ORCPT ); Wed, 4 Mar 2020 22:15:14 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B11B318CE46A3B88F89C; Thu, 5 Mar 2020 11:15:07 +0800 (CST) Received: from [127.0.0.1] (10.173.221.195) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Mar 2020 11:14:59 +0800 Subject: Re: [PATCH v3 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass To: Scott Wood , , , , , , , , , CC: , References: <20200206025825.22934-1-yanaijie@huawei.com> <20200206025825.22934-5-yanaijie@huawei.com> From: Jason Yan Message-ID: Date: Thu, 5 Mar 2020 11:14:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.173.221.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/3/5 5:49, Scott Wood 写道: > On Thu, 2020-02-06 at 10:58 +0800, Jason Yan wrote: >> 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 > > These are 64-bit values. > Oh yes, will fix. Thanks. > -Scott > > > > . >