提交 a20c38ff 编写于 作者: Z zhongjiang 提交者: Xie XiuQi

mm: memmap: remove unnecessary check and add print information

euler inclusion
category: bugfix
CVE: NA
Bugzilla: 9580

---------------------------
efi report the momory after the early_param. Hence add the memblock
check of memmap parameter is unnecessary. And It will result in the
fail of reserved memory.

Meanwhile, add the print information inform the user of the incorrect
usage the memmap.
Signed-off-by: Nzhongjiang <zhongjiang@huawei.com>
Reviewed-by: NJing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5922568a
...@@ -210,7 +210,7 @@ static void __init request_standard_resources(void) ...@@ -210,7 +210,7 @@ static void __init request_standard_resources(void)
{ {
struct memblock_region *region; struct memblock_region *region;
struct resource *res, *res_resources; struct resource *res, *res_resources;
unsigned long i = 0, j = 0, res_count; unsigned long i = 0, j, res_count;
kernel_code.start = __pa_symbol(_text); kernel_code.start = __pa_symbol(_text);
kernel_code.end = __pa_symbol(__init_begin - 1); kernel_code.end = __pa_symbol(__init_begin - 1);
...@@ -258,7 +258,7 @@ static void __init request_standard_resources(void) ...@@ -258,7 +258,7 @@ static void __init request_standard_resources(void)
request_resource(res, &crashk_res); request_resource(res, &crashk_res);
#endif #endif
for (; j < res_mem_count; j++) { for (j = 0; j < res_mem_count; j++) {
if (res_resources[j].start >= res->start && if (res_resources[j].start >= res->start &&
res_resources[j].end <= res->end) res_resources[j].end <= res->end)
request_resource(res, &res_resources[j]); request_resource(res, &res_resources[j]);
......
...@@ -400,16 +400,6 @@ static int __init parse_memmap_one(char *p) ...@@ -400,16 +400,6 @@ static int __init parse_memmap_one(char *p)
return -EINVAL; return -EINVAL;
} }
if (!memblock_is_region_memory(start_at, mem_size)) {
pr_warn("cannot reserve memory: region is not meory\n");
return -EINVAL;
}
if (memblock_is_region_reserved(start_at, mem_size)) {
pr_warn("cannot reserve memory: region overlaps reserved memory\n");
return -EINVAL;
}
ret = memblock_reserve(start_at, mem_size); ret = memblock_reserve(start_at, mem_size);
if (!ret) { if (!ret) {
res_mem[res_mem_count].base = start_at; res_mem[res_mem_count].base = start_at;
...@@ -417,7 +407,8 @@ static int __init parse_memmap_one(char *p) ...@@ -417,7 +407,8 @@ static int __init parse_memmap_one(char *p)
res_mem_count++; res_mem_count++;
} else } else
pr_warn("memmap memblock_reserve failed.\n"); pr_warn("memmap memblock_reserve failed.\n");
} } else
pr_info("Unrecognized memmap option, please check the parameter.\n");
return *p == '\0' ? 0 : -EINVAL; return *p == '\0' ? 0 : -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册