STRUCT FH_SG_LIST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct fh_sg_list(9) πŸŽ€

okay bestie, welcome to the Kernel API Manual entry for struct fh_sg_list β€” this is the whole entire definition of the fh_partition_memcpy S/G list, and honestly? it's giving "small struct, big responsibilities" πŸ’…


✨ NAME ✨

struct fh_sg_list β€” the definition of the fh_partition_memcpy S/G list. that's it, that's the name, no cap 🫢


🌸 SYNOPSIS 🌸

struct fh_sg_list {
    uint64_t source;
    uint64_t target;
    uint64_t size;
    uint64_t reserved;
 };

look at her. four fields. immaculate. no notes. ⭐


πŸ¦‹ Members πŸ¦‹

  • source β€” the guest physical address you're copying from πŸ‘€
  • target β€” the guest physical address you're copying to ✨
  • size β€” how many bytes we're copying, literally the number of bytes πŸ“
  • reserved β€” reserved, and it must be zero. like, do not touch, do not pass go, zero only πŸ™ˆ

πŸ’œ Description πŸ’œ

so the scatter/gather list for fh_partition_memcpy is an array of these structures. yes, an array β€” one is cute, many is the whole point πŸ’–

that array must be guest physically contiguous. not "kinda close together", not "adjacent-ish" β€” contiguous. the vibe check here is strict πŸ”₯

also: this structure must be aligned on a 32-byte boundary, and the reason is honestly so smart β€” that way no single structure can span two pages. periodt. πŸŽ€


🌈 SEE ALSO 🌈

kernel file ./arch/powerpc/include/asm/fsl_hcalls.h β€” and the whole friend group:


ngl bestie, remember the two rules: contiguous array, 32-byte aligned struct, and reserved stays 0. that's the whole assignment πŸ’€

mwah, that's a wrap! 🧚 this page lives in ./arch/powerpc/include/asm, dated October 2026, and it's filed under struct fh_sg_list(9) β€” ily, go read the other hcalls now πŸ‘‘πŸ’–

πŸ“¦ where this page comes from