Skip to content

Commit 13fc6c1

Browse files
hx-wenjinglinmpe
authored andcommitted
powerpc/64s: Fix unnecessary copy to 0 when kernel is booted at address 0
According to the code logic, when the kernel is loaded at address 0, no copying operation should be performed, but it is currently being done. This patch fixes the issue where the kernel code was incorrectly duplicated to address 0 when booting from address 0. Fixes: b270beb ("powerpc/64s: Run at the kernel virtual address earlier in boot") Cc: [email protected] # v6.4+ Signed-off-by: Jinglin Wen <[email protected]> Suggested-by: Michael Ellerman <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent a986fa5 commit 13fc6c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/powerpc/kernel/head_64.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,9 @@ __after_prom_start:
647647
* Note: This process overwrites the OF exception vectors.
648648
*/
649649
LOAD_REG_IMMEDIATE(r3, PAGE_OFFSET)
650-
mr. r4,r26 /* In some cases the loader may */
651-
beq 9f /* have already put us at zero */
650+
mr r4,r26 /* Load the virtual source address into r4 */
651+
cmpld r3,r4 /* Check if source == dest */
652+
beq 9f /* If so skip the copy */
652653
li r6,0x100 /* Start offset, the first 0x100 */
653654
/* bytes were copied earlier. */
654655

0 commit comments

Comments
 (0)