virtqueue_m...ange_for_cpu(9)
π¦ virtqueue_m...ange_for_cpu(9) β bestie edition π¦
okay so this is a page from the Kernel API Manual (yes, that manual, the one that lives in the kernel tree) and it's about virtqueue_map_sync_single_range_for_cpu. It's giving "niche virtio lore" and honestly? we're obsessed. Let's get into it π
β¨ NAME β¨
virtqueue_map_sync_single_range_for_cpu β map sync for cpu π«Ά
like, that's literally the whole thing. map. sync. for the cpu. iconic.
πΈ SYNOPSIS πΈ
void virtqueue_map_sync_single_range_for_cpu (const struct virtqueue
*_vq , dma_addr_t addr , unsigned long offset , size_t size , enum
dma_data_direction dir );
it returns void, so no sneaky return values to check, bestie β it just does the thing. β¨
π ARGUMENTS π
_vqβ thestruct virtqueuewe're talking about. yes, it literally has an underscore in front. no, we don't know why either. πaddrβ DMA addressoffsetβ DMA address offsetsizeβ buf size for syncdirβ DMA direction
five args, all business. slay. π₯
π DESCRIPTION π
so here's the vibe check π β before you call this function, you gotta use virtqueue_map_need_sync to confirm that the DMA address really needs to be synchronized. like, check first, sync second. that's the whole rule. do not skip the check, fr fr. π
lowkey important: this function assumes you already did the virtqueue_map_need_sync confirm step. it's not out here guessing for you, bestie.
π SEE ALSO π
the whole friend group shows up here, and we are not leaving anyone out π«Ά:
- Kernel file
./drivers/virtio/virtio_ring.c virtqueue_add_sgs(9)virtqueue_add_outbuf(9)virtqueue_add_outbuf_premapped(9)virtqueue_add_inbuf(9)virtqueue_add_inbuf_cache_clean(9)virtqueue_add_inbuf_ctx(9)virtqueue_add_inbuf_premapped(9)virtqueue_dma_dev(9)virtqueue_kick_prepare(9)virtqueue_notify(9)virtqueue_kick(9)virtqueue_get_buf_ctx(9)virtqueue_disable_cb(9)virtqueue_enable_cb_prepare(9)virtqueue_poll(9)virtqueue_enable_cb(9)virtqueue_enable_cb_delayed(9)virtqueue_detach_unused_buf(9)vring_interrupt(9)virtqueue_resize(9)virtqueue_reset(9)virtqueue_get_vring_size(9)virtqueue_map_alloc_coherent(9)virtqueue_map_free_coherent(9)virtqueue_map_page_attrs(9)virtqueue_unmap_page_attrs(9)virtqueue_map_single_attrs(9)virtqueue_unmap_single_attrs(9)virtqueue_map_mapping_error(9)virtqueue_map_need_sync(9)virtqueue_map_sync_single_range_for_device(9)
that's the whole squad, no cap. and yes, virtqueue_map_need_sync(9) is in there too β the one from the DESCRIPTION. told you it was important π
and that's the page, bestie! π§ this lil masterpiece lives in ./drivers/virtio and it's dated October 2026 β so it's from the future, which is very main character energy of it. mwah π π
π¦ 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