Re: [PATCH v2 16/20] vfio/cxl: Register regions with VFIO layer
From: Gregory Price
Date: Tue Apr 07 2026 - 10:19:01 EST
On Mon, Apr 06, 2026 at 07:05:21PM -0300, Jason Gunthorpe wrote:
> On Mon, Apr 06, 2026 at 05:22:06PM -0400, Gregory Price wrote:
> > On Sat, Apr 04, 2026 at 12:36:53PM -0700, Dan Williams wrote:
> > > Jason Gunthorpe wrote:
>
> I would expect this to happen via the request_resource mechanism, if
> MM is using the CXL range it should be locked in the resource tree and
> vfio should request it and then fail during the initial startup
> phases.
>
> > I need to read up a little bit on this area, but i don't see the "needs
> > to be mmap'able in a cache coherent way" to be an argument for one
> > particular method or another (hotplug, private node, memremap, etc).
>
> It is speaking to what VFIO has to do. It is the exclusive owner of
> the physical range, it does not have struct pages, it must be cachable
> for VFIO and KVM to work - not alot of choices here. Turn the
> phys_addr_t's into large cachable special PTEs inside a VMA.
>
Right - the observation here is essentially "if you need struct page and
need to get fancy with them...". But if you just need to plonk a
region into one set of page tables and move on - then this is fine and
arguable preferable.
~Gregory