STRUCT FW_RSC_CARVEOUT(9)
β¨ struct fw_rsc_carveout(9) β¨
okay bestie, welcome to the Kernel API Manual π you're about to meet struct fw_rsc_carveout β the "hey host, can I please get some physically contiguous memory" request. it's giving main character energy for firmware resource tables π
πΈ NAME πΈ
struct fw_rsc_carveout β a request for physically contiguous memory, no cap π
π SYNOPSIS π
struct fw_rsc_carveout {
u32 da;
u32 pa;
u32 len;
u32 flags;
u32 reserved;
u8 name[32];
};
π¦ Members π¦
daβ the device address β¨paβ the physical address πlenβ the length, and yes queen, it's in bytes πflagsβ the iommu protection flags π₯reservedβ reservedβ¦ and it must be zero (don't be quirky about this one, seriously) πnameβ a human-readable name for the memory region you're requesting π·οΈ
π Description π
so basically: this resource entry asks the host to allocate a physically contiguous memory region. that's the whole vibe π«Ά
these request entries should come before other firmware resource entries, because other entries might ask to place other data objects inside these very memory regions (think data/code segments, trace resource entries, ...). order matters, iykyk β
allocating memory this way helps you use the reserved physical memory (like CMA, for example) more efficiently β slay β and it also minimizes the number of TLB entries you need to map it, in case rproc is using an IOMMU. reducing TLB pressure is important, like genuinely, it can have a substantial impact on performance π
if the firmware is compiled with static addresses, then da should specify the expected device address of this memory region. but if da is set to FW_RSC_ADDR_ANY, the host will dynamically allocate it, and then overwrite da with the dynamically allocated address β¨
we will always use da to negotiate the device addresses β even if it isn't using an iommu. in that case though, it will obviously contain physical addresses π
some remote processors need to know the allocated physical address even if they do use an iommu. this is needed, e.g., if they control hardware accelerators which access the physical memory directly (this is exactly the case with OMAP4 for instance). in that case, the host will overwrite pa with the dynamically allocated physical address π
generally we don't want to expose physical addresses if we don't have to β remote processors are generally _not_ trusted β so we might want to change this to happen _only_ when explicitly required by the hardware. so, yeah, that's a whole thing π
flags is used to provide IOMMU protection flags, and name should (optionally) contain a human readable name of this carveout region β mainly for debugging purposes π
π SEE ALSO π
- Kernel file
./include/linux/rsc_table.h struct resource_table(9)struct fw_rsc_hdr(9)enum fw_resource_type(9)struct fw_rsc_devmem(9)struct fw_rsc_trace(9)struct fw_rsc_vdev_vring(9)struct fw_rsc_vdev(9)rsc_table_for_each_entry(9)
that's the whole page bestie, you ate that π
β¨ this one lives in ./include/linux, from the October 2026 edition of the Kernel API Manual β go forth and carve out some memory, periodt ππ
π¦ 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