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: GUO Zihua guozihua@huawei.com --- arch/powerpc/kernel/exceptions-64e.S | 4 ++++ arch/powerpc/kernel/head_64.S | 9 +++++++++ 2 files changed, 13 insertions(+)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 422971ca9322..be6e1fa07c21 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S @@ -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 diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 68592eec0e70..8ac22d56132b 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -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 ? */