Lines Matching +full:zero +full:- +full:initialised
1 // SPDX-License-Identifier: GPL-2.0
8 * Most code is derived from arm64 port of kexec-tools
28 #define FDT_PROP_MEM_RANGE "linux,usable-memory-range"
29 #define FDT_PROP_INITRD_START "linux,initrd-start"
30 #define FDT_PROP_INITRD_END "linux,initrd-end"
32 #define FDT_PROP_KASLR_SEED "kaslr-seed"
33 #define FDT_PROP_RNG_SEED "rng-seed"
43 vfree(image->arch.dtb); in arch_kimage_file_post_load_cleanup()
44 image->arch.dtb = NULL; in arch_kimage_file_post_load_cleanup()
46 vfree(image->arch.elf_headers); in arch_kimage_file_post_load_cleanup()
47 image->arch.elf_headers = NULL; in arch_kimage_file_post_load_cleanup()
48 image->arch.elf_headers_sz = 0; in arch_kimage_file_post_load_cleanup()
66 if (ret && ret != -FDT_ERR_NOTFOUND) in setup_dtb()
69 if (ret && ret != -FDT_ERR_NOTFOUND) in setup_dtb()
72 if (image->type == KEXEC_TYPE_CRASH) { in setup_dtb()
76 image->arch.elf_headers_mem, in setup_dtb()
77 image->arch.elf_headers_sz); in setup_dtb()
79 return (ret == -FDT_ERR_NOSPACE ? -ENOMEM : -EINVAL); in setup_dtb()
81 /* add linux,usable-memory-range */ in setup_dtb()
85 crashk_res.end - crashk_res.start + 1); in setup_dtb()
87 return (ret == -FDT_ERR_NOSPACE ? -ENOMEM : -EINVAL); in setup_dtb()
97 if (ret && (ret != -FDT_ERR_NOTFOUND)) in setup_dtb()
101 /* add initrd-* */ in setup_dtb()
114 if (ret && (ret != -FDT_ERR_NOTFOUND)) in setup_dtb()
118 if (ret && (ret != -FDT_ERR_NOTFOUND)) in setup_dtb()
122 /* add kaslr-seed */ in setup_dtb()
124 if (ret == -FDT_ERR_NOTFOUND) in setup_dtb()
135 pr_notice("RNG is not initialised: omitting \"%s\" property\n", in setup_dtb()
139 /* add rng-seed */ in setup_dtb()
148 pr_notice("RNG is not initialised: omitting \"%s\" property\n", in setup_dtb()
154 return (ret == -FDT_ERR_NOSPACE) ? -ENOMEM : -EINVAL; in setup_dtb()
160 * More space needed so that we can add initrd, bootargs, kaslr-seed,
161 * rng-seed, userable-memory-range and elfcorehdr.
181 return -ENOMEM; in create_dtb()
186 return -EINVAL; in create_dtb()
192 if (ret == -ENOMEM) { in create_dtb()
223 return -ENOMEM; in prepare_elf_headers()
225 cmem->max_nr_ranges = nr_ranges; in prepare_elf_headers()
226 cmem->nr_ranges = 0; in prepare_elf_headers()
228 cmem->ranges[cmem->nr_ranges].start = start; in prepare_elf_headers()
229 cmem->ranges[cmem->nr_ranges].end = end - 1; in prepare_elf_headers()
230 cmem->nr_ranges++; in prepare_elf_headers()
246 * zero.
257 orig_segments = image->nr_segments; in load_other_segments()
265 if (image->type == KEXEC_TYPE_CRASH) { in load_other_segments()
285 image->arch.elf_headers = headers; in load_other_segments()
286 image->arch.elf_headers_mem = kbuf.mem; in load_other_segments()
287 image->arch.elf_headers_sz = headers_sz; in load_other_segments()
290 image->arch.elf_headers_mem, kbuf.bufsz, kbuf.memsz); in load_other_segments()
300 /* within 1GB-aligned window of up to 32GB in size */ in load_other_segments()
334 image->arch.dtb = dtb; in load_other_segments()
335 image->arch.dtb_mem = kbuf.mem; in load_other_segments()
343 image->nr_segments = orig_segments; in load_other_segments()