memory_hotplug.c (9de4f22a60f731943f050f4448bf2933ed3fa70b) memory_hotplug.c (f3cd4c865b8ad61ff6dc61feba759a98ca06f039)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/memory_hotplug.c
4 *
5 * Copyright (C)
6 */
7
8#include <linux/stddef.h>

--- 91 unchanged lines hidden (view full) ---

100
101/* add this memory to iomem resource */
102static struct resource *register_memory_resource(u64 start, u64 size)
103{
104 struct resource *res;
105 unsigned long flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
106 char *resource_name = "System RAM";
107
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/memory_hotplug.c
4 *
5 * Copyright (C)
6 */
7
8#include <linux/stddef.h>

--- 91 unchanged lines hidden (view full) ---

100
101/* add this memory to iomem resource */
102static struct resource *register_memory_resource(u64 start, u64 size)
103{
104 struct resource *res;
105 unsigned long flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
106 char *resource_name = "System RAM";
107
108 if (start + size > max_mem_size)
108 /*
109 * Make sure value parsed from 'mem=' only restricts memory adding
110 * while booting, so that memory hotplug won't be impacted. Please
111 * refer to document of 'mem=' in kernel-parameters.txt for more
112 * details.
113 */
114 if (start + size > max_mem_size && system_state < SYSTEM_RUNNING)
109 return ERR_PTR(-E2BIG);
110
111 /*
112 * Request ownership of the new memory range. This might be
113 * a child of an existing resource that was present but
114 * not marked as busy.
115 */
116 res = __request_region(&iomem_resource, start, size,

--- 1678 unchanged lines hidden ---
115 return ERR_PTR(-E2BIG);
116
117 /*
118 * Request ownership of the new memory range. This might be
119 * a child of an existing resource that was present but
120 * not marked as busy.
121 */
122 res = __request_region(&iomem_resource, start, size,

--- 1678 unchanged lines hidden ---