vmw_translate_guest_ptr(9)
π vmw_translate_guest_ptr β the Kernel API Manual glow-up π
okay so bestie, welcome to vmw_translate_guest_ptr(9) from the Kernel API Manual β this is the little function that gets you ready to translate a user-space buffer handle into a valid SVGAGuestPtr, and honestly? it's giving backstage-pass energy β¨
β¨ NAME β¨
vmw_translate_guest_ptr β prepare to translate a user-space buffer handle to a valid SVGAGuestPtr π«
π¦ SYNOPSIS π¦
int vmw_translate_guest_ptr (struct vmw_private *dev_priv , struct
vmw_sw_context *sw_context , SVGAGuestPtr *ptr , struct vmw_bo
**vmw_bo_p );
like, that's the whole signature, no cap π₯
πΈ ARGUMENTS πΈ
dev_privβ pointer to a device private structure π«Ά this is the main character of the hardware side of things.sw_contextβ the software context used for this command batch validation. yes queen, it's the one doing all the checking πptrβ pointer to the user-space handle that's getting translated πvmw_bo_pβ points to a location that, on successful return, will carry a non-reference-counted pointer to the DMA buffer identified by the user-space handle inidβ (ngl, that "non-reference-counted" part matters β don't go freeing this thing like it's yours π)
π DESCRIPTION π
so what this function actually does is save the information needed to translate a user-space buffer handle into a valid SVGAGuestPtr. and here's the tea: the translation does not happen immediately π« it happens later, during a call to vmw_apply_relocations. so it's less "do the thing" and more "set the thing up so it can be done later," iykyk β¨
it also builds two lists, and you literally have to clean up both of them or it's messy-girl behavior:
- a relocation list β this one needs to be freed using either
vmw_apply_relocationsorvmw_free_relocationsπ - a list of buffers to validate β this one needs to be freed using
vmw_clear_validationsπ§
okay but fr fr, remember both cleanups. the vibes will not survive a leaked list π
π SEE ALSO π
all the linked lore lives in the kernel file ./drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c β go read the whole friend group π«Ά
struct vmw_relocation(9)enum vmw_resource_relocation_type(9)struct vmw_resource_relocation(9)struct vmw_ctx_validation_info(9)struct vmw_cmd_entry(9)vmw_ptr_diff(9)vmw_execbuf_bindings_commit(9)vmw_bind_dx_query_mob(9)vmw_cmd_ctx_first_setup(9)vmw_execbuf_res_size(9)vmw_execbuf_rcache_update(9)vmw_execbuf_res_val_add(9)vmw_view_res_val_add(9)vmw_view_id_val_add(9)vmw_resource_context_res_add(9)vmw_resource_relocation_add(9)vmw_resource_relocations_free(9)vmw_resource_relocations_apply(9)vmw_resources_reserve(9)vmw_cmd_res_check(9)vmw_rebind_all_dx_query(9)vmw_rebind_contexts(9)vmw_view_bindings_add(9)vmw_cmd_cid_check(9)vmw_execbuf_info_from_res(9)vmw_query_bo_switch_prepare(9)vmw_query_bo_switch_commit(9)vmw_translate_mob_ptr(9)vmw_cmd_dx_define_query(9)vmw_cmd_dx_bind_query(9)vmw_cmd_begin_gb_query(9)vmw_cmd_begin_query(9)vmw_cmd_end_gb_query(9)vmw_cmd_end_query(9)vmw_cmd_wait_gb_query(9)vmw_cmd_wait_query(9)vmw_cmd_res_switch_backup(9)vmw_cmd_switch_backup(9)vmw_cmd_bind_gb_surface(9)vmw_cmd_update_gb_image(9)vmw_cmd_update_gb_surface(9)vmw_cmd_readback_gb_image(9)vmw_cmd_readback_gb_surface(9)vmw_cmd_invalidate_gb_image(9)vmw_cmd_invalidate_gb_surface(9)vmw_cmd_shader_define(9)vmw_cmd_shader_destroy(9)vmw_cmd_set_shader(9)vmw_cmd_set_shader_const(9)vmw_cmd_bind_gb_shader(9)vmw_cmd_dx_set_single_constant_buffer(9)vmw_cmd_dx_set_constant_buffer_offset(9)vmw_cmd_dx_set_shader_res(9)vmw_cmd_dx_set_shader(9)vmw_cmd_dx_set_vertex_buffers(9)vmw_cmd_dx_set_index_buffer(9)vmw_cmd_dx_set_rendertargets(9)vmw_cmd_dx_clear_rendertarget_view(9)vmw_cmd_dx_clear_depthstencil_view(9)vmw_cmd_dx_set_so_targets(9)vmw_cmd_dx_check_subresource(9)vmw_cmd_dx_view_remove(9)vmw_cmd_dx_define_shader(9)vmw_cmd_dx_destroy_shader(9)vmw_cmd_dx_bind_shader(9)vmw_cmd_dx_genmips(9)vmw_cmd_dx_transfer_from_buffer(9)vmw_cmd_intra_surface_copy(9)vmw_execbuf_copy_fence_user(9)vmw_execbuf_submit_fifo(9)vmw_execbuf_submit_cmdbuf(9)vmw_execbuf_cmdbuf(9)vmw_execbuf_unpin_panic(9)__vmw_execbuf_release_pinned_bo(9)vmw_execbuf_release_pinned_bo(9)
that's the whole page bestie, you ate it up ππ
sign-off time: this little beauty comes from ./drivers/gpu/drm/vmwgfx, dated October 2026, and you can find it filed under vmw_translate_guest_ptr(9) πβ¨π
π¦ 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