[PATCH v4 14/27] vfio: Add CXL region type for the HDM region

From: mhonap

Date: Thu Aug 13 2026 - 05:48:20 EST


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.
*
--
2.25.1