On Thu, Jan 8, 2026 at 7:42 AM Alex Williamson <[email protected]> wrote:
>
> On Wed, 7 Jan 2026 19:36:44 -0800
> Alex Mastro <[email protected]> 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.

Good point. So it'd be better to have a test of that in
vfio_dma_mapping_test. No need to use a BAR mapping.

> 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,

Ahh, good to know, thanks for the context!

Reply via email to