rproc_handle_devmem(9)
π rproc_handle_devmem(9) β the Kernel API Manual, bestie edition β¨
okay so real talk: this is a page from the Kernel API Manual, section 9 (kernel routines, iykyk). Buckle up π
πΈ NAME πΈ
rproc_handle_devmem β handles a devmem resource entry. that's the whole vibe, she does one thing and she does it π
β SYNOPSIS β
int rproc_handle_devmem (struct rproc *rproc , void *ptr , int offset ,
int avail );
π¦ ARGUMENTS π¦
rprocβ the remote processor handle π«Ά this is the whole context, the main character, thestruct rproc *you're working onptrβ the devmem resource entry itself, no capoffsetβ where this resource entry sits, offset-wise πavailβ how much data is actually available β literally used for sanity checking the image, she's the vibe check for the firmware π§
π DESCRIPTION π
so remote processors commonly need to access certain on-chip peripherals. like, that's just their whole thing.
some of these remote processors access memory through an iommu device, and they might need us to configure their iommu before they can reach the on-chip peripherals they need. highkey a whole setup arc π₯
this resource entry is literally a request to map one of those peripheral devices.
these devmem entries carry the physical address of the device in the 'pa' member. if a specific device address is expected, then 'da' holds it β and jsyk, currently that's the only use case supported π (no other modes, periodt). 'len' holds the size of the physical region we need to map. π
currently we just "trust" those devmem entries to contain valid physical addresses. and by "trust" i mean we simply believe them π but that's going to change: the plan is that implementations tell us the ranges of physical addresses the firmware is allowed to request, and we don't let firmwares request access to physical addresses outside those ranges. so it's giving security glow-up, coming soon β¨
π RETURN π
0 on success, or an appropriate error code otherwise. that's it, that's the return π
π SEE ALSO π
Kernel file ./drivers/remoteproc/remoteproc_core.c, plus the whole friend group: rproc_da_to_va(9), rproc_find_carveout_by_name(9), rproc_check_carveout_da(9), rproc_handle_vdev(9), rproc_handle_trace(9), rproc_alloc_carveout(9), rproc_release_carveout(9), rproc_handle_carveout(9), rproc_add_carveout(9), rproc_mem_entry_init(9), rproc_of_resm_mem_entry_init(9), rproc_of_parse_firmware(9), rproc_alloc_registered_carveouts(9), rproc_resource_cleanup(9), rproc_trigger_recovery(9), rproc_crash_handler_work(9), rproc_boot(9), rproc_shutdown(9), rproc_detach(9), rproc_get_by_phandle(9), rproc_set_firmware(9), rproc_add(9), devm_rproc_add(9), rproc_type_release(9), rproc_alloc(9), rproc_free(9), rproc_put(9), rproc_del(9), devm_rproc_alloc(9), rproc_add_subdev(9), rproc_remove_subdev(9), rproc_get_by_child(9), rproc_report_crash(9). go read all of them, i'll wait π
ngl bestie the takeaway is: devmem entries carrypa,daandlen, we currently trust them fully, and we're gonna stop trusting them. character development π
byeeeee π«Ά this gem dropped in the ./drivers/remoteproc source tree, October 2026 (version energy: rproc_handle_devmem(9)), and that's the page, slay β¨π
π
π¦ 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