Commit 9a2d4673 authored by GUO Zihua's avatar GUO Zihua
Browse files

powerpc/fsl_booke/kaslr: Provide correct r5 value for relocated kernel

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8OHAZ



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

Value stored in r5 is an indication on whether the system is booted from
PROM Of-type client-interface. It's value must be preserved and provided
when booting relocated kernel.

Signed-off-by: default avatarGUO Zihua <guozihua@huawei.com>
parent c3d1c3ac
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1576,4 +1576,8 @@ _GLOBAL(reloc_kernel_entry)

	mtspr	SPRN_SRR0,r4
	mtspr	SPRN_SRR1,r7
#ifdef CONFIG_RANDOMIZE_BASE
	LOAD_REG_ADDR_PIC(r19, __is_prom)
	lwz	r5,0(r19)
#endif
	rfi
+9 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ __secondary_hold_acknowledge:
	.globl	__kaslr_offset
__kaslr_offset:
	.8byte	0x0
	.globl	__is_prom
__is_prom:
	.8byte	0x0
#endif

	/* This flag is set to 1 by a loader if the kernel should run
@@ -541,6 +544,12 @@ __start_initialization_multiplatform:
	/* Poison TOC */
	li	r2,-1

#ifdef CONFIG_RANDOMIZE_BASE
	/* Store value in r5 for relocation */
	LOAD_REG_ADDR_PIC(r19, __is_prom)
	stw r5,0(r19)
#endif

	/*
	 * Are we booted from a PROM Of-type client-interface ?
	 */