Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4937460ybf; Wed, 4 Mar 2020 13:51:18 -0800 (PST) X-Google-Smtp-Source: ADFU+vtcUCSebPwbJvtVLuAA+tXlUr7tRkFaSlLAhV8Pi/tBwZK+oNdvAQtmLGi0bTMPIGr4SogF X-Received: by 2002:aca:d694:: with SMTP id n142mr3172884oig.73.1583358678337; Wed, 04 Mar 2020 13:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583358678; cv=none; d=google.com; s=arc-20160816; b=N4YxrDQ5jPRe/LI5852abPB+kzTVYrSKGI9EeQCHdmMayFU82+liNLIiEPOc/OUEra 2iTESidqEe7qZBGnEmmyEbtnERM0josjSrGgyDyW+JwwZv61UjxL+90QHOuT/THc30w2 T+5CpJRpyyRPRnvLlmtnm5VRXqFeaDCu30EnLlS2ZtTqvlQDGg/ObFVu6eHEnriqUBMW W3CS+kKd0j09Cbz1IJ93pIvnsUzid4ixt/9cbtqF0ZXlzf8mqLFk1c01SZh2EQhAo/44 ItBUH//coKwUCdPjpvwnQ3fy0H8rpeCYXyuREGH0O9ftJz83O1w7injosfasD55biBxK nHIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=15Y2DEapLHUrNssCLVNjPpgOEx/jnTd1P7sUBmFEjrs=; b=LW8wXbt6+3NkhPglgiRQDI9JLdYOKssUDsRj+s/ko0g6G5wVktfYKsECmoJ9LCLM86 almYXUEmb2fvO9SJbBxiEHKNFqYM7EeWkNoRerMNZ7HY9jA7IS77NNv6zQn8+yw56BNN A4QObqruzxh8rOaLUMwrx3uZ0qvFUSAgytm0paH94w4f1Q1YSQlT2duu8DOOJ2oGVSqb bTUsTDom3v0aIUDAuy7puX6qSOfR8b+H44kdAxrPtzF6n8AHepP6x5ycYj3u+73lR1id RLVZPFNRdKnLHGIza1j+UbL8wdTAYRY3S0FGQqDs8kmbb/Up05zx3skNVhXIp10eymqP tu8A== 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 v137si2026320oif.170.2020.03.04.13.51.06; Wed, 04 Mar 2020 13:51:18 -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 S2388454AbgCDVts (ORCPT + 99 others); Wed, 4 Mar 2020 16:49:48 -0500 Received: from baldur.buserror.net ([165.227.176.147]:34440 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388312AbgCDVts (ORCPT ); Wed, 4 Mar 2020 16:49:48 -0500 Received: from [2601:449:8480:af0:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j9btL-0000ZP-0c; Wed, 04 Mar 2020 15:49:24 -0600 Message-ID: From: Scott Wood To: Jason Yan , mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com Cc: linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com Date: Wed, 04 Mar 2020 15:49:21 -0600 In-Reply-To: <20200206025825.22934-5-yanaijie@huawei.com> References: <20200206025825.22934-1-yanaijie@huawei.com> <20200206025825.22934-5-yanaijie@huawei.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2601:449:8480:af0:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: yanaijie@huawei.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on baldur.localdomain X-Spam-Level: X-Spam-Status: No, score=-17.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -1.5 GREYLIST_ISWHITE The incoming server has been whitelisted for * this recipient and sender Subject: Re: [PATCH v3 4/6] powerpc/fsl_booke/64: do not clear the BSS for the second pass X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -Scott