rproc_handle_carveout(9)
π rproc_handle_carveout(9) β the Kernel API Manual glow-up π
okay so bestie, we're in the Kernel API Manual and today's main character is rproc_handle_carveout(9). yes that's the whole title. slay. let's get into it β¨
β¨ NAME β¨
rproc_handle_carveout β handle phys contig memory allocation requests π
like, it handles the requests for physically contiguous memory allocation. that's the vibe check and it passed.
π¦ SYNOPSIS π¦
int rproc_handle_carveout (struct rproc *rproc , void *ptr , int offset
, int avail );
πΈ ARGUMENTS πΈ
rprocβ the rproc handle, your main character struct π«Άptrβ the resource entry, aka the thing we're actually looking atoffsetβ offset of the resource entry, so we know where we are in the lineupavailβ size of available data (for image validation), lowkey the safety net π
π₯ DESCRIPTION π₯
so this function will handle firmware requests for allocation of physically contiguous memory regions. literally that's the job. no cap π
these request entries should come first in the firmware's resource table, bestie, and I mean first β because other firmware entries might request placing other data objects inside these memory regions (e.g. data/code segments, trace resource entries, ...). it's giving "get in line, everyone else waits." π
allocating memory this way helps utilizing the reserved physical memory (e.g. CMA) more efficiently, and it also minimizes the number of TLB entries needed to map it (in case rproc is using an IOMMU). and reducing the TLB pressure is important β it may have a substantial impact on performance. that's not just a vibe, that's fr fr the truth β
ngl the ordering thing matters: carveout entries go up front or the other entries can't nest inside them. don't be the person who puts them last π
π RETURN π
0 on success, or an appropriate error code otherwise. iconic either way π
π SEE ALSO π
kernel file ./drivers/remoteproc/remoteproc_core.c and honestly 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_handle_devmem(9)rproc_alloc_carveout(9)rproc_release_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)
okay that's the whole page, mwah π this one lives in ./drivers/remoteproc and it's dated October 2026 β rproc_handle_carveout(9), forever and always π§π
π¦ 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