Lines Matching +full:clip +full:- +full:x +full:- +full:low

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 1995-2005 Russell King
23 #include <linux/dma-direct.h>
24 #include <linux/dma-map-ops.h>
38 #include <asm/kernel-pgtable.h>
47 #include <asm/xen/swiotlb-xen.h>
55 s64 memstart_addr __ro_after_init = -1;
60 * and ZONE_DMA32. By default ZONE_DMA covers the 32-bit addressable memory
61 * unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
62 * In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
109 pr_err("cannot allocate crashkernel low memory (size:0x%llx).\n", low_size); in reserve_crashkernel_low()
110 return -ENOMEM; in reserve_crashkernel_low()
113 pr_info("crashkernel low memory reserved: 0x%08llx - 0x%08llx (%lld MB)\n", in reserve_crashkernel_low()
117 crashk_low_res.end = low_base + low_size - 1; in reserve_crashkernel_low()
124 * reserve_crashkernel() - reserves memory for crash kernel
143 /* crashkernel=X[@offset] */ in reserve_crashkernel()
146 if (ret == -ENOENT) { in reserve_crashkernel()
152 * crashkernel=Y,low can be specified or not, but invalid value in reserve_crashkernel()
156 if (ret == -ENOENT) in reserve_crashkernel()
187 pr_warn("crashkernel reservation failed - memory is in use.\n"); in reserve_crashkernel()
193 * low memory, fall back to high memory, the minimum required in reserve_crashkernel()
194 * low memory will be reserved later. in reserve_crashkernel()
205 * for high memory, fall back to low memory. in reserve_crashkernel()
212 pr_warn("cannot allocate crashkernel (size:0x%llx)\n", in reserve_crashkernel()
223 pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", in reserve_crashkernel()
235 crashk_res.end = crash_base + crash_size - 1; in reserve_crashkernel()
241 * limit. If DRAM starts above 32-bit, expand the zone to the maximum
242 * available memory, otherwise cap it at 32-bit.
254 return min(zone_mask, memblock_end_of_DRAM() - 1) + 1; in max_zone_phys()
314 s64 linear_region_size = PAGE_END - _PAGE_OFFSET(vabits_actual); in arm64_memblock_init()
317 * Corner case: 52-bit VA capable systems running KVM in nVHE mode may in arm64_memblock_init()
339 if ((memblock_end_of_DRAM() - memstart_addr) > linear_region_size) in arm64_memblock_init()
344 * linear mapping. Take care not to clip the kernel which may be in arm64_memblock_init()
351 memstart_addr = round_up(memblock_end_of_DRAM() - linear_region_size, in arm64_memblock_init()
357 * If we are running with a 52-bit kernel VA config on a system that in arm64_memblock_init()
359 * memory in the 48-bit addressable part of the linear region, i.e., in arm64_memblock_init()
364 memstart_addr -= _PAGE_OFFSET(48) - _PAGE_OFFSET(52); in arm64_memblock_init()
373 memblock_add(__pa_symbol(_text), (u64)(_end - _text)); in arm64_memblock_init()
380 * Otherwise, this is a no-op in arm64_memblock_init()
383 u64 size = PAGE_ALIGN(phys_initrd_start + phys_initrd_size) - base; in arm64_memblock_init()
396 "initrd not fully accessible via the linear mapping -- please check your bootloader ...\n")) { in arm64_memblock_init()
410 s64 range = linear_region_size - in arm64_memblock_init()
420 memstart_addr -= ARM64_MEMSTART_ALIGN * in arm64_memblock_init()
429 memblock_reserve(__pa_symbol(_stext), _end - _stext); in arm64_memblock_init()
438 high_memory = __va(memblock_end_of_DRAM() - 1) + 1; in arm64_memblock_init()
501 /* this will put all unused low memory onto the freelists */ in mem_init()