virtqueue_ma...loc_coherent(9)
π virtqueue_ma...loc_coherent(9) β like, the Kernel API Manual page, bestie π
okay so this one lives in the Kernel API Manual and the function name is a whole mouthful: virtqueue_map_alloc_coherent. Don't panic, it's actually chill. Let's get into it β¨
β¨ NAME β¨
virtqueue_map_alloc_coherent β alloc coherent mapping π«Ά
πΈ SYNOPSIS πΈ
void * virtqueue_map_alloc_coherent (struct virtio_device *vdev , union
virtio_map map , size_t size , dma_addr_t *map_handle , gfp_t gfp );
like yes she's long but she's worth it π
π¦ ARGUMENTS π¦
vdevβ the virtio device we are talking to π¬ (literally the other half of the conversation)mapβ metadata for performing mapping ποΈsizeβ the size of the buffer πmap_handleβ the pointer to the mapped address πgfpβ allocation flag (GFP_XXX) π±
β DESCRIPTION β
so basically: return virtual address or NULL on error π that's the whole vibe. no cap.
lowkey important: if you get NULL back, that's the error signal β not a cute little empty result. handle it π
π SEE ALSO π
she's in the kernel file ./drivers/virtio/virtio_ring.c and honestly her whole friend group is huge, so here's the full squad, no gatekeeping π«Ά:
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_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_cpu(9)virtqueue_map_sync_single_range_for_device(9)
okay that's the whole page, mwah π it's from ./drivers/virtio, dated October 2026, and it's literally titled virtqueue_ma...loc_coherent(9) β yes the title is truncated with dots, no that's not a typo, that's just how she's listed π
β¨ go read the kernel source bestie, 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