On Wed, Mar 19, 2025 at 06:55:45PM -0700, Changyuan Lyu wrote: > +int kho_copy_fdt(struct kimage *image) > +{ > + int err = 0; > + void *fdt; > + > + if (!kho_enable || !image->file_mode) > + return 0; > + > + if (!kho_out.fdt) { > + err = kho_finalize(); > + kho_out_update_debugfs_fdt(); > + if (err) > + return err; > + } > + > + fdt = kimage_map_segment(image, image->kho.fdt->mem, > + PAGE_ALIGN(kho_out.fdt_max)); > + if (!fdt) { > + pr_err("failed to vmap fdt ksegment in kimage\n"); > + return -ENOMEM; > + } I continue to think this copying is kind of pointless. I liked the point where we could get the FDT blob into userspace and validate it ie through debugfs. But as a way to actually do the kexec, I think you should not copy but preserve the memory holding FDT using the new preservation mechanism and simply put a 16 byte size/length on the image to refer to it. This would clean up the special hard coded memblock reserve to preserve the FDT memory too as normal preservation would take care fo it. Now that this is all in the kernel it seems like there is no reason to do the copying version any more. Jason