diff options
Diffstat (limited to 'arch/arm64/kernel/setup.c')
| -rw-r--r-- | arch/arm64/kernel/setup.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 48ffb9fb3fe3..7665a9bfdb1e 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
| @@ -170,7 +170,19 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) | |||
| 170 | 170 | ||
| 171 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) | 171 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) |
| 172 | { | 172 | { |
| 173 | base &= PAGE_MASK; | ||
| 173 | size &= PAGE_MASK; | 174 | size &= PAGE_MASK; |
| 175 | if (base + size < PHYS_OFFSET) { | ||
| 176 | pr_warning("Ignoring memory block 0x%llx - 0x%llx\n", | ||
| 177 | base, base + size); | ||
| 178 | return; | ||
| 179 | } | ||
| 180 | if (base < PHYS_OFFSET) { | ||
| 181 | pr_warning("Ignoring memory range 0x%llx - 0x%llx\n", | ||
| 182 | base, PHYS_OFFSET); | ||
| 183 | size -= PHYS_OFFSET - base; | ||
| 184 | base = PHYS_OFFSET; | ||
| 185 | } | ||
| 174 | memblock_add(base, size); | 186 | memblock_add(base, size); |
| 175 | } | 187 | } |
| 176 | 188 | ||
