mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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: b270bebd34
("powerpc/64s: Run at the kernel virtual address earlier in boot")
Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: Jinglin Wen <jinglin.wen@shingroup.cn>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240620024150.14857-1-jinglin.wen@shingroup.cn
This commit is contained in:
parent
a986fa57fd
commit
13fc6c1759
1 changed files with 3 additions and 2 deletions
|
@ -647,8 +647,9 @@ __after_prom_start:
|
||||||
* Note: This process overwrites the OF exception vectors.
|
* Note: This process overwrites the OF exception vectors.
|
||||||
*/
|
*/
|
||||||
LOAD_REG_IMMEDIATE(r3, PAGE_OFFSET)
|
LOAD_REG_IMMEDIATE(r3, PAGE_OFFSET)
|
||||||
mr. r4,r26 /* In some cases the loader may */
|
mr r4,r26 /* Load the virtual source address into r4 */
|
||||||
beq 9f /* have already put us at zero */
|
cmpld r3,r4 /* Check if source == dest */
|
||||||
|
beq 9f /* If so skip the copy */
|
||||||
li r6,0x100 /* Start offset, the first 0x100 */
|
li r6,0x100 /* Start offset, the first 0x100 */
|
||||||
/* bytes were copied earlier. */
|
/* bytes were copied earlier. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue