Re: [PATCH v2 16/20] vfio/cxl: Register regions with VFIO layer
From: Jason Gunthorpe
Date: Sat Apr 04 2026 - 14:53:55 EST
On Fri, Apr 03, 2026 at 12:35:45PM -0700, Dan Williams wrote:
> > + /*
> > + * CXL device memory is RAM, not MMIO. Use memremap() rather than
>
> Right, CXL.mem is RAM, not MMIO, so I question why is this not being
> mapped via a RAM mechanism? Can you explain a bit more about why reusing
> vfio MMIO mapping mechanisms is suitable here and what happens when we
> get to questions like guest_memfd integration, page conversions, and
> large page mapping support?
None of that is applicable to VFIO. VFIO owns the entire address space
and does not share it with the mm or anything else.
> Maybe this is the start of the conversation for something simple, but I
> would actually prefer uncached ioremap() if only to avoid all the
> coherence management and suitability of MMIO mechanisms questions.
The entire thing needs to be mmapable in a cache coherent way since
that is what the HW semantic is. If you try to do something else you
will break KVM support since it follows the VMA.
Jason