STRUCT VM_MEMORY_REGION_BATCH(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct vm_memory_region_batch(9) β€” kernel API manual, bestie edition

okay so real talk, this is a page from the Kernel API Manual, and the star of the show is struct vm_memory_region_batch πŸ’– like yes the header is literally truncated to struct vm_m...region_batch(9) (iconic abbreviation energy, slay) but we all know what it is.


✨ NAME ✨

struct vm_memory_region_batch β€” literally just a batch of vm_memory_region_op. that's it. that's the whole vibe check. πŸŽ€


🌸 SYNOPSIS 🌸

struct vm_memory_region_batch {
    u16 vmid;
    u16 reserved[3];
    u32 regions_num;
    u64 regions_gpa;
    struct vm_memory_region_op regions_op[];
 };

copy it exactly bestie, character for character, don't you dare touch a single u16 πŸ’€


πŸ¦‹ Members πŸ¦‹

so like, here's the roster of everyone in the struct, main character energy for each and every one:

  • vmid β€” a User VM ID. it's giving "which VM is this for" 🫢
  • reserved β€” Reserved. that's it, that's the whole description. she's reserved, she's mysterious, leave her alone πŸ™ˆ
  • regions_num β€” The number of vm_memory_region_op. the headcount, the guest list, lowkey the most important number in the function ✨
  • regions_gpa β€” Physical address of a vm_memory_region_op array. yes physical, not virtual, don't come for me πŸ‘‘
  • regions_op β€” Flexible array of vm_memory_region_op. flexible literally in the C sense, she grows at the end of the struct, we love a tail array πŸ’…

πŸ’œ Description πŸ’œ

okay so here's the tea β˜• β€” HC_VM_SET_MEMORY_REGIONS uses this structure to manage EPT mappings of multiple memory regions of a User VM. like, that's the whole job.

a struct vm_memory_region_batch contains multiple struct vm_memory_region_op for batch processing in the ACRN Hypervisor. so instead of doing the whole little-one-at-a-time thing, you batch them, and the hypervisor eats it up. efficiency! ate and left no crumbs πŸ”₯


🌈 SEE ALSO 🌈

go read these next, i'm obsessed with all of them fr fr:

  • Kernel file ./drivers/virt/acrn/acrn_drv.h
  • struct vm_memory_region_op(9)
  • struct vm_memory_mapping(9)
  • struct acrn_ioreq_buffer(9)
  • struct acrn_ioreq_client(9)
  • struct acrn_vm(9)

ngl bestie, if you're reading this struct in a debugger and regions_num doesn't match what you think it should, that's a you problem and a very real one 😭 check it before you ship.

and that's the page!! mwah 🫢 this whole thing lives over in ./drivers/virt/acrn, the date on it is October 2026, and the title bar's truncated little nickname for her is struct vm_m...region_batch(9) β€” she's got a long name and honestly she deserves the cute abbreviation. periodt. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from