Lines Matching +full:high +full:- +full:end

1 // SPDX-License-Identifier: GPL-2.0-only
3 * crash.c - kernel crash support code.
4 * Copyright (C) 2002-2004 Eric Biederman <ebiederm@xmission.com>
32 .end = 0,
39 .end = 0,
54 * crashkernel=ramsize-range:size[,...][@offset]
56 * The function returns 0 on success and -EINVAL on failure.
74 /* for each entry of the comma-separated list */ in parse_crashkernel_mem()
76 unsigned long long start, end = ULLONG_MAX, size; in parse_crashkernel_mem() local
82 return -EINVAL; in parse_crashkernel_mem()
85 if (*cur != '-') { in parse_crashkernel_mem()
86 pr_warn("crashkernel: '-' expected\n"); in parse_crashkernel_mem()
87 return -EINVAL; in parse_crashkernel_mem()
91 /* if no ':' is here, than we read the end */ in parse_crashkernel_mem()
93 end = memparse(cur, &tmp); in parse_crashkernel_mem()
96 return -EINVAL; in parse_crashkernel_mem()
99 if (end <= start) { in parse_crashkernel_mem()
100 pr_warn("crashkernel: end <= start\n"); in parse_crashkernel_mem()
101 return -EINVAL; in parse_crashkernel_mem()
107 return -EINVAL; in parse_crashkernel_mem()
114 return -EINVAL; in parse_crashkernel_mem()
119 return -EINVAL; in parse_crashkernel_mem()
123 if (total_mem >= start && total_mem < end) { in parse_crashkernel_mem()
137 return -EINVAL; in parse_crashkernel_mem()
151 * It returns 0 on success and -EINVAL on failure.
162 return -EINVAL; in parse_crashkernel_simple()
169 return -EINVAL; in parse_crashkernel_simple()
180 [SUFFIX_HIGH] = ",high",
189 * crashkernel=size,[high|low|cma]
191 * It returns 0 on success and -EINVAL on failure.
202 return -EINVAL; in parse_crashkernel_suffix()
208 return -EINVAL; in parse_crashkernel_suffix()
213 return -EINVAL; in parse_crashkernel_suffix()
239 q = end_p - strlen(suffix_tbl[i]); in get_last_crashkernel()
246 q = end_p - strlen(suffix); in get_last_crashkernel()
273 return -ENOENT; in __parse_crashkernel()
282 * syntax -- if not, it must be the classic syntax in __parse_crashkernel()
295 * called from the arch-specific code.
297 * If crashkernel=,high|low is supported on architecture, non-NULL values
298 * should be passed to parameters 'low_size' and 'high'.
306 bool *high) in parse_crashkernel() argument
316 * If non-NULL 'high' passed in and no normal crashkernel in parse_crashkernel()
317 * setting detected, try parsing crashkernel=,high|low. in parse_crashkernel()
319 if (high && ret == -ENOENT) { in parse_crashkernel()
323 return -EINVAL; in parse_crashkernel()
331 if (ret == -ENOENT) { in parse_crashkernel()
338 *high = true; in parse_crashkernel()
350 ret = -EINVAL; in parse_crashkernel()
353 ret = -EINVAL; in parse_crashkernel()
377 return -ENOMEM; in reserve_crashkernel_low()
380 pr_info("crashkernel low memory reserved: 0x%08llx - 0x%08llx (%lld MB)\n", in reserve_crashkernel_low()
384 crashk_low_res.end = low_base + low_size - 1; in reserve_crashkernel_low()
395 bool high) in reserve_crashkernel_generic() argument
405 } else if (high) { in reserve_crashkernel_generic()
419 pr_warn("crashkernel reservation failed - memory is in use.\n"); in reserve_crashkernel_generic()
425 * low memory, fall back to high memory, the minimum required in reserve_crashkernel_generic()
428 if (!high && search_end == CRASH_ADDR_LOW_MAX) { in reserve_crashkernel_generic()
436 * For crashkernel=size[KMG],high, if the first attempt was in reserve_crashkernel_generic()
437 * for high memory, fall back to low memory. in reserve_crashkernel_generic()
439 if (high && search_end == CRASH_ADDR_HIGH_MAX) { in reserve_crashkernel_generic()
456 pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", in reserve_crashkernel_generic()
464 if (crashk_low_res.end) in reserve_crashkernel_generic()
468 crashk_res.end = crash_base + crash_size - 1; in reserve_crashkernel_generic()
492 /* reservation failed, try half-sized blocks */ in reserve_crashkernel_cma()
501 crashk_cma_ranges[crashk_cma_cnt].end = in reserve_crashkernel_cma()
503 cma_get_size(res) - 1; in reserve_crashkernel_cma()
527 if (crashk_res.start < crashk_res.end) in insert_crashkernel_resources()
530 if (crashk_low_res.start < crashk_low_res.end) in insert_crashkernel_resources()