STRUCT FW_RSC_DEVMEM(9)
π struct fw_rsc_devmem(9) β iommu mapping request π
okay bestie, this is a page from the Kernel API Manual and it's literally about asking the host to iommu-map a chunk of memory for a remote processor. it's giving "polite request slip for memory access" energy and honestly? iconic. let's get into it β¨
β¨ SYNOPSIS β¨
struct fw_rsc_devmem {
u32 da;
u32 pa;
u32 len;
u32 flags;
u32 reserved;
u8 name[32];
};
bestie, that is the whole struct. six fields. no cap. let's meet them π«Ά
π Members π
daβ the device address. this is the address the device side is gonna use, okay? πpaβ the physical address. the real one. the one on actual hardware. π₯lenβ length, and yes, it's in bytes, so don't be out here guessing. πflagsβ the iommu protection flags. this is where you tell it how protected you want the mapping to be, iykyk πreservedβ reserved, and it must be zero. like, do not touch it, do not be cute with it, leave it at zero. periodt. πnameβ a human-readable name of the requested region to be mapped. it'su8 name[32], so keep it short β it's mainly for debugging purposes anyway ππΈ
πΈ Description πΈ
so here's the vibe: this resource entry is literally requesting that the host iommu-map a physically contiguous memory region for you. that's the whole job. π«‘
when do you actually need this? when the remote processor needs access to certain memory-based peripherals. that's the case. that's it.
β οΈ but bestie, listen β _never_ use this to access regular memory. like, ever. that is not what this is for and we do not do that here. π«
also, obviously, this is only needed if the remote processor is accessing memory via an iommu. no iommu, no need. simple as that. β¨
now for the field rundown, again, because it's important:
dashould specify the required device addresspashould specify the physical address we want to maplenshould specify the size of the mappingflagsis the IOMMU protection flags
and as always, name may (optionally!) contain a human readable name of this mapping β mainly for debugging purposes. optional! but cute and helpful. π
π Note π
okay so this is the part where I have to be real with you: at this point we just "trust" those devmem entries to contain valid physical addresses. trust. quotes and all. π
and lowkey that isn't safe, and it will be changed β that's the plan, not a rumour.
eventually we want remoteproc implementations to provide us ranges of physical addresses that the firmware is allowed to request. and then firmwares will not be allowed to request access to physical addresses outside those ranges. so: boundaries. safety. growth. we love to see it. πβ
π«Ά so rn: trust-based. soon: range-checked. don't build your whole personality on the trusting version, bestie.
π 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_carveout(9)struct fw_rsc_trace(9)struct fw_rsc_vdev_vring(9)struct fw_rsc_vdev(9)rsc_table_for_each_entry(9)
like, go read the whole friend group honestly, they all hang out in ./include/linux/rsc_table.h together π¦
and that's the page!! this lil gem lives in ./include/linux, and the version/date stamp on it is October 2026 β so yeah, it's from the future, main character energy fr fr. mwah, go map some peripherals responsibly πππ
π¦ 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