Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/s390/mm/vmem.c |
| 3 | * |
| 4 | * Copyright IBM Corp. 2006 |
| 5 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> |
| 6 | */ |
| 7 | |
| 8 | #include <linux/bootmem.h> |
| 9 | #include <linux/pfn.h> |
| 10 | #include <linux/mm.h> |
| 11 | #include <linux/module.h> |
| 12 | #include <linux/list.h> |
| 13 | #include <asm/pgalloc.h> |
| 14 | #include <asm/pgtable.h> |
| 15 | #include <asm/setup.h> |
| 16 | #include <asm/tlbflush.h> |
| 17 | |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 18 | static DEFINE_MUTEX(vmem_mutex); |
| 19 | |
| 20 | struct memory_segment { |
| 21 | struct list_head list; |
| 22 | unsigned long start; |
| 23 | unsigned long size; |
| 24 | }; |
| 25 | |
| 26 | static LIST_HEAD(mem_segs); |
| 27 | |
Heiko Carstens | e62133b | 2007-07-27 12:29:13 +0200 | [diff] [blame] | 28 | void __meminit memmap_init(unsigned long size, int nid, unsigned long zone, |
| 29 | unsigned long start_pfn) |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 30 | { |
| 31 | struct page *start, *end; |
| 32 | struct page *map_start, *map_end; |
| 33 | int i; |
| 34 | |
| 35 | start = pfn_to_page(start_pfn); |
| 36 | end = start + size; |
| 37 | |
| 38 | for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { |
| 39 | unsigned long cstart, cend; |
| 40 | |
| 41 | cstart = PFN_DOWN(memory_chunk[i].addr); |
| 42 | cend = cstart + PFN_DOWN(memory_chunk[i].size); |
| 43 | |
| 44 | map_start = mem_map + cstart; |
| 45 | map_end = mem_map + cend; |
| 46 | |
| 47 | if (map_start < start) |
| 48 | map_start = start; |
| 49 | if (map_end > end) |
| 50 | map_end = end; |
| 51 | |
| 52 | map_start -= ((unsigned long) map_start & (PAGE_SIZE - 1)) |
| 53 | / sizeof(struct page); |
| 54 | map_end += ((PFN_ALIGN((unsigned long) map_end) |
| 55 | - (unsigned long) map_end) |
| 56 | / sizeof(struct page)); |
| 57 | |
| 58 | if (map_start < map_end) |
| 59 | memmap_init_zone((unsigned long)(map_end - map_start), |
Dave Hansen | a2f3aa02 | 2007-01-10 23:15:30 -0800 | [diff] [blame] | 60 | nid, zone, page_to_pfn(map_start), |
| 61 | MEMMAP_EARLY); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | |
Heiko Carstens | 2bc89b5 | 2008-02-05 16:50:40 +0100 | [diff] [blame] | 65 | static void __ref *vmem_alloc_pages(unsigned int order) |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 66 | { |
| 67 | if (slab_is_available()) |
| 68 | return (void *)__get_free_pages(GFP_KERNEL, order); |
| 69 | return alloc_bootmem_pages((1 << order) * PAGE_SIZE); |
| 70 | } |
| 71 | |
Martin Schwidefsky | 5a216a2 | 2008-02-09 18:24:36 +0100 | [diff] [blame] | 72 | static inline pud_t *vmem_pud_alloc(void) |
| 73 | { |
| 74 | pud_t *pud = NULL; |
| 75 | |
| 76 | #ifdef CONFIG_64BIT |
| 77 | pud = vmem_alloc_pages(2); |
| 78 | if (!pud) |
| 79 | return NULL; |
Heiko Carstens | 8fc6365 | 2008-04-30 13:38:44 +0200 | [diff] [blame^] | 80 | clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4); |
Martin Schwidefsky | 5a216a2 | 2008-02-09 18:24:36 +0100 | [diff] [blame] | 81 | #endif |
| 82 | return pud; |
| 83 | } |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 84 | |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 85 | static inline pmd_t *vmem_pmd_alloc(void) |
| 86 | { |
Martin Schwidefsky | 3610cce | 2007-10-22 12:52:47 +0200 | [diff] [blame] | 87 | pmd_t *pmd = NULL; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 88 | |
Martin Schwidefsky | 3610cce | 2007-10-22 12:52:47 +0200 | [diff] [blame] | 89 | #ifdef CONFIG_64BIT |
| 90 | pmd = vmem_alloc_pages(2); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 91 | if (!pmd) |
| 92 | return NULL; |
Heiko Carstens | 8fc6365 | 2008-04-30 13:38:44 +0200 | [diff] [blame^] | 93 | clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4); |
Martin Schwidefsky | 3610cce | 2007-10-22 12:52:47 +0200 | [diff] [blame] | 94 | #endif |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 95 | return pmd; |
| 96 | } |
| 97 | |
Martin Schwidefsky | 146e4b3 | 2008-02-09 18:24:35 +0100 | [diff] [blame] | 98 | static pte_t __init_refok *vmem_pte_alloc(void) |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 99 | { |
Martin Schwidefsky | 146e4b3 | 2008-02-09 18:24:35 +0100 | [diff] [blame] | 100 | pte_t *pte; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 101 | |
Martin Schwidefsky | 146e4b3 | 2008-02-09 18:24:35 +0100 | [diff] [blame] | 102 | if (slab_is_available()) |
| 103 | pte = (pte_t *) page_table_alloc(&init_mm); |
| 104 | else |
| 105 | pte = alloc_bootmem(PTRS_PER_PTE * sizeof(pte_t)); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 106 | if (!pte) |
| 107 | return NULL; |
Martin Schwidefsky | 146e4b3 | 2008-02-09 18:24:35 +0100 | [diff] [blame] | 108 | clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY, |
| 109 | PTRS_PER_PTE * sizeof(pte_t)); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 110 | return pte; |
| 111 | } |
| 112 | |
| 113 | /* |
| 114 | * Add a physical memory range to the 1:1 mapping. |
| 115 | */ |
| 116 | static int vmem_add_range(unsigned long start, unsigned long size) |
| 117 | { |
| 118 | unsigned long address; |
| 119 | pgd_t *pg_dir; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 120 | pud_t *pu_dir; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 121 | pmd_t *pm_dir; |
| 122 | pte_t *pt_dir; |
| 123 | pte_t pte; |
| 124 | int ret = -ENOMEM; |
| 125 | |
| 126 | for (address = start; address < start + size; address += PAGE_SIZE) { |
| 127 | pg_dir = pgd_offset_k(address); |
| 128 | if (pgd_none(*pg_dir)) { |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 129 | pu_dir = vmem_pud_alloc(); |
| 130 | if (!pu_dir) |
| 131 | goto out; |
| 132 | pgd_populate_kernel(&init_mm, pg_dir, pu_dir); |
| 133 | } |
| 134 | |
| 135 | pu_dir = pud_offset(pg_dir, address); |
| 136 | if (pud_none(*pu_dir)) { |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 137 | pm_dir = vmem_pmd_alloc(); |
| 138 | if (!pm_dir) |
| 139 | goto out; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 140 | pud_populate_kernel(&init_mm, pu_dir, pm_dir); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 141 | } |
| 142 | |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 143 | pm_dir = pmd_offset(pu_dir, address); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 144 | if (pmd_none(*pm_dir)) { |
| 145 | pt_dir = vmem_pte_alloc(); |
| 146 | if (!pt_dir) |
| 147 | goto out; |
| 148 | pmd_populate_kernel(&init_mm, pm_dir, pt_dir); |
| 149 | } |
| 150 | |
| 151 | pt_dir = pte_offset_kernel(pm_dir, address); |
| 152 | pte = pfn_pte(address >> PAGE_SHIFT, PAGE_KERNEL); |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 153 | *pt_dir = pte; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 154 | } |
| 155 | ret = 0; |
| 156 | out: |
| 157 | flush_tlb_kernel_range(start, start + size); |
| 158 | return ret; |
| 159 | } |
| 160 | |
| 161 | /* |
| 162 | * Remove a physical memory range from the 1:1 mapping. |
| 163 | * Currently only invalidates page table entries. |
| 164 | */ |
| 165 | static void vmem_remove_range(unsigned long start, unsigned long size) |
| 166 | { |
| 167 | unsigned long address; |
| 168 | pgd_t *pg_dir; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 169 | pud_t *pu_dir; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 170 | pmd_t *pm_dir; |
| 171 | pte_t *pt_dir; |
| 172 | pte_t pte; |
| 173 | |
| 174 | pte_val(pte) = _PAGE_TYPE_EMPTY; |
| 175 | for (address = start; address < start + size; address += PAGE_SIZE) { |
| 176 | pg_dir = pgd_offset_k(address); |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 177 | pu_dir = pud_offset(pg_dir, address); |
| 178 | if (pud_none(*pu_dir)) |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 179 | continue; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 180 | pm_dir = pmd_offset(pu_dir, address); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 181 | if (pmd_none(*pm_dir)) |
| 182 | continue; |
| 183 | pt_dir = pte_offset_kernel(pm_dir, address); |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 184 | *pt_dir = pte; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 185 | } |
| 186 | flush_tlb_kernel_range(start, start + size); |
| 187 | } |
| 188 | |
| 189 | /* |
| 190 | * Add a backed mem_map array to the virtual mem_map array. |
| 191 | */ |
| 192 | static int vmem_add_mem_map(unsigned long start, unsigned long size) |
| 193 | { |
| 194 | unsigned long address, start_addr, end_addr; |
| 195 | struct page *map_start, *map_end; |
| 196 | pgd_t *pg_dir; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 197 | pud_t *pu_dir; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 198 | pmd_t *pm_dir; |
| 199 | pte_t *pt_dir; |
| 200 | pte_t pte; |
| 201 | int ret = -ENOMEM; |
| 202 | |
Christian Borntraeger | 5fd9c6e | 2008-01-26 14:11:00 +0100 | [diff] [blame] | 203 | map_start = VMEM_MAP + PFN_DOWN(start); |
| 204 | map_end = VMEM_MAP + PFN_DOWN(start + size); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 205 | |
| 206 | start_addr = (unsigned long) map_start & PAGE_MASK; |
| 207 | end_addr = PFN_ALIGN((unsigned long) map_end); |
| 208 | |
| 209 | for (address = start_addr; address < end_addr; address += PAGE_SIZE) { |
| 210 | pg_dir = pgd_offset_k(address); |
| 211 | if (pgd_none(*pg_dir)) { |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 212 | pu_dir = vmem_pud_alloc(); |
| 213 | if (!pu_dir) |
| 214 | goto out; |
| 215 | pgd_populate_kernel(&init_mm, pg_dir, pu_dir); |
| 216 | } |
| 217 | |
| 218 | pu_dir = pud_offset(pg_dir, address); |
| 219 | if (pud_none(*pu_dir)) { |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 220 | pm_dir = vmem_pmd_alloc(); |
| 221 | if (!pm_dir) |
| 222 | goto out; |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 223 | pud_populate_kernel(&init_mm, pu_dir, pm_dir); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 224 | } |
| 225 | |
Martin Schwidefsky | 190a1d7 | 2007-10-22 12:52:48 +0200 | [diff] [blame] | 226 | pm_dir = pmd_offset(pu_dir, address); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 227 | if (pmd_none(*pm_dir)) { |
| 228 | pt_dir = vmem_pte_alloc(); |
| 229 | if (!pt_dir) |
| 230 | goto out; |
| 231 | pmd_populate_kernel(&init_mm, pm_dir, pt_dir); |
| 232 | } |
| 233 | |
| 234 | pt_dir = pte_offset_kernel(pm_dir, address); |
| 235 | if (pte_none(*pt_dir)) { |
| 236 | unsigned long new_page; |
| 237 | |
| 238 | new_page =__pa(vmem_alloc_pages(0)); |
| 239 | if (!new_page) |
| 240 | goto out; |
| 241 | pte = pfn_pte(new_page >> PAGE_SHIFT, PAGE_KERNEL); |
Gerald Schaefer | c1821c2 | 2007-02-05 21:18:17 +0100 | [diff] [blame] | 242 | *pt_dir = pte; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 243 | } |
| 244 | } |
| 245 | ret = 0; |
| 246 | out: |
| 247 | flush_tlb_kernel_range(start_addr, end_addr); |
| 248 | return ret; |
| 249 | } |
| 250 | |
| 251 | static int vmem_add_mem(unsigned long start, unsigned long size) |
| 252 | { |
| 253 | int ret; |
| 254 | |
Christian Borntraeger | a2fd64d | 2008-01-26 14:11:16 +0100 | [diff] [blame] | 255 | ret = vmem_add_mem_map(start, size); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 256 | if (ret) |
| 257 | return ret; |
Christian Borntraeger | a2fd64d | 2008-01-26 14:11:16 +0100 | [diff] [blame] | 258 | return vmem_add_range(start, size); |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | /* |
| 262 | * Add memory segment to the segment list if it doesn't overlap with |
| 263 | * an already present segment. |
| 264 | */ |
| 265 | static int insert_memory_segment(struct memory_segment *seg) |
| 266 | { |
| 267 | struct memory_segment *tmp; |
| 268 | |
Heiko Carstens | 0189103 | 2008-02-05 16:50:49 +0100 | [diff] [blame] | 269 | if (seg->start + seg->size >= VMEM_MAX_PHYS || |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 270 | seg->start + seg->size < seg->start) |
| 271 | return -ERANGE; |
| 272 | |
| 273 | list_for_each_entry(tmp, &mem_segs, list) { |
| 274 | if (seg->start >= tmp->start + tmp->size) |
| 275 | continue; |
| 276 | if (seg->start + seg->size <= tmp->start) |
| 277 | continue; |
| 278 | return -ENOSPC; |
| 279 | } |
| 280 | list_add(&seg->list, &mem_segs); |
| 281 | return 0; |
| 282 | } |
| 283 | |
| 284 | /* |
| 285 | * Remove memory segment from the segment list. |
| 286 | */ |
| 287 | static void remove_memory_segment(struct memory_segment *seg) |
| 288 | { |
| 289 | list_del(&seg->list); |
| 290 | } |
| 291 | |
| 292 | static void __remove_shared_memory(struct memory_segment *seg) |
| 293 | { |
| 294 | remove_memory_segment(seg); |
| 295 | vmem_remove_range(seg->start, seg->size); |
| 296 | } |
| 297 | |
| 298 | int remove_shared_memory(unsigned long start, unsigned long size) |
| 299 | { |
| 300 | struct memory_segment *seg; |
| 301 | int ret; |
| 302 | |
| 303 | mutex_lock(&vmem_mutex); |
| 304 | |
| 305 | ret = -ENOENT; |
| 306 | list_for_each_entry(seg, &mem_segs, list) { |
| 307 | if (seg->start == start && seg->size == size) |
| 308 | break; |
| 309 | } |
| 310 | |
| 311 | if (seg->start != start || seg->size != size) |
| 312 | goto out; |
| 313 | |
| 314 | ret = 0; |
| 315 | __remove_shared_memory(seg); |
| 316 | kfree(seg); |
| 317 | out: |
| 318 | mutex_unlock(&vmem_mutex); |
| 319 | return ret; |
| 320 | } |
| 321 | |
| 322 | int add_shared_memory(unsigned long start, unsigned long size) |
| 323 | { |
| 324 | struct memory_segment *seg; |
| 325 | struct page *page; |
| 326 | unsigned long pfn, num_pfn, end_pfn; |
| 327 | int ret; |
| 328 | |
| 329 | mutex_lock(&vmem_mutex); |
| 330 | ret = -ENOMEM; |
| 331 | seg = kzalloc(sizeof(*seg), GFP_KERNEL); |
| 332 | if (!seg) |
| 333 | goto out; |
| 334 | seg->start = start; |
| 335 | seg->size = size; |
| 336 | |
| 337 | ret = insert_memory_segment(seg); |
| 338 | if (ret) |
| 339 | goto out_free; |
| 340 | |
| 341 | ret = vmem_add_mem(start, size); |
| 342 | if (ret) |
| 343 | goto out_remove; |
| 344 | |
| 345 | pfn = PFN_DOWN(start); |
| 346 | num_pfn = PFN_DOWN(size); |
| 347 | end_pfn = pfn + num_pfn; |
| 348 | |
| 349 | page = pfn_to_page(pfn); |
| 350 | memset(page, 0, num_pfn * sizeof(struct page)); |
| 351 | |
| 352 | for (; pfn < end_pfn; pfn++) { |
| 353 | page = pfn_to_page(pfn); |
| 354 | init_page_count(page); |
| 355 | reset_page_mapcount(page); |
| 356 | SetPageReserved(page); |
| 357 | INIT_LIST_HEAD(&page->lru); |
| 358 | } |
| 359 | goto out; |
| 360 | |
| 361 | out_remove: |
| 362 | __remove_shared_memory(seg); |
| 363 | out_free: |
| 364 | kfree(seg); |
| 365 | out: |
| 366 | mutex_unlock(&vmem_mutex); |
| 367 | return ret; |
| 368 | } |
| 369 | |
| 370 | /* |
| 371 | * map whole physical memory to virtual memory (identity mapping) |
Christian Borntraeger | 5fd9c6e | 2008-01-26 14:11:00 +0100 | [diff] [blame] | 372 | * we reserve enough space in the vmalloc area for vmemmap to hotplug |
| 373 | * additional memory segments. |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 374 | */ |
| 375 | void __init vmem_map_init(void) |
| 376 | { |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 377 | int i; |
| 378 | |
Martin Schwidefsky | 146e4b3 | 2008-02-09 18:24:35 +0100 | [diff] [blame] | 379 | INIT_LIST_HEAD(&init_mm.context.crst_list); |
| 380 | INIT_LIST_HEAD(&init_mm.context.pgtable_list); |
| 381 | init_mm.context.noexec = 0; |
Christian Borntraeger | 5fd9c6e | 2008-01-26 14:11:00 +0100 | [diff] [blame] | 382 | NODE_DATA(0)->node_mem_map = VMEM_MAP; |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 383 | for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) |
| 384 | vmem_add_mem(memory_chunk[i].addr, memory_chunk[i].size); |
| 385 | } |
| 386 | |
| 387 | /* |
| 388 | * Convert memory chunk array to a memory segment list so there is a single |
| 389 | * list that contains both r/w memory and shared memory segments. |
| 390 | */ |
| 391 | static int __init vmem_convert_memory_chunk(void) |
| 392 | { |
| 393 | struct memory_segment *seg; |
| 394 | int i; |
| 395 | |
| 396 | mutex_lock(&vmem_mutex); |
Heiko Carstens | 9f4b0ba | 2008-01-26 14:11:02 +0100 | [diff] [blame] | 397 | for (i = 0; i < MEMORY_CHUNKS; i++) { |
Heiko Carstens | f4eb07c | 2006-12-08 15:56:07 +0100 | [diff] [blame] | 398 | if (!memory_chunk[i].size) |
| 399 | continue; |
| 400 | seg = kzalloc(sizeof(*seg), GFP_KERNEL); |
| 401 | if (!seg) |
| 402 | panic("Out of memory...\n"); |
| 403 | seg->start = memory_chunk[i].addr; |
| 404 | seg->size = memory_chunk[i].size; |
| 405 | insert_memory_segment(seg); |
| 406 | } |
| 407 | mutex_unlock(&vmem_mutex); |
| 408 | return 0; |
| 409 | } |
| 410 | |
| 411 | core_initcall(vmem_convert_memory_chunk); |