vmbus_alloc_buffer(9)
π vmbus_alloc_buffer(9) π
okay so this is from the Kernel API Manual bestie, and it's literally about grabbing yourself a host-visible, virtually-contiguous buffer. yes queen, memory allocation but make it fashion β¨
πΈ NAME πΈ
vmbus_alloc_buffer β allocate a host-visible, virtually-contiguous buffer.
π SYNOPSIS π
void * vmbus_alloc_buffer (struct vmbus_channel *channel , u32 size ,
struct page ***chunks_out , u32 *chunk_cnt_out );
β¨ ARGUMENTS β¨
channelβ the channel the buffer will be attached to. it's giving "where this baby lives" πsizeβ requested buffer size in bytes. heads up bestie, it will be rounded up toPAGE_SIZEπ«Άchunks_outβ on success, set to the array of underlying chunks, orNULLwhen the buffer was allocated withvzalloc. iykyk πchunk_cnt_outβ on success, set to the number of chunks. counting era π’
π DESCRIPTION π
so there's two whole vibes here depending on whether your buffer needs decryption or not:
- buffers not requiring decryption are allocated with
vzalloc. simple, clean, iconic β¨ - buffers requiring decryption are allocated as a series of physically-contiguous chunks, starting at
MAX_PAGE_ORDERand falling back to smaller orders on allocation failure. she tries big first and downsizes gracefully, no cap π
then each chunk is transitioned to host-visible via set_memory_decrypted on its direct-map address β like a glow-up for the direct map π« β and after that, all chunks are combined into a virtually-contiguous range via vmap. main character energy fr fr π
π₯ RETURN π₯
the buffer's virtual address, or NULL on failure. that's it that's the answer π
π¦ SEE ALSO π¦
Kernel file ./drivers/hv/channel.c and also these besties:
vmbus_free_buffer(9)request_arr_init(9)vmbus_sendpacket_getid(9)vmbus_sendpacket(9)__vmbus_recvpacket(9)
ok that's the whole page, go forth and allocate responsibly π«Άπ
this little masterpiece comes to you from ./drivers/hv, dated October 2026, and it's vmbus_alloc_buffer(9) signing off β slay, periodt, bye bestie ππΈ
π¦ 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