The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@xxxxxxxxxxxxxxx>. To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x 8f7aa77a463f47c9e00592d02747a9fcf2271543 # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023121118-elitism-slimness-966d@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: 8f7aa77a463f ("MIPS: Loongson64: Reserve vgabios memory on boot") cf8194e46c1e ("MIPS: Loongson64: Give chance to build under !CONFIG_NUMA and !CONFIG_SMP") 73826d604bbf ("MIPS: Loongson64: Clean up numa.c") 1062fc45d1e9 ("MIPS: Loongson64: Select SMP in Kconfig to avoid build error") 70b838292bef ("MIPS: Update default config file for Loongson-3") 39c1485c8baa ("MIPS: KVM: Add kvm guest support for Loongson-3") 24af105962c8 ("MIPS: Loongson64: DeviceTree for LS7A PCH") f8523d0e8361 ("MIPS: Loongson: Rename CPU device-tree binding") 143463fd33fe ("MIPS: Loongson: Enable devicetree based probing for 8250 ports in defconfig") a44de7497f91 ("MIPS: Loongson: Build ATI Radeon GPU driver as module") 68fbb9721ea7 ("MIPS: Loongson: Add DMA support for LS7A") 2c3cc858a687 ("MIPS: Loongson64: Switch the order of RS780E and LS7A") 8c88cc53ffa6 ("MIPS: Loongson: Get host bridge information") fcecdcd388ea ("MIPS: Loongson64: Load built-in dtbs") 87fcfa7b7fe6 ("MIPS: Loongson64: Add generic dts") bfe9a2999629 ("dt-bindings: mips: Add loongson boards") 1e07c876ab75 ("MIPS: Loongson: Do not initialise statics to 0") 75cac781dca4 ("MIPS: Loongson{2ef, 32, 64} convert to generic fw cmdline") 6fbde6b492df ("MIPS: Loongson64: Move files to the top-level directory") 1bdb7b76705a ("MIPS: Loongson64: Cleanup unused code") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8f7aa77a463f47c9e00592d02747a9fcf2271543 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx> Date: Tue, 7 Nov 2023 11:15:18 +0000 Subject: [PATCH] MIPS: Loongson64: Reserve vgabios memory on boot 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: stable@xxxxxxxxxxxxxxx Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx> Signed-off-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx> diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index ee8de1735b7c..d62262f93069 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -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