On Wed, 7 Jan 2026 19:36:44 -0800 Alex Mastro amastro@fb.com wrote:
On Wed, Jan 07, 2026 at 11:54:09PM +0000, David Matlack wrote:
Speaking of, maybe we can add a test that creating writable IOMMU mappings fails for read-only BARs?
I think I'll have to look into this as a follow-on. I'm not sure how to validate it yet without mocks or similar since I don't have such HW.
I think the read-only aspect would be in the mmap, not the BAR itself, ie. can we create a read-write DMA mapping to a read-only mmap.
ROM BARs are the only BARs that are read-only, but they can share a decoder with the standard BARs and therefore have a separate enable in the BAR register itself. Due to this, and their general usage, it's never been necessary to allow mmap of the ROM BAR, therefore we cannot actually DMA map the ROM BAR. Thanks,
Alex