kho_add_subtree(9)
π« kho_add_subtree(9) π«
okay so bestie, welcome to section 9 of the Kernel API Manual, and today's main character is kho_add_subtree β she's the one who takes a sub blob and writes its physical address into the KHO root tree. no cap, she's iconic. π
β¨ NAME β¨
kho_add_subtree β record the physical address of a sub blob in the KHO root tree. literally her whole job. π
πΈ SYNOPSIS πΈ
int kho_add_subtree (const char *name , void *blob , size_t size );
three arguments, one int back. she keeps it cute and simple, fr fr. π¦
π ARGUMENTS π
nameβ the name of the sub tree. this is what she's gonna be called, so pick something good bestie. β¨blobβ the sub tree blob itself, the actual thing you want stored. π«Άsizeβ the size of the blob, measured in bytes. yes, bytes. the classic unit. π
π¦ DESCRIPTION π¦
so basically what happens here: she creates a new child node named name inside the KHO root FDT, and she records the physical address of blob there. that's the whole vibe. π
but wait β there's a catch, and it's giving important. the pages of blob must also be preserved by KHO, otherwise the new kernel won't be able to retrieve the blob after kexec. so don't just add the subtree and dip, okay? preserve those pages too. π
also!! when the kernel is configured with CONFIG_KEXEC_HANDOVER_DEBUGFS, a debugfs blob entry gets created for you at:
/sys/kernel/debug/kho/out/sub_fdts/name
so you can go peek at it. cute, right? ππ
β RETURN β
she returns 0 on success, and an error code on failure. that's it, that's the contract. π₯
π SEE ALSO π
the kernel file she lives in:
./kernel/liveupdate/kexec_handover.c
and her whole friend group, all in section 9:
kho_encode_radix_key(9), kho_decode_radix_key(9), kho_radix_add_key(9), kho_radix_del_key(9), kho_radix_init_tree(9), kho_radix_destroy_tree(9), kho_radix_walk_tree(9), kho_restore_folio(9), kho_restore_pages(9), kho_reserve_scratch(9), kho_preserve_folio(9), kho_unpreserve_folio(9), kho_preserve_pages(9), kho_unpreserve_pages(9), kho_preserve_vmalloc(9), kho_unpreserve_vmalloc(9), kho_restore_vmalloc(9), kho_alloc_preserve(9), kho_unpreserve_free(9), kho_restore_free(9), is_kho_boot(9), kho_retrieve_subtree(9)
ngl the whole kho_* family is a lot, but that's your reading list bestie β go slay it. ππ
okay that's the page!! mwah π this came from the source tree ./kernel/liveupdate, dated October 2026 β see you in the next man 9, bestie π«ΆπΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms