STRUCT VMW_VALIDATION_RES_NODE(9)
πΈ NAME πΈ
struct vmw_validation_res_node β the resource validation metadata struct, bestie. it's the little record-keeper that holds all the tea about a resource during validation π
β¨ SYNOPSIS β¨
okay so here's literally the whole struct, character for character, no cap:
struct vmw_validation_res_node {
struct list_head head;
struct vmwgfx_hash_item hash;
struct vmw_resource *res;
struct vmw_bo *new_guest_memory_bo;
unsigned long new_guest_memory_offset;
u32 no_buffer_needed : 1;
u32 switching_guest_memory_bo : 1;
u32 first_usage : 1;
u32 reserved : 1;
u32 dirty : 1;
u32 dirty_set : 1;
unsigned long private[];
};
π MEMBERS π
let me walk you through every single field because we do NOT skip details in this house π«Ά
headβ the list head for the resource validation list. it's the little handle that keeps this node chained up with all its friends πhashβ a hash entry, and it's specifically for the duplicate detection hash table. iykyk, dupes get caught here πresβ reference counted resource pointer. it's a pointer to the resource, and yes it's ref-counted, so mind your refs bestie πnew_guest_memory_boβ a non ref-counted pointer to the new guest memory buffer that's gonna be assigned to a resource. read that again: non ref-counted. don't come for me when you forget πnew_guest_memory_offsetβ offset into the new backup MOB, for the resources that can share MOBs. sharing is caring π§no_buffer_neededβ when this is set, the kernel does not need to allocate a MOB during validation, because the command stream provides a mob bind operation. the kernel's like "i'm good actually" β¨switching_guest_memory_boβ tells you the validation process is switching backup MOB. it's giving main character energy, the MOB is changing π¦first_usageβTrueiff the resource has been seen only once in the current validation batch. like, first time seeing you in this batch, hi πreservedβ whether the resource is currently reserved by this process. claim your spot πdirtyβ dirty information,VMW_RES_DIRTY_XX. that's the literal token, keep it πdirty_setβ change dirty status of the resource. yes it's a bit confusing that these two live next to each other, they're different things, ok? πprivateβ optionally additional memory for caller-private data. a flexible array member, so it can hold whatever extra lil secrets the caller wants π
π DESCRIPTION π
so why are half these fields bit fields? because these structures get allocated and freed in large numbers, and space conservation is desired. that's the whole reason β bit fields, tiny, efficient, iconic. the kernel is on a budget and she's slaying it π
lowkey important: they're bit fields, so don't expect to take nice neat addresses of them or anything. it's a space thing, fr fr.
β SEE ALSO β
kernel file ./drivers/gpu/drm/vmwgfx/vmwgfx_validation.c, plus all of these besties:
struct vmw_validation_bo_node(9)vmw_validation_mem_alloc(9)vmw_validation_mem_free(9)vmw_validation_find_bo_dup(9)vmw_validation_find_res_dup(9)vmw_validation_add_bo(9)vmw_validation_add_resource(9)vmw_validation_res_set_dirty(9)vmw_validation_res_switch_backup(9)vmw_validation_res_reserve(9)vmw_validation_res_unreserve(9)vmw_validation_bo_validate_single(9)vmw_validation_bo_validate(9)vmw_validation_res_validate(9)vmw_validation_drop_ht(9)vmw_validation_unref_lists(9)vmw_validation_prepare(9)vmw_validation_revert(9)vmw_validation_done(9)vmw_validation_preload_bo(9)vmw_validation_preload_res(9)vmw_validation_bo_backoff(9)
okay and for the cute sign-off: this one lives under ./drivers/gpu/drm/vmwgfx, it's from October 2026, and the page itself is struct vmw_validation_res_node(9) from the Kernel API Manual. go read the source, ily, bye πβ¨π
π¦ 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