Commit c7a3fb71 authored by Jason Yan's avatar Jason Yan Committed by GUO Zihua
Browse files

powerpc/fsl_booke/64: do not clear the BSS for the second pass

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8OHAZ
CVE: NA

Reference: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200306064033.3398-5-yanaijie@huawei.com/



-------------------------------------------------

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: default avatarJason Yan <yanaijie@huawei.com>
Cc: Scott Wood <oss@buserror.net>
Cc: Diana Craciun <diana.craciun@nxp.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: default avatarCui GaoSheng <cuigaosheng1@huawei.com>
Signed-off-by: default avatarGUO Zihua <guozihua@huawei.com>
parent 314a43d0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -958,6 +958,13 @@ start_here_multiplatform:
	/* Adjust TOC for moved kernel. Could adjust when moving it instead. */
	bl	relative_toc

	/* Do not clear the BSS for the second pass if randomized */
	LOAD_REG_ADDR(r3, kernstart_virt_addr)
	ld	r3,0(r3)
	LOAD_REG_IMMEDIATE(r4, KERNELBASE)
	cmpd	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