Re: [PATCH v4 14/27] vfio: Add CXL region type for the HDM region
From: Alex Williamson
Date: Thu Aug 27 2026 - 18:44:15 EST
On Thu, 13 Aug 2026 15:06:18 +0530
<mhonap@xxxxxxxxxx> wrote:
> From: Manish Honap <mhonap@xxxxxxxxxx>
>
> A CXL Type-2 device exposes its HDM memory to the guest as a dedicated
> VFIO region rather than a PCI BAR. Add a CXL region type and a memory
> sub-type for it; vfio-cxl registers the window under these so userspace
> can discover and map it.
>
> Signed-off-by: Manish Honap <mhonap@xxxxxxxxxx>
> ---
> include/uapi/linux/vfio.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index 5de618a3a5ee..540e62312671 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -345,6 +345,7 @@ struct vfio_region_info_cap_type {
> #define VFIO_REGION_TYPE_GFX (1)
> #define VFIO_REGION_TYPE_CCW (2)
> #define VFIO_REGION_TYPE_MIGRATION_DEPRECATED (3)
> +#define VFIO_REGION_TYPE_CXL (4)
>
> /* sub-types for VFIO_REGION_TYPE_PCI_* */
>
> @@ -373,6 +374,10 @@ struct vfio_region_info_cap_type {
> /* sub-types for VFIO_REGION_TYPE_GFX */
> #define VFIO_REGION_SUBTYPE_GFX_EDID (1)
>
> +/* sub-types for VFIO_REGION_TYPE_CXL */
> +/* CXL.mem HDM region of a Type-2 device, mmap-able */
> +#define VFIO_REGION_SUBTYPE_CXL_MEM (1)
> +
> /**
> * struct vfio_region_gfx_edid - EDID region layout.
> *
CXL has a PCI vendor ID, it's even used in the dvsec capability. Why
not use a PCI vendor type region? Thanks,
Alex