mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
riscv: add a warning when physical memory address overflows
The part of physical memory that exceeds the size of the linear mapping will be discarded. When the system starts up normally, a warning message will be printed to prevent confusion caused by the mismatch between the system memory and the actual physical memory. Signed-off-by: Yunhui Cui <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Tested-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
This commit is contained in:
1 parent
b6de116e46
commit
101971298b
2 files changed
+6
-2
No files matched your search
@@ -256,8 +256,12 @@ static void __init setup_bootmem(void)
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_64BIT) && IS_ENABLED(CONFIG_MMU)) {
|
||||
max_mapped_addr = __pa(PAGE_OFFSET) + KERN_VIRT_SIZE;
|
||||
memblock_cap_memory_range(phys_ram_base,
|
||||
max_mapped_addr - phys_ram_base);
|
||||
if (memblock_end_of_DRAM() > max_mapped_addr) {
|
||||
memblock_cap_memory_range(phys_ram_base,
|
||||
max_mapped_addr - phys_ram_base);
|
||||
pr_warn("Physical memory overflows the linear mapping size: region above %pa removed",
|
||||
&max_mapped_addr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Executable
BIN
Binary file not shown.
Reference in new issue
Block a user