[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALzav=ctJBKYsYQ47XMHDQ_whzF=XpcsN6B6GmGc9gy4-tPfzg@mail.gmail.com>
Date: Thu, 8 Jan 2026 10:20:22 -0800
From: David Matlack <dmatlack@...gle.com>
To: Alex Williamson <alex@...zbot.org>
Cc: Alex Mastro <amastro@...com>, Shuah Khan <shuah@...nel.org>, Peter Xu <peterx@...hat.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org, Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH] vfio: selftests: Add vfio_dma_mapping_mmio_test
On Thu, Jan 8, 2026 at 7:42 AM Alex Williamson <alex@...zbot.org> wrote:
>
> On Wed, 7 Jan 2026 19:36:44 -0800
> Alex Mastro <amastro@...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.
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!
Powered by blists - more mailing lists