Lines Matching full:chunk

111 	/* First chunk of serialized preserved memory map */
315 * process. Each chunk holds bitmaps of the same order and each block of bitmaps
351 struct khoser_mem_chunk *chunk __free(free_page) = NULL; in new_chunk()
353 chunk = (void *)get_zeroed_page(GFP_KERNEL); in new_chunk()
354 if (!chunk) in new_chunk()
357 if (WARN_ON(kho_scratch_overlap(virt_to_phys(chunk), PAGE_SIZE))) in new_chunk()
360 chunk->hdr.order = order; in new_chunk()
362 KHOSER_STORE_PTR(cur_chunk->hdr.next, chunk); in new_chunk()
363 return no_free_ptr(chunk); in new_chunk()
368 struct khoser_mem_chunk *chunk = first_chunk; in kho_mem_ser_free() local
370 while (chunk) { in kho_mem_ser_free()
371 struct khoser_mem_chunk *tmp = chunk; in kho_mem_ser_free()
373 chunk = KHOSER_LOAD_PTR(chunk->hdr.next); in kho_mem_ser_free()
381 struct khoser_mem_chunk *chunk = NULL; in kho_mem_serialize() local
390 chunk = new_chunk(chunk, order); in kho_mem_serialize()
391 if (IS_ERR(chunk)) { in kho_mem_serialize()
392 err = PTR_ERR(chunk); in kho_mem_serialize()
397 first_chunk = chunk; in kho_mem_serialize()
402 if (chunk->hdr.num_elms == ARRAY_SIZE(chunk->bitmaps)) { in kho_mem_serialize()
403 chunk = new_chunk(chunk, order); in kho_mem_serialize()
404 if (IS_ERR(chunk)) { in kho_mem_serialize()
405 err = PTR_ERR(chunk); in kho_mem_serialize()
410 elm = &chunk->bitmaps[chunk->hdr.num_elms]; in kho_mem_serialize()
411 chunk->hdr.num_elms++; in kho_mem_serialize()
450 struct khoser_mem_chunk *chunk; in kho_mem_deserialize() local
461 chunk = *mem ? phys_to_virt(*mem) : NULL; in kho_mem_deserialize()
462 while (chunk) { in kho_mem_deserialize()
465 for (i = 0; i != chunk->hdr.num_elms; i++) in kho_mem_deserialize()
466 deserialize_bitmap(chunk->hdr.order, in kho_mem_deserialize()
467 &chunk->bitmaps[i]); in kho_mem_deserialize()
468 chunk = KHOSER_LOAD_PTR(chunk->hdr.next); in kho_mem_deserialize()
603 * kho_reserve_scratch - Reserve a contiguous chunk of memory for kexec
866 struct kho_vmalloc_chunk *chunk; in new_vmalloc_chunk() local
869 chunk = (struct kho_vmalloc_chunk *)get_zeroed_page(GFP_KERNEL); in new_vmalloc_chunk()
870 if (!chunk) in new_vmalloc_chunk()
873 err = kho_preserve_pages(virt_to_page(chunk), 1); in new_vmalloc_chunk()
877 KHOSER_STORE_PTR(cur->hdr.next, chunk); in new_vmalloc_chunk()
878 return chunk; in new_vmalloc_chunk()
881 free_page((unsigned long)chunk); in new_vmalloc_chunk()
885 static void kho_vmalloc_unpreserve_chunk(struct kho_vmalloc_chunk *chunk, in kho_vmalloc_unpreserve_chunk() argument
889 unsigned long pfn = PHYS_PFN(virt_to_phys(chunk)); in kho_vmalloc_unpreserve_chunk()
893 for (int i = 0; i < ARRAY_SIZE(chunk->phys) && chunk->phys[i]; i++) { in kho_vmalloc_unpreserve_chunk()
894 pfn = PHYS_PFN(chunk->phys[i]); in kho_vmalloc_unpreserve_chunk()
901 struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(kho_vmalloc->first); in kho_vmalloc_free_chunks() local
903 while (chunk) { in kho_vmalloc_free_chunks()
904 struct kho_vmalloc_chunk *tmp = chunk; in kho_vmalloc_free_chunks()
906 kho_vmalloc_unpreserve_chunk(chunk, kho_vmalloc->order); in kho_vmalloc_free_chunks()
908 chunk = KHOSER_LOAD_PTR(chunk->hdr.next); in kho_vmalloc_free_chunks()
930 struct kho_vmalloc_chunk *chunk; in kho_preserve_vmalloc() local
945 chunk = new_vmalloc_chunk(NULL); in kho_preserve_vmalloc()
946 if (!chunk) in kho_preserve_vmalloc()
948 KHOSER_STORE_PTR(preservation->first, chunk); in kho_preserve_vmalloc()
958 chunk->phys[idx++] = phys; in kho_preserve_vmalloc()
959 if (idx == ARRAY_SIZE(chunk->phys)) { in kho_preserve_vmalloc()
960 chunk = new_vmalloc_chunk(chunk); in kho_preserve_vmalloc()
961 if (!chunk) in kho_preserve_vmalloc()
991 struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(preservation->first); in kho_restore_vmalloc() local
1013 while (chunk) { in kho_restore_vmalloc()
1016 for (int i = 0; i < ARRAY_SIZE(chunk->phys) && chunk->phys[i]; i++) { in kho_restore_vmalloc()
1017 phys_addr_t phys = chunk->phys[i]; in kho_restore_vmalloc()
1032 page = kho_restore_pages(virt_to_phys(chunk), 1); in kho_restore_vmalloc()
1035 chunk = KHOSER_LOAD_PTR(chunk->hdr.next); in kho_restore_vmalloc()