Skip to content

Commit

Permalink
MIPS: Loongson64: Reserve vgabios memory on boot
Browse files Browse the repository at this point in the history
vgabios is passed from firmware to kernel on Loongson64 systems.
Sane firmware will keep this pointer in reserved memory space
passed from the firmware but insane firmware keeps it in low
memory before kernel entry that is not reserved.

Previously kernel won't try to allocate memory from low memory
before kernel entry on boot, but after converting to memblock
it will do that.

Fix by resversing those memory on early boot.

Cc: [email protected]
Fixes: a94e4f2 ("MIPS: init: Drop boot_mem_map")
Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
  • Loading branch information
FlyGoat authored and tsbogend committed Dec 5, 2023
1 parent 55702ec commit 8f7aa77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/mips/loongson64/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ void __init szmem(unsigned int node)
break;
}
}

/* Reserve vgabios if it comes from firmware */
if (loongson_sysconf.vgabios_addr)
memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr),
SZ_256K);
}

#ifndef CONFIG_NUMA
Expand Down

0 comments on commit 8f7aa77

Please sign in to comment.