create_pte_array(9)
π create_pte_array(9) β Kernel API Manual, but make it make sense
okay bestie, buckle up, we're in the kernel API manual today and honestly? this one's short and sweet. it's create_pte_array from the kernel API manual, and it does exactly one thing but it does it iconically. π
β¨ NAME β¨
create_pte_array β creates a PTE array of a physically contiguous buffer π
like, literally what it says on the tin. no cap.
π¦ SYNOPSIS π¦
void create_pte_array (u64 *ptes , dma_addr_t addr , size_t size );
that's the whole signature. three args, returns void, no drama. πΈ
π ARGUMENTS π
ptesβ pointer to the array. this is where the good stuff goes. π«addrβ base address of physically contiguous buffer, and it'sGSP_PAGE_SIZEaligned (do NOT forget the alignment bestie, iykyk). β¨sizeβ size of the buffer. yeah. it's the size. π«Ά
π₯ DESCRIPTION π₯
so here's the vibe: GSP-RM sometimes expects physically-contiguous buffers to have an array of "PTEs" for each page in that buffer. that's just how it is. π
and yes, in theory that would allow for the buffer to be physically discontiguous β but GSP-RM does not currently support that. so we're not doing that. periodt. π
in this case, the PTEs are DMA addresses of each page of the buffer. and since the buffer is physically contiguous, calculating all the PTEs is simple math. that's the whole trick. ate and left no crumbs. π₯
also, see memdescGetPhysAddrsForGpu β that's the reference, go look at it. π
π SEE ALSO π
okay this list is long, grab a snack π:
Kernel file ./drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c
nvkm_gsp_mem_ctor(9)struct registry_list_entry(9)add_registry(9)build_registry(9)clean_registry(9)strip(9)r535_gsp_rpc_set_registry(9)r535_gsp_msg_run_cpu_sequencer(9)struct rpc_ucode_libos_print_v1e_08(9)r535_gsp_msg_libos_print(9)create_debugfs(9)r535_gsp_libos_debugfs_init(9)r535_gsp_libos_init(9)nvkm_gsp_radix3_sg(9)r535_debugfs_shutdown(9)is_empty(9)r535_gsp_copy_log(9)r535_gsp_retain_logging(9)r535_gsp_libos_debugfs_fini(9)
every single one of them. I checked twice. π
π§ the cute sign-off π§
this little icon of a page lives at ./drivers/gpu/drm/nouveau/nvkm... (yeah it's truncated, don't come for me, that's the source line fr fr) and it's dated October 2026 β so mark your calendars, she's from the future π«. and it's page create_pte_array(9), obviously, we've been talking about her this whole time. π
k bye, go build your PTE arrays, aligned and contiguous, like the main character you are. πβ¨
π¦ 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