STRUCT MSHV_GET_SET_VP_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mshv_get_set_vp_state(9) πŸ’…

okay so this is a page from the Kernel API Manual, bestie, and it's about a little struct that carries the arguments for MSHV_[GET,SET]_VP_STATE β€” yes that bracket notation is doing the most but it's iconic, we love a two-for-one πŸ”₯


✨ NAME ✨

struct mshv_get_set_vp_state β€” literally the arguments struct for MSHV_[GET,SET]_VP_STATE, no cap 🫢


🌸 SYNOPSIS 🌸

struct mshv_get_set_vp_state {
    __u8 type;
    __u8 rsvd[3];
    __u32 buf_sz;
    __u64 buf_ptr;
 };

that's the whole vibe. four fields. immaculate. ✨


πŸŽ€ MEMBERS πŸŽ€

  • type β€” it's MSHV_VP_STATE_*, like pick your state icon, main character energy only πŸ’…
  • rsvd β€” MBZ bestie. Must Be Zero. don't be quirky with this one, leave it at zero fr fr πŸ™ˆ
  • buf_sz β€” okay this one is doing double duty and it's giving overachiever:
    • in: the 4k page-aligned size of the buffer πŸ¦‹
    • out: the actual size of the data
    • and like, ngl, if you get an EINVAL, check this field to see if your buffer was too small πŸ‘€ she'll tell you
  • buf_ptr β€” the data buffer, and yes it's 4k page-aligned too. alignment is the dress code, no exceptions πŸ‘‘ ⭐
lowkey the recurring theme here is 4k page alignment β€” both buf_sz (the in value) and buf_ptr gotta be aligned. that's just the house rules πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/uapi/linux/mshv.h and this whole friend group:

  • struct mshv_create_partition(9)
  • struct mshv_create_partition_v2(9)
  • struct mshv_user_mem_region(9)
  • struct mshv_gpap_access_bitmap(9)
  • struct mshv_root_hvcall(9)
  • struct mshv_run_vp(9)

go read them all, i'll wait πŸ’œ (jk, read them at your own pace, you're doing amazing sweetie 🧚)


🌈 okay that's the whole page!! this icon lives in ./include/uapi/linux and the date on this masterpiece is October 2026 β€” hope that helps bestie, slay your hypervisor adventures, and remember: aligned buffers, zeroed rsvd, periodt. πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from