Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap
@ 2026-01-28  0:48 Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

The dma-map IOVA alloc, link, and sync APIs perform significantly better
than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
This difference is especially noticeable when mapping a 2MB region in
4KB pages.

Use dma-map IOVA alloc, link, and sync APIs for GPU SVM and DRM page,
which mappings between the CPU and GPU.

Initial results are promising.

Baseline CPU time during 2M / 64K fault with a migration:
Average migrate 2M cpu time (us, percentage): 552.36049107142857142857, .71943789893868318799
Average migrate 64K cpu time (us, percentage): 24.97767857142857142857, .34789908128526791960

After patch 4 in this series CPU time during 2M / 64K fault with a migration:
Average migrate 2M cpu time (us, percentage): 224.81808035714285714286, .51412827364772602557
Average migrate 64K cpu time (us, percentage): 14.65625000000000000000, .25659463050529524405

After patch 5 in this series CPU time during 2M / 64K fault with a migration:
Average migrate 2M cpu time (us, percentage): 158.52901785714285714286, .42740093699505625280
Average migrate 64K cpu time (us, percentage): 14.00000000000000000000, .23276613905846987437

- Patches 2-4 implement dma-map IOVA API for system pages

- Patch 5 optimizes this a bit but questionable if we need if this
  needed if 2M pages are enabled

- Patches 6-11 implement a IOVA API for multi-GPU PoC. I'm told drivers
  shouldn't call dma-map IOVA API for multi-device but including it as
  reference for a design we'd like to get to with high-speed fabrics in
  mind.

Still an RFC as patches 6-11 may not be able to merged in there current
form, the series can be split if needed to merge eariler patches.

Matt

v2:
 - Include missing basline patch for CI
v3:
 - Fix memory corruption
 - PoC IOVA alloc for multi-GPU

Francois Dugast (1):
  drm/pagemap: Add helper to access zone_device_data

Matthew Brost (10):
  drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
  drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system
  drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM
    pagemap
  drm/pagemap: Reduce number of IOVA link calls
  drm/pagemap: Add IOVA interface to DRM pagemap
  drm/xe: Stub out DRM pagemap IOVA alloc implementation
  drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for
    DRM pagemap
  drm/xe: Drop BO dma-resv lock during SVM migrate-to-device
  drm/xe: Implement DRM pagemap IOVA vfuncs
  drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU
    SVM

 drivers/gpu/drm/drm_gpusvm.c  | 196 ++++++++++++++++---
 drivers/gpu/drm/drm_pagemap.c | 351 +++++++++++++++++++++++++++-------
 drivers/gpu/drm/xe/xe_svm.c   | 143 +++++++++++++-
 include/drm/drm_gpusvm.h      |   5 +
 include/drm/drm_pagemap.h     | 101 ++++++++++
 5 files changed, 693 insertions(+), 103 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28 13:53   ` Leon Romanovsky
  2026-01-28  0:48 ` [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

From: Francois Dugast <francois.dugast@intel.com>

This new helper helps ensure all accesses to zone_device_data use the
correct API whether the page is part of a folio or not.

v2:
- Move to drm_pagemap.h, stick to folio_zone_device_data (Matthew Brost)
- Return struct drm_pagemap_zdd * (Matthew Brost)

Suggested-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
---
 drivers/gpu/drm/drm_gpusvm.c  |  7 +++++--
 drivers/gpu/drm/drm_pagemap.c | 21 ++++++++++++---------
 include/drm/drm_pagemap.h     | 14 ++++++++++++++
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index aa9a0b60e727..585d913d3d19 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1488,12 +1488,15 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 		order = drm_gpusvm_hmm_pfn_to_order(pfns[i], i, npages);
 		if (is_device_private_page(page) ||
 		    is_device_coherent_page(page)) {
+			struct drm_pagemap_zdd *__zdd =
+				drm_pagemap_page_zone_device_data(page);
+
 			if (!ctx->allow_mixed &&
-			    zdd != page->zone_device_data && i > 0) {
+			    zdd != __zdd && i > 0) {
 				err = -EOPNOTSUPP;
 				goto err_unmap;
 			}
-			zdd = page->zone_device_data;
+			zdd = __zdd;
 			if (pagemap != page_pgmap(page)) {
 				if (i > 0) {
 					err = -EOPNOTSUPP;
diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
index 03ee39a761a4..2c67aabd8d65 100644
--- a/drivers/gpu/drm/drm_pagemap.c
+++ b/drivers/gpu/drm/drm_pagemap.c
@@ -244,7 +244,7 @@ static int drm_pagemap_migrate_map_pages(struct device *dev,
 		order = folio_order(folio);
 
 		if (is_device_private_page(page)) {
-			struct drm_pagemap_zdd *zdd = page->zone_device_data;
+			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 			struct drm_pagemap *dpagemap = zdd->dpagemap;
 			struct drm_pagemap_addr addr;
 
@@ -315,7 +315,7 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
 			goto next;
 
 		if (is_zone_device_page(page)) {
-			struct drm_pagemap_zdd *zdd = page->zone_device_data;
+			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 			struct drm_pagemap *dpagemap = zdd->dpagemap;
 
 			dpagemap->ops->device_unmap(dpagemap, dev, pagemap_addr[i]);
@@ -603,7 +603,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
 
 		pages[i] = NULL;
 		if (src_page && is_device_private_page(src_page)) {
-			struct drm_pagemap_zdd *src_zdd = src_page->zone_device_data;
+			struct drm_pagemap_zdd *src_zdd =
+				drm_pagemap_page_zone_device_data(src_page);
 
 			if (page_pgmap(src_page) == pagemap &&
 			    !mdetails->can_migrate_same_pagemap) {
@@ -725,8 +726,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
 			goto next;
 
 		if (fault_page) {
-			if (src_page->zone_device_data !=
-			    fault_page->zone_device_data)
+			if (drm_pagemap_page_zone_device_data(src_page) !=
+			    drm_pagemap_page_zone_device_data(fault_page))
 				goto next;
 		}
 
@@ -1067,7 +1068,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	void *buf;
 	int i, err = 0;
 
-	zdd = page->zone_device_data;
+	zdd = drm_pagemap_page_zone_device_data(page);
 	if (time_before64(get_jiffies_64(), zdd->devmem_allocation->timeslice_expiration))
 		return 0;
 
@@ -1150,7 +1151,9 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
  */
 static void drm_pagemap_folio_free(struct folio *folio)
 {
-	drm_pagemap_zdd_put(folio->page.zone_device_data);
+	struct page *page = folio_page(folio, 0);
+
+	drm_pagemap_zdd_put(drm_pagemap_page_zone_device_data(page));
 }
 
 /**
@@ -1166,7 +1169,7 @@ static void drm_pagemap_folio_free(struct folio *folio)
  */
 static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
 {
-	struct drm_pagemap_zdd *zdd = vmf->page->zone_device_data;
+	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(vmf->page);
 	int err;
 
 	err = __drm_pagemap_migrate_to_ram(vmf->vma,
@@ -1232,7 +1235,7 @@ EXPORT_SYMBOL_GPL(drm_pagemap_devmem_init);
  */
 struct drm_pagemap *drm_pagemap_page_to_dpagemap(struct page *page)
 {
-	struct drm_pagemap_zdd *zdd = page->zone_device_data;
+	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 
 	return zdd->devmem_allocation->dpagemap;
 }
diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
index 2baf0861f78f..14e1db564c25 100644
--- a/include/drm/drm_pagemap.h
+++ b/include/drm/drm_pagemap.h
@@ -4,6 +4,7 @@
 
 #include <linux/dma-direction.h>
 #include <linux/hmm.h>
+#include <linux/memremap.h>
 #include <linux/types.h>
 
 #define NR_PAGES(order) (1U << (order))
@@ -341,6 +342,19 @@ struct drm_pagemap_migrate_details {
 	u32 source_peer_migrates : 1;
 };
 
+/**
+ * drm_pagemap_page_zone_device_data() - Page to zone_device_data
+ * @page: Pointer to the page
+ *
+ * Return: Page's zone_device_data
+ */
+static inline struct drm_pagemap_zdd *drm_pagemap_page_zone_device_data(struct page *page)
+{
+	struct folio *folio = page_folio(page);
+
+	return folio_zone_device_data(folio);
+}
+
 #if IS_ENABLED(CONFIG_ZONE_DEVICE)
 
 int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28 14:04   ` Leon Romanovsky
  2026-01-28  0:48 ` [RFC PATCH v3 03/11] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system Matthew Brost
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

The dma-map IOVA alloc, link, and sync APIs perform significantly better
than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
This difference is especially noticeable when mapping a 2MB region in
4KB pages.

Use the IOVA alloc, link, and sync APIs for GPU SVM, which create DMA
mappings between the CPU and GPU.

v3:
 - Always link IOVA in mixed mappings
 - Sync IOVA

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_gpusvm.c | 87 ++++++++++++++++++++++++++++--------
 include/drm/drm_gpusvm.h     |  3 ++
 2 files changed, 71 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index 585d913d3d19..084e78fa0f32 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1139,19 +1139,26 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
 		struct drm_gpusvm_pages_flags flags = {
 			.__flags = svm_pages->flags.__flags,
 		};
+		struct dma_iova_state __state = {};
 
-		for (i = 0, j = 0; i < npages; j++) {
-			struct drm_pagemap_addr *addr = &svm_pages->dma_addr[j];
-
-			if (addr->proto == DRM_INTERCONNECT_SYSTEM)
-				dma_unmap_page(dev,
-					       addr->addr,
-					       PAGE_SIZE << addr->order,
-					       addr->dir);
-			else if (dpagemap && dpagemap->ops->device_unmap)
-				dpagemap->ops->device_unmap(dpagemap,
-							    dev, *addr);
-			i += 1 << addr->order;
+		if (dma_use_iova(&svm_pages->state)) {
+			dma_iova_destroy(dev, &svm_pages->state,
+					 npages * PAGE_SIZE,
+					 svm_pages->dma_addr[0].dir, 0);
+		} else {
+			for (i = 0, j = 0; i < npages; j++) {
+				struct drm_pagemap_addr *addr = &svm_pages->dma_addr[j];
+
+				if (addr->proto == DRM_INTERCONNECT_SYSTEM)
+					dma_unmap_page(dev,
+						       addr->addr,
+						       PAGE_SIZE << addr->order,
+						       addr->dir);
+				else if (dpagemap && dpagemap->ops->device_unmap)
+					dpagemap->ops->device_unmap(dpagemap,
+								    dev, *addr);
+				i += 1 << addr->order;
+			}
 		}
 
 		/* WRITE_ONCE pairs with READ_ONCE for opportunistic checks */
@@ -1161,6 +1168,7 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
 
 		drm_pagemap_put(svm_pages->dpagemap);
 		svm_pages->dpagemap = NULL;
+		svm_pages->state = __state;
 	}
 }
 
@@ -1402,12 +1410,14 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 	unsigned long num_dma_mapped;
 	unsigned int order = 0;
 	unsigned long *pfns;
+	phys_addr_t last_phys;
 	int err = 0;
 	struct dev_pagemap *pagemap;
 	struct drm_pagemap *dpagemap;
 	struct drm_gpusvm_pages_flags flags;
 	enum dma_data_direction dma_dir = ctx->read_only ? DMA_TO_DEVICE :
 							   DMA_BIDIRECTIONAL;
+	struct dma_iova_state *state = &svm_pages->state;
 
 retry:
 	if (time_after(jiffies, timeout))
@@ -1496,6 +1506,17 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 				err = -EOPNOTSUPP;
 				goto err_unmap;
 			}
+
+			if (dma_use_iova(state)) {
+				err = dma_iova_link(gpusvm->drm->dev, state,
+						    last_phys,
+						    i * PAGE_SIZE,
+						    PAGE_SIZE << order,
+						    dma_dir, 0);
+				if (err)
+					goto err_unmap;
+			}
+
 			zdd = __zdd;
 			if (pagemap != page_pgmap(page)) {
 				if (i > 0) {
@@ -1539,13 +1560,34 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 				goto err_unmap;
 			}
 
-			addr = dma_map_page(gpusvm->drm->dev,
-					    page, 0,
-					    PAGE_SIZE << order,
-					    dma_dir);
-			if (dma_mapping_error(gpusvm->drm->dev, addr)) {
-				err = -EFAULT;
-				goto err_unmap;
+			if (!i)
+				dma_iova_try_alloc(gpusvm->drm->dev, state,
+						   npages * PAGE_SIZE >=
+						   HPAGE_PMD_SIZE ?
+						   HPAGE_PMD_SIZE : 0,
+						   npages * PAGE_SIZE);
+
+			if (dma_use_iova(state)) {
+				last_phys = page_to_phys(page);
+
+				err = dma_iova_link(gpusvm->drm->dev, state,
+						    page_to_phys(page),
+						    i * PAGE_SIZE,
+						    PAGE_SIZE << order,
+						    dma_dir, 0);
+				if (err)
+					goto err_unmap;
+
+				addr = state->addr + i * PAGE_SIZE;
+			} else {
+				addr = dma_map_page(gpusvm->drm->dev,
+						    page, 0,
+						    PAGE_SIZE << order,
+						    dma_dir);
+				if (dma_mapping_error(gpusvm->drm->dev, addr)) {
+					err = -EFAULT;
+					goto err_unmap;
+				}
 			}
 
 			svm_pages->dma_addr[j] = drm_pagemap_addr_encode
@@ -1557,6 +1599,13 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 		flags.has_dma_mapping = true;
 	}
 
+	if (dma_use_iova(state)) {
+		err = dma_iova_sync(gpusvm->drm->dev, state, 0,
+				    npages * PAGE_SIZE);
+		if (err)
+			goto err_unmap;
+	}
+
 	if (pagemap) {
 		flags.has_devmem_pages = true;
 		drm_pagemap_get(dpagemap);
diff --git a/include/drm/drm_gpusvm.h b/include/drm/drm_gpusvm.h
index 2578ac92a8d4..6772d8a92788 100644
--- a/include/drm/drm_gpusvm.h
+++ b/include/drm/drm_gpusvm.h
@@ -6,6 +6,7 @@
 #ifndef __DRM_GPUSVM_H__
 #define __DRM_GPUSVM_H__
 
+#include <linux/dma-mapping.h>
 #include <linux/kref.h>
 #include <linux/interval_tree.h>
 #include <linux/mmu_notifier.h>
@@ -136,6 +137,7 @@ struct drm_gpusvm_pages_flags {
  * @dma_addr: Device address array
  * @dpagemap: The struct drm_pagemap of the device pages we're dma-mapping.
  *            Note this is assuming only one drm_pagemap per range is allowed.
+ * @state: DMA IOVA state for mapping.
  * @notifier_seq: Notifier sequence number of the range's pages
  * @flags: Flags for range
  * @flags.migrate_devmem: Flag indicating whether the range can be migrated to device memory
@@ -147,6 +149,7 @@ struct drm_gpusvm_pages_flags {
 struct drm_gpusvm_pages {
 	struct drm_pagemap_addr *dma_addr;
 	struct drm_pagemap *dpagemap;
+	struct dma_iova_state state;
 	unsigned long notifier_seq;
 	struct drm_gpusvm_pages_flags flags;
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 03/11] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Split drm_pagemap_migrate_map_pages into device / system helpers clearly
seperating these operations. Will help with upcoming changes to split
IOVA allocation steps.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_pagemap.c | 146 ++++++++++++++++++++++------------
 1 file changed, 96 insertions(+), 50 deletions(-)

diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
index 2c67aabd8d65..4b79d4019453 100644
--- a/drivers/gpu/drm/drm_pagemap.c
+++ b/drivers/gpu/drm/drm_pagemap.c
@@ -205,7 +205,7 @@ static void drm_pagemap_get_devmem_page(struct page *page,
 }
 
 /**
- * drm_pagemap_migrate_map_pages() - Map migration pages for GPU SVM migration
+ * drm_pagemap_migrate_map_device_pages() - Map device migration pages for GPU SVM migration
  * @dev: The device performing the migration.
  * @local_dpagemap: The drm_pagemap local to the migrating device.
  * @pagemap_addr: Array to store DMA information corresponding to mapped pages.
@@ -221,19 +221,22 @@ static void drm_pagemap_get_devmem_page(struct page *page,
  *
  * Returns: 0 on success, -EFAULT if an error occurs during mapping.
  */
-static int drm_pagemap_migrate_map_pages(struct device *dev,
-					 struct drm_pagemap *local_dpagemap,
-					 struct drm_pagemap_addr *pagemap_addr,
-					 unsigned long *migrate_pfn,
-					 unsigned long npages,
-					 enum dma_data_direction dir,
-					 const struct drm_pagemap_migrate_details *mdetails)
+static int
+drm_pagemap_migrate_map_device_pages(struct device *dev,
+				     struct drm_pagemap *local_dpagemap,
+				     struct drm_pagemap_addr *pagemap_addr,
+				     unsigned long *migrate_pfn,
+				     unsigned long npages,
+				     enum dma_data_direction dir,
+				     const struct drm_pagemap_migrate_details *mdetails)
 {
 	unsigned long num_peer_pages = 0, num_local_pages = 0, i;
 
 	for (i = 0; i < npages;) {
 		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
-		dma_addr_t dma_addr;
+		struct drm_pagemap_zdd *zdd;
+		struct drm_pagemap *dpagemap;
+		struct drm_pagemap_addr addr;
 		struct folio *folio;
 		unsigned int order = 0;
 
@@ -243,36 +246,26 @@ static int drm_pagemap_migrate_map_pages(struct device *dev,
 		folio = page_folio(page);
 		order = folio_order(folio);
 
-		if (is_device_private_page(page)) {
-			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
-			struct drm_pagemap *dpagemap = zdd->dpagemap;
-			struct drm_pagemap_addr addr;
-
-			if (dpagemap == local_dpagemap) {
-				if (!mdetails->can_migrate_same_pagemap)
-					goto next;
+		WARN_ON_ONCE(!is_device_private_page(page));
 
-				num_local_pages += NR_PAGES(order);
-			} else {
-				num_peer_pages += NR_PAGES(order);
-			}
+		zdd = drm_pagemap_page_zone_device_data(page);
+		dpagemap = zdd->dpagemap;
 
-			addr = dpagemap->ops->device_map(dpagemap, dev, page, order, dir);
-			if (dma_mapping_error(dev, addr.addr))
-				return -EFAULT;
+		if (dpagemap == local_dpagemap) {
+			if (!mdetails->can_migrate_same_pagemap)
+				goto next;
 
-			pagemap_addr[i] = addr;
+			num_local_pages += NR_PAGES(order);
 		} else {
-			dma_addr = dma_map_page(dev, page, 0, page_size(page), dir);
-			if (dma_mapping_error(dev, dma_addr))
-				return -EFAULT;
-
-			pagemap_addr[i] =
-				drm_pagemap_addr_encode(dma_addr,
-							DRM_INTERCONNECT_SYSTEM,
-							order, dir);
+			num_peer_pages += NR_PAGES(order);
 		}
 
+		addr = dpagemap->ops->device_map(dpagemap, dev, page, order, dir);
+		if (dma_mapping_error(dev, addr.addr))
+			return -EFAULT;
+
+		pagemap_addr[i] = addr;
+
 next:
 		i += NR_PAGES(order);
 	}
@@ -287,6 +280,59 @@ static int drm_pagemap_migrate_map_pages(struct device *dev,
 	return 0;
 }
 
+/**
+ * drm_pagemap_migrate_map_system_pages() - Map system migration pages for GPU SVM migration
+ * @dev: The device performing the migration.
+ * @pagemap_addr: Array to store DMA information corresponding to mapped pages.
+ * @migrate_pfn: Array of page frame numbers of system pages or peer pages to map.
+ * @npages: Number of system pages or peer pages to map.
+ * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
+ *
+ * This function maps pages of memory for migration usage in GPU SVM. It
+ * iterates over each page frame number provided in @migrate_pfn, maps the
+ * corresponding page, and stores the DMA address in the provided @dma_addr
+ * array.
+ *
+ * Returns: 0 on success, -EFAULT if an error occurs during mapping.
+ */
+static int
+drm_pagemap_migrate_map_system_pages(struct device *dev,
+				     struct drm_pagemap_addr *pagemap_addr,
+				     unsigned long *migrate_pfn,
+				     unsigned long npages,
+				     enum dma_data_direction dir)
+{
+	unsigned long i;
+
+	for (i = 0; i < npages;) {
+		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
+		dma_addr_t dma_addr;
+		struct folio *folio;
+		unsigned int order = 0;
+
+		if (!page)
+			goto next;
+
+		WARN_ON_ONCE(is_device_private_page(page));
+		folio = page_folio(page);
+		order = folio_order(folio);
+
+		dma_addr = dma_map_page(dev, page, 0, page_size(page), dir);
+		if (dma_mapping_error(dev, dma_addr))
+			return -EFAULT;
+
+		pagemap_addr[i] =
+			drm_pagemap_addr_encode(dma_addr,
+						DRM_INTERCONNECT_SYSTEM,
+						order, dir);
+
+next:
+		i += NR_PAGES(order);
+	}
+
+	return 0;
+}
+
 /**
  * drm_pagemap_migrate_unmap_pages() - Unmap pages previously mapped for GPU SVM migration
  * @dev: The device for which the pages were mapped
@@ -347,9 +393,11 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 				    const struct drm_pagemap_migrate_details *mdetails)
 
 {
-	int err = drm_pagemap_migrate_map_pages(remote_device, remote_dpagemap,
-						pagemap_addr, local_pfns,
-						npages, DMA_FROM_DEVICE, mdetails);
+	int err = drm_pagemap_migrate_map_device_pages(remote_device,
+						       remote_dpagemap,
+						       pagemap_addr, local_pfns,
+						       npages, DMA_FROM_DEVICE,
+						       mdetails);
 
 	if (err)
 		goto out;
@@ -368,12 +416,11 @@ drm_pagemap_migrate_sys_to_dev(struct drm_pagemap_devmem *devmem,
 			       struct page *local_pages[],
 			       struct drm_pagemap_addr pagemap_addr[],
 			       unsigned long npages,
-			       const struct drm_pagemap_devmem_ops *ops,
-			       const struct drm_pagemap_migrate_details *mdetails)
+			       const struct drm_pagemap_devmem_ops *ops)
 {
-	int err = drm_pagemap_migrate_map_pages(devmem->dev, devmem->dpagemap,
-						pagemap_addr, sys_pfns, npages,
-						DMA_TO_DEVICE, mdetails);
+	int err = drm_pagemap_migrate_map_system_pages(devmem->dev,
+						       pagemap_addr, sys_pfns,
+						       npages, DMA_TO_DEVICE);
 
 	if (err)
 		goto out;
@@ -437,7 +484,7 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 						     &pages[last->start],
 						     &pagemap_addr[last->start],
 						     cur->start - last->start,
-						     last->ops, mdetails);
+						     last->ops);
 
 out:
 	*last = *cur;
@@ -954,7 +1001,6 @@ EXPORT_SYMBOL(drm_pagemap_put);
 int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 {
 	const struct drm_pagemap_devmem_ops *ops = devmem_allocation->ops;
-	struct drm_pagemap_migrate_details mdetails = {};
 	unsigned long npages, mpages = 0;
 	struct page **pages;
 	unsigned long *src, *dst;
@@ -993,10 +1039,10 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	if (err || !mpages)
 		goto err_finalize;
 
-	err = drm_pagemap_migrate_map_pages(devmem_allocation->dev,
-					    devmem_allocation->dpagemap, pagemap_addr,
-					    dst, npages, DMA_FROM_DEVICE,
-					    &mdetails);
+	err = drm_pagemap_migrate_map_system_pages(devmem_allocation->dev,
+						   pagemap_addr,
+						   dst, npages,
+						   DMA_FROM_DEVICE);
 	if (err)
 		goto err_finalize;
 
@@ -1057,7 +1103,6 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 		MIGRATE_VMA_SELECT_DEVICE_COHERENT,
 		.fault_page	= page,
 	};
-	struct drm_pagemap_migrate_details mdetails = {};
 	struct drm_pagemap_zdd *zdd;
 	const struct drm_pagemap_devmem_ops *ops;
 	struct device *dev = NULL;
@@ -1115,8 +1160,9 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	if (err)
 		goto err_finalize;
 
-	err = drm_pagemap_migrate_map_pages(dev, zdd->dpagemap, pagemap_addr, migrate.dst, npages,
-					    DMA_FROM_DEVICE, &mdetails);
+	err = drm_pagemap_migrate_map_system_pages(dev, pagemap_addr,
+						   migrate.dst, npages,
+						   DMA_FROM_DEVICE);
 	if (err)
 		goto err_finalize;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (2 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 03/11] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28 14:28   ` Leon Romanovsky
  2026-01-28  0:48 ` [RFC PATCH v3 05/11] drm/pagemap: Reduce number of IOVA link calls Matthew Brost
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

The dma-map IOVA alloc, link, and sync APIs perform significantly better
than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
This difference is especially noticeable when mapping a 2MB region in
4KB pages.

Use the IOVA alloc, link, and sync APIs for DRM pagemap, which create DMA
mappings between the CPU and GPU for copying data.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_pagemap.c | 121 +++++++++++++++++++++++++++-------
 1 file changed, 96 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
index 4b79d4019453..b928c89f4bd1 100644
--- a/drivers/gpu/drm/drm_pagemap.c
+++ b/drivers/gpu/drm/drm_pagemap.c
@@ -287,6 +287,7 @@ drm_pagemap_migrate_map_device_pages(struct device *dev,
  * @migrate_pfn: Array of page frame numbers of system pages or peer pages to map.
  * @npages: Number of system pages or peer pages to map.
  * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
+ * @state: DMA IOVA state for mapping.
  *
  * This function maps pages of memory for migration usage in GPU SVM. It
  * iterates over each page frame number provided in @migrate_pfn, maps the
@@ -300,26 +301,79 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
 				     struct drm_pagemap_addr *pagemap_addr,
 				     unsigned long *migrate_pfn,
 				     unsigned long npages,
-				     enum dma_data_direction dir)
+				     enum dma_data_direction dir,
+				     struct dma_iova_state *state)
 {
-	unsigned long i;
+	struct page *dummy_page = NULL;
+	unsigned long i, psize;
+	bool try_alloc = false;
 
 	for (i = 0; i < npages;) {
 		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
-		dma_addr_t dma_addr;
-		struct folio *folio;
+		dma_addr_t dma_addr = -1;
 		unsigned int order = 0;
 
-		if (!page)
-			goto next;
+		if (!page) {
+			if (!dummy_page)
+				goto next;
 
-		WARN_ON_ONCE(is_device_private_page(page));
-		folio = page_folio(page);
-		order = folio_order(folio);
+			page = dummy_page;
+			psize = PAGE_SIZE;
+		} else {
+			struct folio *folio;
 
-		dma_addr = dma_map_page(dev, page, 0, page_size(page), dir);
-		if (dma_mapping_error(dev, dma_addr))
-			return -EFAULT;
+			WARN_ON_ONCE(is_device_private_page(page));
+			folio = page_folio(page);
+			order = folio_order(folio);
+			psize = page_size(page);
+		}
+
+		if (!try_alloc) {
+			dma_iova_try_alloc(dev, state,
+					   npages * PAGE_SIZE >=
+					   HPAGE_PMD_SIZE ?
+					   HPAGE_PMD_SIZE : 0,
+					   npages * PAGE_SIZE);
+			try_alloc = true;
+		}
+
+		if (dma_use_iova(state)) {
+			bool found_dummy = page && !dummy_page;
+			int err;
+
+			if (found_dummy) {
+				unsigned long j;
+
+				for (j = 0; j < i; ++j) {
+					err = dma_iova_link(dev, state,
+							    page_to_phys(page),
+							    j * PAGE_SIZE,
+							    PAGE_SIZE, dir, 0);
+					if (err)
+						return err;
+				}
+			}
+
+			err = dma_iova_link(dev, state, page_to_phys(page),
+					    i * PAGE_SIZE, psize,
+					    dir, 0);
+			if (err)
+				return err;
+
+			if (page != dummy_page)
+				dma_addr = state->addr + i * PAGE_SIZE;
+
+			if (found_dummy)
+				dummy_page = page;
+		} else {
+			dma_addr = dma_map_page(dev, page, 0, page_size(page),
+						dir);
+			if (dma_mapping_error(dev, dma_addr))
+				return -EFAULT;
+		}
+
+		if (dma_addr == -1)
+			goto next;
 
 		pagemap_addr[i] =
 			drm_pagemap_addr_encode(dma_addr,
@@ -330,6 +384,9 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
 		i += NR_PAGES(order);
 	}
 
+	if (dma_use_iova(state))
+		return dma_iova_sync(dev, state, 0, npages * PAGE_SIZE);
+
 	return 0;
 }
 
@@ -341,6 +398,7 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
  * @pagemap_addr: Array of DMA information corresponding to mapped pages
  * @npages: Number of pages to unmap
  * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
+ * @state: DMA IOVA state for mapping.
  *
  * This function unmaps previously mapped pages of memory for GPU Shared Virtual
  * Memory (SVM). It iterates over each DMA address provided in @dma_addr, checks
@@ -350,10 +408,16 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
 					    struct drm_pagemap_addr *pagemap_addr,
 					    unsigned long *migrate_pfn,
 					    unsigned long npages,
-					    enum dma_data_direction dir)
+					    enum dma_data_direction dir,
+					    struct dma_iova_state *state)
 {
 	unsigned long i;
 
+	if (dma_use_iova(state)) {
+		dma_iova_destroy(dev, state, npages * PAGE_SIZE, dir, 0);
+		return;
+	}
+
 	for (i = 0; i < npages;) {
 		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
 
@@ -390,7 +454,8 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 				    struct drm_pagemap_addr pagemap_addr[],
 				    unsigned long npages,
 				    const struct drm_pagemap_devmem_ops *ops,
-				    const struct drm_pagemap_migrate_details *mdetails)
+				    const struct drm_pagemap_migrate_details *mdetails,
+				    struct dma_iova_state *state)
 
 {
 	int err = drm_pagemap_migrate_map_device_pages(remote_device,
@@ -398,7 +463,6 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 						       pagemap_addr, local_pfns,
 						       npages, DMA_FROM_DEVICE,
 						       mdetails);
-
 	if (err)
 		goto out;
 
@@ -406,7 +470,7 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 			       devmem->pre_migrate_fence);
 out:
 	drm_pagemap_migrate_unmap_pages(remote_device, pagemap_addr, local_pfns,
-					npages, DMA_FROM_DEVICE);
+					npages, DMA_FROM_DEVICE, state);
 	return err;
 }
 
@@ -416,11 +480,13 @@ drm_pagemap_migrate_sys_to_dev(struct drm_pagemap_devmem *devmem,
 			       struct page *local_pages[],
 			       struct drm_pagemap_addr pagemap_addr[],
 			       unsigned long npages,
-			       const struct drm_pagemap_devmem_ops *ops)
+			       const struct drm_pagemap_devmem_ops *ops,
+			       struct dma_iova_state *state)
 {
 	int err = drm_pagemap_migrate_map_system_pages(devmem->dev,
 						       pagemap_addr, sys_pfns,
-						       npages, DMA_TO_DEVICE);
+						       npages, DMA_TO_DEVICE,
+						       state);
 
 	if (err)
 		goto out;
@@ -429,7 +495,7 @@ drm_pagemap_migrate_sys_to_dev(struct drm_pagemap_devmem *devmem,
 				  devmem->pre_migrate_fence);
 out:
 	drm_pagemap_migrate_unmap_pages(devmem->dev, pagemap_addr, sys_pfns, npages,
-					DMA_TO_DEVICE);
+					DMA_TO_DEVICE, state);
 	return err;
 }
 
@@ -457,6 +523,7 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 				     const struct migrate_range_loc *cur,
 				     const struct drm_pagemap_migrate_details *mdetails)
 {
+	struct dma_iova_state state = {};
 	int ret = 0;
 
 	if (cur->start == 0)
@@ -476,7 +543,8 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 							  &pages[last->start],
 							  &pagemap_addr[last->start],
 							  cur->start - last->start,
-							  last->ops, mdetails);
+							  last->ops, mdetails,
+							  &state);
 
 	else
 		ret = drm_pagemap_migrate_sys_to_dev(devmem,
@@ -484,7 +552,7 @@ static int drm_pagemap_migrate_range(struct drm_pagemap_devmem *devmem,
 						     &pages[last->start],
 						     &pagemap_addr[last->start],
 						     cur->start - last->start,
-						     last->ops);
+						     last->ops, &state);
 
 out:
 	*last = *cur;
@@ -1001,6 +1069,7 @@ EXPORT_SYMBOL(drm_pagemap_put);
 int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 {
 	const struct drm_pagemap_devmem_ops *ops = devmem_allocation->ops;
+	struct dma_iova_state state = {};
 	unsigned long npages, mpages = 0;
 	struct page **pages;
 	unsigned long *src, *dst;
@@ -1042,7 +1111,7 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	err = drm_pagemap_migrate_map_system_pages(devmem_allocation->dev,
 						   pagemap_addr,
 						   dst, npages,
-						   DMA_FROM_DEVICE);
+						   DMA_FROM_DEVICE, &state);
 	if (err)
 		goto err_finalize;
 
@@ -1059,7 +1128,7 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	migrate_device_pages(src, dst, npages);
 	migrate_device_finalize(src, dst, npages);
 	drm_pagemap_migrate_unmap_pages(devmem_allocation->dev, pagemap_addr, dst, npages,
-					DMA_FROM_DEVICE);
+					DMA_FROM_DEVICE, &state);
 
 err_free:
 	kvfree(buf);
@@ -1103,6 +1172,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 		MIGRATE_VMA_SELECT_DEVICE_COHERENT,
 		.fault_page	= page,
 	};
+	struct dma_iova_state state = {};
 	struct drm_pagemap_zdd *zdd;
 	const struct drm_pagemap_devmem_ops *ops;
 	struct device *dev = NULL;
@@ -1162,7 +1232,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 
 	err = drm_pagemap_migrate_map_system_pages(dev, pagemap_addr,
 						   migrate.dst, npages,
-						   DMA_FROM_DEVICE);
+						   DMA_FROM_DEVICE, &state);
 	if (err)
 		goto err_finalize;
 
@@ -1180,7 +1250,8 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	migrate_vma_finalize(&migrate);
 	if (dev)
 		drm_pagemap_migrate_unmap_pages(dev, pagemap_addr, migrate.dst,
-						npages, DMA_FROM_DEVICE);
+						npages, DMA_FROM_DEVICE,
+						&state);
 err_free:
 	kvfree(buf);
 err_out:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 05/11] drm/pagemap: Reduce number of IOVA link calls
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (3 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap Matthew Brost
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Each IOVA link call results in a page walk, which is relatively
expensive. Reduce the number of IOVA link calls by collapsing
contiguous physical pages into a single IOVA link operation.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_pagemap.c | 49 ++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
index b928c89f4bd1..a167064ce41a 100644
--- a/drivers/gpu/drm/drm_pagemap.c
+++ b/drivers/gpu/drm/drm_pagemap.c
@@ -305,7 +305,8 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
 				     struct dma_iova_state *state)
 {
 	struct page *dummy_page = NULL;
-	unsigned long i, psize;
+	unsigned long i, j, psize;
+	phys_addr_t phys = -1;
 	bool try_alloc = false;
 
 	for (i = 0; i < npages;) {
@@ -339,26 +340,50 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
 
 		if (dma_use_iova(state)) {
 			bool found_dummy = page && !dummy_page;
+			bool phys_match;
 			int err;
 
-			if (found_dummy) {
-				unsigned long j;
+			if (found_dummy && i) {
+				err = dma_iova_link(dev, state,
+						    page_to_phys(page),
+						    0, i * PAGE_SIZE,
+						    dir, 0);
+				if (err)
+					return err;
+			}
+
+			if (phys == -1) {
+				phys = page_to_phys(page);
+				j = i;
+				phys_match = true;
+			} else {
+				phys_match = phys + (i - j) * PAGE_SIZE ==
+					page_to_phys(page);
+			}
 
-				for (j = 0; j < i; ++j) {
+			if (psize != PAGE_SIZE || !phys_match ||
+			    (i + 1) == npages) {
+				err = dma_iova_link(dev, state, phys,
+						    j * PAGE_SIZE,
+						    psize * ((i - j) +
+						    phys_match),
+						    dir, 0);
+				if (err)
+					return err;
+
+				if (!phys_match && (i + 1) == npages) {
 					err = dma_iova_link(dev, state,
 							    page_to_phys(page),
-							    j * PAGE_SIZE,
-							    PAGE_SIZE, dir, 0);
+							    i * PAGE_SIZE,
+							    psize,
+							    dir, 0);
 					if (err)
 						return err;
 				}
-			}
 
-			err = dma_iova_link(dev, state, page_to_phys(page),
-					    i * PAGE_SIZE, psize,
-					    dir, 0);
-			if (err)
-				return err;
+				phys = page_to_phys(page);
+				j = i;
+			}
 
 			if (page != dummy_page)
 				dma_addr = state->addr + i * PAGE_SIZE;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (4 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 05/11] drm/pagemap: Reduce number of IOVA link calls Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
       [not found]   ` <20260128151458.GJ1641016@ziepe.ca>
  2026-01-28  0:48 ` [RFC PATCH v3 07/11] drm/xe: Stub out DRM pagemap IOVA alloc implementation Matthew Brost
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Add an IOVA interface to the DRM pagemap layer. This provides a semantic
wrapper around the dma-map IOVA alloc/link/sync/unlink/free API while
remaining flexible enough to support future high-speed interconnects
between devices.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 include/drm/drm_pagemap.h | 87 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
index 14e1db564c25..0b410113ef95 100644
--- a/include/drm/drm_pagemap.h
+++ b/include/drm/drm_pagemap.h
@@ -72,6 +72,93 @@ drm_pagemap_addr_encode(dma_addr_t addr,
  * struct drm_pagemap_ops: Ops for a drm-pagemap.
  */
 struct drm_pagemap_ops {
+	/**
+	 * @device_iova_alloc: Allocate a IOVA for device access (required)
+	 *
+	 * @dpagemap: The struct drm_pagemap for the IOVA.
+	 * @dev: The device mapper.
+	 * @length: Length of IOVA.
+	 * @dir: The transfer direction.
+	 *
+	 * Context: Reclaim unsafe, maybe take dma-resv locks.
+	 *
+	 * Return: Cookie to IOVA which is passed to other vfuncs, NULL if no
+	 * IOVA could be allocated or not needed, ERR_PTR if an IOVA is required
+	 * but allocation failed.
+	 */
+	void *(*device_iova_alloc)(struct drm_pagemap *dpagemap,
+				   struct device *dev, size_t length,
+				   enum dma_data_direction dir);
+
+	/**
+	 * @device_iova_free: Free a IOVA from device access (optional, required
+	 * if @device_iova_alloc returns a valid cookie)
+	 *
+	 * @dpagemap: The struct drm_pagemap for the IOVA.
+	 * @dev: The device mapper.
+	 * @length: Length of IOVA.
+	 * @cookie: Cookie for IOVA.
+	 *
+	 * Context: Reclaim unsafe, maybe take dma-resv locks.
+	 */
+	void (*device_iova_free)(struct drm_pagemap *dpagemap,
+				 struct device *dev, size_t length,
+				 void *cookie);
+
+	/**
+	 * @device_iova_link: Link IOVA in device (optional, required if
+	 * @device_iova_alloc returns a valid cookie)
+	 *
+	 * @dpagemap: The struct drm_pagemap for the IOVA.
+	 * @dev: The device mapper.
+	 * @length: Length of mapping.
+	 * @offset: Offset in IOVA of mapping.
+	 * @cookie: Cookie for IOVA.
+	 * @dir: The transfer direction.
+	 *
+	 * Context: Reclaim safe.
+	 */
+	struct drm_pagemap_addr (*device_iova_link)(struct drm_pagemap *dpagemap,
+						    struct device *dev,
+						    struct page *page,
+						    size_t length,
+						    size_t offset,
+						    void *cookie,
+						    enum dma_data_direction dir);
+
+	/**
+	 * @device_iova_sync: Sync IOVA in device (optional, required if
+	 * @device_iova_alloc returns a valid cookie)
+	 *
+	 * @dpagemap: The struct drm_pagemap for the IOVA.
+	 * @dev: The device mapper.
+	 * @length: Length of IOVA.
+	 * @cookie: Cookie for IOVA.
+	 *
+	 * Context: Reclaim safe.
+	 *
+	 * Return: Zero on success, negative error code on failure.
+	 */
+	int (*device_iova_sync)(struct drm_pagemap *dpagemap,
+				struct device *dev, size_t length,
+				void *cookie);
+
+	/**
+	 * @device_iova_unlink: Unlink IOVA from device (optional, required if
+	 * @device_iova_alloc returns a valid cookie)
+	 *
+	 * @dpagemap: The struct drm_pagemap for the IOVA.
+	 * @dev: The device mapper.
+	 * @length: Length of IOVA.
+	 * @cookie: Cookie for IOVA.
+	 * @dir: The transfer direction.
+	 *
+	 * Context: Reclaim safe.
+	 */
+	void (*device_iova_unlink)(struct drm_pagemap *dpagemap,
+				   struct device *dev, size_t length,
+				   void *cookie, enum dma_data_direction dir);
+
 	/**
 	 * @device_map: Map for device access or provide a virtual address suitable for
 	 *
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 07/11] drm/xe: Stub out DRM pagemap IOVA alloc implementation
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (5 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 08/11] drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Stub out the minimal set of DRM pagemap IOVA vfuncs required for Xe.
This provides the basic scaffolding needed for functionality while the
full implementation is developed.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_svm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index 213f0334518a..eb8d8fe6ff75 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -1649,6 +1649,14 @@ int xe_svm_alloc_vram(struct xe_svm_range *range, const struct drm_gpusvm_ctx *c
 	return err;
 }
 
+static void *xe_drm_pagemap_device_iova_alloc(struct drm_pagemap *dpagemap,
+					      struct device *dev, size_t length,
+					      enum dma_data_direction dir)
+{
+	/* NIY */
+	return NULL;
+}
+
 static struct drm_pagemap_addr
 xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
 			  struct device *dev,
@@ -1720,6 +1728,7 @@ static void xe_pagemap_destroy(struct drm_pagemap *dpagemap, bool from_atomic_or
 }
 
 static const struct drm_pagemap_ops xe_drm_pagemap_ops = {
+	.device_iova_alloc = xe_drm_pagemap_device_iova_alloc,
 	.device_map = xe_drm_pagemap_device_map,
 	.device_unmap = xe_drm_pagemap_device_unmap,
 	.populate_mm = xe_drm_pagemap_populate_mm,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 08/11] drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (6 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 07/11] drm/xe: Stub out DRM pagemap IOVA alloc implementation Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 09/11] drm/xe: Drop BO dma-resv lock during SVM migrate-to-device Matthew Brost
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

The device-to-device IOVA alloc, link, and sync APIs perform
significantly better than individual map/unmap operations, as they avoid
costly synchronization. This improvement is especially noticeable when
mapping a 2MB region using 4KB pages. In addition, IOVAs may be required
for future high-speed fabric connections between devices.

Use the IOVA alloc, link, and sync APIs for DRM pagemap, which create DMA
mappings between the devices.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_pagemap.c | 100 ++++++++++++++++++++++++++++------
 1 file changed, 83 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
index a167064ce41a..aa23f7950175 100644
--- a/drivers/gpu/drm/drm_pagemap.c
+++ b/drivers/gpu/drm/drm_pagemap.c
@@ -213,6 +213,7 @@ static void drm_pagemap_get_devmem_page(struct page *page,
  * @npages: Number of system pages or peer pages to map.
  * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
  * @mdetails: Details governing the migration behaviour.
+ * @cookie: IOVA cookie for mapping.
  *
  * This function maps pages of memory for migration usage in GPU SVM. It
  * iterates over each page frame number provided in @migrate_pfn, maps the
@@ -228,23 +229,31 @@ drm_pagemap_migrate_map_device_pages(struct device *dev,
 				     unsigned long *migrate_pfn,
 				     unsigned long npages,
 				     enum dma_data_direction dir,
-				     const struct drm_pagemap_migrate_details *mdetails)
+				     const struct drm_pagemap_migrate_details *mdetails,
+				     void **cookie)
 {
-	unsigned long num_peer_pages = 0, num_local_pages = 0, i;
+	unsigned long num_peer_pages = 0, num_local_pages = 0, i, j;
+	struct page *dummy_page = NULL;
+	struct drm_pagemap *dpagemap;
+	bool try_alloc = false;
 
 	for (i = 0; i < npages;) {
 		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
 		struct drm_pagemap_zdd *zdd;
-		struct drm_pagemap *dpagemap;
 		struct drm_pagemap_addr addr;
-		struct folio *folio;
 		unsigned int order = 0;
 
-		if (!page)
-			goto next;
+		if (!page) {
+			if (!dummy_page)
+				goto next;
 
-		folio = page_folio(page);
-		order = folio_order(folio);
+			page = dummy_page;
+		} else {
+			struct folio *folio;
+
+			folio = page_folio(page);
+			order = folio_order(folio);
+		}
 
 		WARN_ON_ONCE(!is_device_private_page(page));
 
@@ -260,16 +269,57 @@ drm_pagemap_migrate_map_device_pages(struct device *dev,
 			num_peer_pages += NR_PAGES(order);
 		}
 
-		addr = dpagemap->ops->device_map(dpagemap, dev, page, order, dir);
+		if (!try_alloc) {
+			*cookie = dpagemap->ops->device_iova_alloc(dpagemap,
+								   dev, npages *
+								   PAGE_SIZE,
+								   dir);
+			if (IS_ERR(*cookie))
+				return PTR_ERR(*cookie);
+
+			try_alloc = true;
+		}
+
+		if (page && !dummy_page && *cookie) {
+			for (j = 0; j < i; ++j) {
+				addr = dpagemap->ops->device_iova_link(dpagemap, dev,
+								       page,
+								       PAGE_SIZE,
+								       j * PAGE_SIZE,
+								       *cookie, dir);
+				if (dma_mapping_error(dev, addr.addr))
+					return -EFAULT;
+			}
+		}
+
+		if (*cookie)
+			addr = dpagemap->ops->device_iova_link(dpagemap, dev,
+							       page,
+							       PAGE_SHIFT << order,
+							       i * PAGE_SIZE,
+							       *cookie, dir);
+		else
+			addr = dpagemap->ops->device_map(dpagemap, dev, page,
+							 order, dir);
 		if (dma_mapping_error(dev, addr.addr))
 			return -EFAULT;
 
-		pagemap_addr[i] = addr;
+		if (page != dummy_page)
+			pagemap_addr[i] = addr;
+		dummy_page = page;
 
 next:
 		i += NR_PAGES(order);
 	}
 
+	if (*cookie) {
+		int err = dpagemap->ops->device_iova_sync(dpagemap, dev,
+							  npages * PAGE_SIZE,
+							  *cookie);
+		if (err)
+			return err;
+	}
+
 	if (num_peer_pages)
 		drm_dbg(local_dpagemap->drm, "Migrating %lu peer pages over interconnect.\n",
 			num_peer_pages);
@@ -424,6 +474,7 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
  * @npages: Number of pages to unmap
  * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
  * @state: DMA IOVA state for mapping.
+ * @cookie: IOVA cookie for mapping.
  *
  * This function unmaps previously mapped pages of memory for GPU Shared Virtual
  * Memory (SVM). It iterates over each DMA address provided in @dma_addr, checks
@@ -434,7 +485,8 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
 					    unsigned long *migrate_pfn,
 					    unsigned long npages,
 					    enum dma_data_direction dir,
-					    struct dma_iova_state *state)
+					    struct dma_iova_state *state,
+					    void *cookie)
 {
 	unsigned long i;
 
@@ -453,7 +505,20 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
 			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
 			struct drm_pagemap *dpagemap = zdd->dpagemap;
 
-			dpagemap->ops->device_unmap(dpagemap, dev, pagemap_addr[i]);
+			if (cookie) {
+				dpagemap->ops->device_iova_unlink(dpagemap, dev,
+								  npages *
+								  PAGE_SIZE,
+								  cookie, dir);
+				dpagemap->ops->device_iova_free(dpagemap, dev,
+								npages *
+								PAGE_SIZE,
+								cookie);
+				return;
+			} else {
+				dpagemap->ops->device_unmap(dpagemap, dev,
+							    pagemap_addr[i]);
+			}
 		} else {
 			dma_unmap_page(dev, pagemap_addr[i].addr,
 				       PAGE_SIZE << pagemap_addr[i].order, dir);
@@ -483,11 +548,12 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 				    struct dma_iova_state *state)
 
 {
+	void *cookie = NULL;
 	int err = drm_pagemap_migrate_map_device_pages(remote_device,
 						       remote_dpagemap,
 						       pagemap_addr, local_pfns,
 						       npages, DMA_FROM_DEVICE,
-						       mdetails);
+						       mdetails, &cookie);
 	if (err)
 		goto out;
 
@@ -495,7 +561,7 @@ drm_pagemap_migrate_remote_to_local(struct drm_pagemap_devmem *devmem,
 			       devmem->pre_migrate_fence);
 out:
 	drm_pagemap_migrate_unmap_pages(remote_device, pagemap_addr, local_pfns,
-					npages, DMA_FROM_DEVICE, state);
+					npages, DMA_FROM_DEVICE, state, cookie);
 	return err;
 }
 
@@ -520,7 +586,7 @@ drm_pagemap_migrate_sys_to_dev(struct drm_pagemap_devmem *devmem,
 				  devmem->pre_migrate_fence);
 out:
 	drm_pagemap_migrate_unmap_pages(devmem->dev, pagemap_addr, sys_pfns, npages,
-					DMA_TO_DEVICE, state);
+					DMA_TO_DEVICE, state, NULL);
 	return err;
 }
 
@@ -1153,7 +1219,7 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
 	migrate_device_pages(src, dst, npages);
 	migrate_device_finalize(src, dst, npages);
 	drm_pagemap_migrate_unmap_pages(devmem_allocation->dev, pagemap_addr, dst, npages,
-					DMA_FROM_DEVICE, &state);
+					DMA_FROM_DEVICE, &state, NULL);
 
 err_free:
 	kvfree(buf);
@@ -1276,7 +1342,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
 	if (dev)
 		drm_pagemap_migrate_unmap_pages(dev, pagemap_addr, migrate.dst,
 						npages, DMA_FROM_DEVICE,
-						&state);
+						&state, NULL);
 err_free:
 	kvfree(buf);
 err_out:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 09/11] drm/xe: Drop BO dma-resv lock during SVM migrate-to-device
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (7 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 08/11] drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 10/11] drm/xe: Implement DRM pagemap IOVA vfuncs Matthew Brost
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Device-to-device migration may require DRM pagemap IOVA allocations,
which are allowed to acquire dma-resv locks. To support this, pin the BO
before initiating the migration, preventing immediate eviction and
allowing dma-resv locks to be taken safely during the migration process.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_svm.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index eb8d8fe6ff75..c2a6bb367e0a 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -1077,15 +1077,26 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 			block->private = vr;
 
 		xe_bo_get(bo);
+		/* Guard against eviction */
+		ttm_bo_pin(&bo->ttm);
 
 		/* Ensure the device has a pm ref while there are device pages active. */
 		xe_pm_runtime_get_noresume(xe);
-		/* Consumes the devmem allocation ref. */
-		err = drm_pagemap_migrate_to_devmem(&bo->devmem_allocation, mm,
-						    start, end, &mdetails);
 		xe_bo_unlock(bo);
-		xe_bo_put(bo);
+
 	}
+
+	/* Consumes the devmem allocation ref. */
+	err = drm_pagemap_migrate_to_devmem(&bo->devmem_allocation, mm,
+					    start, end, &mdetails);
+
+	xe_bo_lock(bo, false);
+	ttm_bo_unpin(&bo->ttm);
+	ttm_bo_move_to_lru_tail_unlocked(&bo->ttm);
+	xe_bo_unlock(bo);
+
+	xe_bo_put(bo);
+
 	xe_pm_runtime_put(xe);
 	drm_dev_exit(idx);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 10/11] drm/xe: Implement DRM pagemap IOVA vfuncs
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (8 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 09/11] drm/xe: Drop BO dma-resv lock during SVM migrate-to-device Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:48 ` [RFC PATCH v3 11/11] drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM Matthew Brost
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

Implement the DRM pagemap IOVA vfuncs on top of the dma-map IOVA API.
Also add lockdep annotations to verify that the locking guidelines are
followed, paving the way for future implementations of the remaining
IOVA vfuncs.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_svm.c | 117 +++++++++++++++++++++++++++++++++++-
 1 file changed, 116 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index c2a6bb367e0a..b46de21ed438 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -1660,14 +1660,125 @@ int xe_svm_alloc_vram(struct xe_svm_range *range, const struct drm_gpusvm_ctx *c
 	return err;
 }
 
+static void xe_drm_pagemap_device_iova_prove_locking(bool *locking_proved)
+{
+	struct ww_acquire_ctx ctx;
+	struct dma_resv obj;
+	int ret;
+
+	if (!IS_ENABLED(CONFIG_PROVE_LOCKING))
+		return;
+
+	if (*locking_proved)
+		return;
+
+	might_alloc(GFP_KERNEL);
+
+	dma_resv_init(&obj);
+	ww_acquire_init(&ctx, &reservation_ww_class);
+	ret = dma_resv_lock(&obj, &ctx);
+	if (ret == -EDEADLK)
+		dma_resv_lock_slow(&obj, &ctx);
+	ww_mutex_unlock(&obj.lock);
+	ww_acquire_fini(&ctx);
+
+	*locking_proved = true;
+}
+
+struct xe_svm_iova_cookie {
+	struct dma_iova_state state;
+};
+
 static void *xe_drm_pagemap_device_iova_alloc(struct drm_pagemap *dpagemap,
 					      struct device *dev, size_t length,
 					      enum dma_data_direction dir)
 {
-	/* NIY */
+	struct device *pgmap_dev = dpagemap->drm->dev;
+	struct xe_svm_iova_cookie *cookie;
+	static bool locking_proved = false;
+
+	xe_drm_pagemap_device_iova_prove_locking(&locking_proved);
+
+	if (pgmap_dev == dev)
+		return NULL;
+
+	cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
+	if (!cookie)
+		return NULL;
+
+	dma_iova_try_alloc(dev, &cookie->state, length >= SZ_2M ? SZ_2M : 0,
+			   length);
+	if (dma_use_iova(&cookie->state))
+		return cookie;
+
+	kfree(cookie);
 	return NULL;
 }
 
+static void xe_drm_pagemap_device_iova_free(struct drm_pagemap *dpagemap,
+					    struct device *dev, size_t length,
+					    void *cookie)
+{
+	struct xe_svm_iova_cookie *__cookie = cookie;
+	struct xe_device *xe = to_xe_device(dpagemap->drm);
+	static bool locking_proved = false;
+
+	xe_assert(xe, dma_use_iova(&__cookie->state));
+	xe_drm_pagemap_device_iova_prove_locking(&locking_proved);
+
+	dma_iova_free(dev, &__cookie->state);
+	kfree(cookie);
+}
+
+static struct drm_pagemap_addr
+xe_drm_pagemap_device_iova_link(struct drm_pagemap *dpagemap,
+				struct device *dev, struct page *page,
+				size_t length, size_t offset, void *cookie,
+				enum dma_data_direction dir)
+{
+	struct xe_svm_iova_cookie *__cookie = cookie;
+	struct xe_device *xe = to_xe_device(dpagemap->drm);
+	dma_addr_t addr = __cookie->state.addr + offset;
+	int err;
+
+	xe_assert(xe, dma_use_iova(&__cookie->state));
+
+	err = dma_iova_link(dev, &__cookie->state, xe_page_to_pcie(page),
+			    offset, length, dir, DMA_ATTR_SKIP_CPU_SYNC |
+			    DMA_ATTR_MMIO);
+	if (err)
+		addr = DMA_MAPPING_ERROR;
+
+	return drm_pagemap_addr_encode(addr, XE_INTERCONNECT_P2P, ilog2(length),
+				       dir);
+}
+
+static int
+xe_drm_pagemap_device_iova_sync(struct drm_pagemap *dpagemap,
+				struct device *dev, size_t length, void *cookie)
+{
+	struct xe_svm_iova_cookie *__cookie = cookie;
+	struct xe_device *xe = to_xe_device(dpagemap->drm);
+
+	xe_assert(xe, dma_use_iova(&__cookie->state));
+
+	return dma_iova_sync(dev, &__cookie->state, 0, length);
+}
+
+static void
+xe_drm_pagemap_device_iova_unlink(struct drm_pagemap *dpagemap,
+				  struct device *dev, size_t length,
+				  void *cookie, enum dma_data_direction dir)
+{
+	struct xe_svm_iova_cookie *__cookie = cookie;
+	struct xe_device *xe = to_xe_device(dpagemap->drm);
+
+	xe_assert(xe, dma_use_iova(&__cookie->state));
+
+	dma_iova_unlink(dev, &__cookie->state, 0, length, dir,
+			DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_MMIO);
+}
+
 static struct drm_pagemap_addr
 xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
 			  struct device *dev,
@@ -1740,6 +1851,10 @@ static void xe_pagemap_destroy(struct drm_pagemap *dpagemap, bool from_atomic_or
 
 static const struct drm_pagemap_ops xe_drm_pagemap_ops = {
 	.device_iova_alloc = xe_drm_pagemap_device_iova_alloc,
+	.device_iova_free = xe_drm_pagemap_device_iova_free,
+	.device_iova_link = xe_drm_pagemap_device_iova_link,
+	.device_iova_sync = xe_drm_pagemap_device_iova_sync,
+	.device_iova_unlink = xe_drm_pagemap_device_iova_unlink,
 	.device_map = xe_drm_pagemap_device_map,
 	.device_unmap = xe_drm_pagemap_device_unmap,
 	.populate_mm = xe_drm_pagemap_populate_mm,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [RFC PATCH v3 11/11] drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (9 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 10/11] drm/xe: Implement DRM pagemap IOVA vfuncs Matthew Brost
@ 2026-01-28  0:48 ` Matthew Brost
  2026-01-28  0:59 ` ✗ CI.checkpatch: warning for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3) Patchwork
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28  0:48 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: leonro, francois.dugast, thomas.hellstrom, himal.prasad.ghimiray,
	jgg

The device-to-device IOVA alloc, link, and sync APIs perform
significantly better than individual map/unmap operations, as they
avoid costly synchronization. This improvement is especially noticeable
when mapping a 2MB region using 4KB pages. In addition, IOVAs may be
required for future high-speed fabric connections between devices.

Use the IOVA alloc, link, and sync APIs for GPU SVM, which create DMA
mappings between the devices.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/drm_gpusvm.c | 100 ++++++++++++++++++++++++++++++++---
 include/drm/drm_gpusvm.h     |   2 +
 2 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index 084e78fa0f32..59de50d030b3 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -1142,9 +1142,19 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
 		struct dma_iova_state __state = {};
 
 		if (dma_use_iova(&svm_pages->state)) {
+			drm_WARN_ON(gpusvm->drm, svm_pages->iova_cookie);
+
 			dma_iova_destroy(dev, &svm_pages->state,
 					 npages * PAGE_SIZE,
 					 svm_pages->dma_addr[0].dir, 0);
+		} else if (svm_pages->iova_cookie) {
+			struct drm_pagemap_addr *addr = &svm_pages->dma_addr[0];
+
+			dpagemap->ops->device_iova_unlink(dpagemap, dev,
+							  npages *
+							  PAGE_SIZE,
+							  svm_pages->iova_cookie,
+							  addr->dir);
 		} else {
 			for (i = 0, j = 0; i < npages; j++) {
 				struct drm_pagemap_addr *addr = &svm_pages->dma_addr[j];
@@ -1166,8 +1176,10 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
 		flags.has_dma_mapping = false;
 		WRITE_ONCE(svm_pages->flags.__flags, flags.__flags);
 
-		drm_pagemap_put(svm_pages->dpagemap);
-		svm_pages->dpagemap = NULL;
+		if (!svm_pages->iova_cookie) {
+			drm_pagemap_put(svm_pages->dpagemap);
+			svm_pages->dpagemap = NULL;
+		}
 		svm_pages->state = __state;
 	}
 }
@@ -1190,6 +1202,28 @@ static void __drm_gpusvm_free_pages(struct drm_gpusvm *gpusvm,
 	}
 }
 
+/**
+ * drm_gpusvm_pages_iova_free() - Free IOVA associated with GPU SVM pages
+ * @gpusvm: Pointer to the GPU SVM structure
+ * @svm_pages: Pointer to the GPU SVM pages structure
+ * @size: Size of IOVA to free
+ *
+ * This function frees the IOVA associated with a GPU SVM range.
+ */
+static void drm_gpusvm_pages_iova_free(struct drm_gpusvm *gpusvm,
+				       struct drm_gpusvm_pages *svm_pages,
+				       size_t size)
+{
+	if (svm_pages->iova_cookie) {
+		struct drm_pagemap *dpagemap = svm_pages->dpagemap;
+
+		dpagemap->ops->device_iova_free(dpagemap, gpusvm->drm->dev,
+						size, svm_pages->iova_cookie);
+		drm_pagemap_put(dpagemap);
+		svm_pages->dpagemap = NULL;
+	}
+}
+
 /**
  * drm_gpusvm_free_pages() - Free dma-mapping associated with GPU SVM pages
  * struct
@@ -1208,6 +1242,8 @@ void drm_gpusvm_free_pages(struct drm_gpusvm *gpusvm,
 	__drm_gpusvm_unmap_pages(gpusvm, svm_pages, npages);
 	__drm_gpusvm_free_pages(gpusvm, svm_pages);
 	drm_gpusvm_notifier_unlock(gpusvm);
+
+	drm_gpusvm_pages_iova_free(gpusvm, svm_pages, npages * PAGE_SIZE);
 }
 EXPORT_SYMBOL_GPL(drm_gpusvm_free_pages);
 
@@ -1241,6 +1277,8 @@ void drm_gpusvm_range_remove(struct drm_gpusvm *gpusvm,
 	__drm_gpusvm_range_remove(notifier, range);
 	drm_gpusvm_notifier_unlock(gpusvm);
 
+	drm_gpusvm_pages_iova_free(gpusvm, &range->pages,
+				   drm_gpusvm_range_size(range));
 	drm_gpusvm_range_put(range);
 
 	if (RB_EMPTY_ROOT(&notifier->root.rb_root)) {
@@ -1418,6 +1456,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 	enum dma_data_direction dma_dir = ctx->read_only ? DMA_TO_DEVICE :
 							   DMA_BIDIRECTIONAL;
 	struct dma_iova_state *state = &svm_pages->state;
+	bool try_alloc;
 
 retry:
 	if (time_after(jiffies, timeout))
@@ -1427,6 +1466,9 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 	if (drm_gpusvm_pages_valid_unlocked(gpusvm, svm_pages))
 		goto set_seqno;
 
+	drm_gpusvm_pages_iova_free(gpusvm, svm_pages, npages * PAGE_SIZE);
+	try_alloc = false;
+
 	pfns = kvmalloc_array(npages, sizeof(*pfns), GFP_KERNEL);
 	if (!pfns)
 		return -ENOMEM;
@@ -1535,12 +1577,47 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 					err = -EAGAIN;
 					goto err_unmap;
 				}
+
+				if (!try_alloc) {
+					void *iova_cookie;
+
+					/* Unlock and restart mapping to allocate IOVA. */
+					drm_gpusvm_notifier_unlock(gpusvm);
+
+					drm_WARN_ON(gpusvm->drm,
+						    svm_pages->iova_cookie);
+
+					iova_cookie =
+						dpagemap->ops->device_iova_alloc(dpagemap,
+										 gpusvm->drm->dev,
+										 npages * PAGE_SIZE,
+										 dma_dir);
+					if (IS_ERR(iova_cookie)) {
+						err = PTR_ERR(iova_cookie);
+						goto err_unmap;
+					}
+
+					svm_pages->iova_cookie = iova_cookie;
+					try_alloc = true;
+					goto map_pages;
+				}
 			}
-			svm_pages->dma_addr[j] =
-				dpagemap->ops->device_map(dpagemap,
-							  gpusvm->drm->dev,
-							  page, order,
-							  dma_dir);
+
+			if (svm_pages->iova_cookie)
+				svm_pages->dma_addr[j] =
+					dpagemap->ops->device_iova_link(dpagemap,
+									gpusvm->drm->dev,
+									page,
+									PAGE_SHIFT << order,
+									j * PAGE_SIZE,
+									svm_pages->iova_cookie,
+									dma_dir);
+			else
+				svm_pages->dma_addr[j] =
+					dpagemap->ops->device_map(dpagemap,
+								  gpusvm->drm->dev,
+								  page, order,
+								  dma_dir);
 			if (dma_mapping_error(gpusvm->drm->dev,
 					      svm_pages->dma_addr[j].addr)) {
 				err = -EFAULT;
@@ -1600,10 +1677,19 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
 	}
 
 	if (dma_use_iova(state)) {
+		drm_WARN_ON(gpusvm->drm, svm_pages->iova_cookie);
+
 		err = dma_iova_sync(gpusvm->drm->dev, state, 0,
 				    npages * PAGE_SIZE);
 		if (err)
 			goto err_unmap;
+	} else if (svm_pages->iova_cookie) {
+		err = dpagemap->ops->device_iova_sync(dpagemap,
+						      gpusvm->drm->dev,
+						      npages * PAGE_SIZE,
+						      svm_pages->iova_cookie);
+		if (err)
+			goto err_unmap;
 	}
 
 	if (pagemap) {
diff --git a/include/drm/drm_gpusvm.h b/include/drm/drm_gpusvm.h
index 6772d8a92788..8c7640625cb1 100644
--- a/include/drm/drm_gpusvm.h
+++ b/include/drm/drm_gpusvm.h
@@ -138,6 +138,7 @@ struct drm_gpusvm_pages_flags {
  * @dpagemap: The struct drm_pagemap of the device pages we're dma-mapping.
  *            Note this is assuming only one drm_pagemap per range is allowed.
  * @state: DMA IOVA state for mapping.
+ * @iova_cookie: IOVA cookie for mapping.
  * @notifier_seq: Notifier sequence number of the range's pages
  * @flags: Flags for range
  * @flags.migrate_devmem: Flag indicating whether the range can be migrated to device memory
@@ -150,6 +151,7 @@ struct drm_gpusvm_pages {
 	struct drm_pagemap_addr *dma_addr;
 	struct drm_pagemap *dpagemap;
 	struct dma_iova_state state;
+	void *iova_cookie;
 	unsigned long notifier_seq;
 	struct drm_gpusvm_pages_flags flags;
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* ✗ CI.checkpatch: warning for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (10 preceding siblings ...)
  2026-01-28  0:48 ` [RFC PATCH v3 11/11] drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM Matthew Brost
@ 2026-01-28  0:59 ` Patchwork
  2026-01-28  1:01 ` ✓ CI.KUnit: success " Patchwork
  2026-01-28  1:42 ` ✓ Xe.CI.BAT: " Patchwork
  13 siblings, 0 replies; 30+ messages in thread
From: Patchwork @ 2026-01-28  0:59 UTC (permalink / raw)
  To: Matthew Brost; +Cc: intel-xe

== Series Details ==

Series: Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
URL   : https://patchwork.freedesktop.org/series/160587/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
1f57ba1afceae32108bd24770069f764d940a0e4
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 951a5e4ecfd4bd905384749bef890c1a90a86ef2
Author: Matthew Brost <matthew.brost@intel.com>
Date:   Tue Jan 27 16:48:41 2026 -0800

    drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM
    
    The device-to-device IOVA alloc, link, and sync APIs perform
    significantly better than individual map/unmap operations, as they
    avoid costly synchronization. This improvement is especially noticeable
    when mapping a 2MB region using 4KB pages. In addition, IOVAs may be
    required for future high-speed fabric connections between devices.
    
    Use the IOVA alloc, link, and sync APIs for GPU SVM, which create DMA
    mappings between the devices.
    
    Signed-off-by: Matthew Brost <matthew.brost@intel.com>
+ /mt/dim checkpatch ba05f22d6945596fac691e952c98f566696c24ad drm-intel
977253684cdb drm/pagemap: Add helper to access zone_device_data
f8d9efc0ad6c drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
5a68fb6133c9 drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system
3e123ad5d8b1 drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
c45f7281a626 drm/pagemap: Reduce number of IOVA link calls
05b4cbbbc73c drm/pagemap: Add IOVA interface to DRM pagemap
0378474e6b37 drm/xe: Stub out DRM pagemap IOVA alloc implementation
49a9e02cf14e drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap
-:163: WARNING:UNNECESSARY_ELSE: else is not generally useful after a break or return
#163: FILE: drivers/gpu/drm/drm_pagemap.c:518:
+				return;
+			} else {

total: 0 errors, 1 warnings, 0 checks, 187 lines checked
749a995da317 drm/xe: Drop BO dma-resv lock during SVM migrate-to-device
0934edfc22b9 drm/xe: Implement DRM pagemap IOVA vfuncs
-:57: ERROR:INITIALISED_STATIC: do not initialise statics to false
#57: FILE: drivers/gpu/drm/xe/xe_svm.c:1698:
+	static bool locking_proved = false;

-:83: ERROR:INITIALISED_STATIC: do not initialise statics to false
#83: FILE: drivers/gpu/drm/xe/xe_svm.c:1724:
+	static bool locking_proved = false;

total: 2 errors, 0 warnings, 0 checks, 136 lines checked
951a5e4ecfd4 drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM



^ permalink raw reply	[flat|nested] 30+ messages in thread

* ✓ CI.KUnit: success for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (11 preceding siblings ...)
  2026-01-28  0:59 ` ✗ CI.checkpatch: warning for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3) Patchwork
@ 2026-01-28  1:01 ` Patchwork
  2026-01-28  1:42 ` ✓ Xe.CI.BAT: " Patchwork
  13 siblings, 0 replies; 30+ messages in thread
From: Patchwork @ 2026-01-28  1:01 UTC (permalink / raw)
  To: Matthew Brost; +Cc: intel-xe

== Series Details ==

Series: Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
URL   : https://patchwork.freedesktop.org/series/160587/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[00:59:49] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[00:59:53] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[01:00:25] Starting KUnit Kernel (1/1)...
[01:00:25] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[01:00:25] ================== guc_buf (11 subtests) ===================
[01:00:25] [PASSED] test_smallest
[01:00:25] [PASSED] test_largest
[01:00:25] [PASSED] test_granular
[01:00:25] [PASSED] test_unique
[01:00:25] [PASSED] test_overlap
[01:00:25] [PASSED] test_reusable
[01:00:25] [PASSED] test_too_big
[01:00:25] [PASSED] test_flush
[01:00:25] [PASSED] test_lookup
[01:00:25] [PASSED] test_data
[01:00:25] [PASSED] test_class
[01:00:25] ===================== [PASSED] guc_buf =====================
[01:00:25] =================== guc_dbm (7 subtests) ===================
[01:00:25] [PASSED] test_empty
[01:00:25] [PASSED] test_default
[01:00:25] ======================== test_size  ========================
[01:00:25] [PASSED] 4
[01:00:25] [PASSED] 8
[01:00:25] [PASSED] 32
[01:00:25] [PASSED] 256
[01:00:25] ==================== [PASSED] test_size ====================
[01:00:25] ======================= test_reuse  ========================
[01:00:25] [PASSED] 4
[01:00:25] [PASSED] 8
[01:00:25] [PASSED] 32
[01:00:25] [PASSED] 256
[01:00:25] =================== [PASSED] test_reuse ====================
[01:00:25] =================== test_range_overlap  ====================
[01:00:25] [PASSED] 4
[01:00:25] [PASSED] 8
[01:00:25] [PASSED] 32
[01:00:25] [PASSED] 256
[01:00:25] =============== [PASSED] test_range_overlap ================
[01:00:25] =================== test_range_compact  ====================
[01:00:25] [PASSED] 4
[01:00:25] [PASSED] 8
[01:00:25] [PASSED] 32
[01:00:25] [PASSED] 256
[01:00:25] =============== [PASSED] test_range_compact ================
[01:00:25] ==================== test_range_spare  =====================
[01:00:25] [PASSED] 4
[01:00:25] [PASSED] 8
[01:00:25] [PASSED] 32
[01:00:25] [PASSED] 256
[01:00:25] ================ [PASSED] test_range_spare =================
[01:00:25] ===================== [PASSED] guc_dbm =====================
[01:00:25] =================== guc_idm (6 subtests) ===================
[01:00:25] [PASSED] bad_init
[01:00:25] [PASSED] no_init
[01:00:25] [PASSED] init_fini
[01:00:25] [PASSED] check_used
[01:00:25] [PASSED] check_quota
[01:00:25] [PASSED] check_all
[01:00:25] ===================== [PASSED] guc_idm =====================
[01:00:25] ================== no_relay (3 subtests) ===================
[01:00:25] [PASSED] xe_drops_guc2pf_if_not_ready
[01:00:25] [PASSED] xe_drops_guc2vf_if_not_ready
[01:00:25] [PASSED] xe_rejects_send_if_not_ready
[01:00:25] ==================== [PASSED] no_relay =====================
[01:00:25] ================== pf_relay (14 subtests) ==================
[01:00:25] [PASSED] pf_rejects_guc2pf_too_short
[01:00:25] [PASSED] pf_rejects_guc2pf_too_long
[01:00:25] [PASSED] pf_rejects_guc2pf_no_payload
[01:00:25] [PASSED] pf_fails_no_payload
[01:00:25] [PASSED] pf_fails_bad_origin
[01:00:25] [PASSED] pf_fails_bad_type
[01:00:25] [PASSED] pf_txn_reports_error
[01:00:25] [PASSED] pf_txn_sends_pf2guc
[01:00:25] [PASSED] pf_sends_pf2guc
[01:00:25] [SKIPPED] pf_loopback_nop
[01:00:25] [SKIPPED] pf_loopback_echo
[01:00:25] [SKIPPED] pf_loopback_fail
[01:00:25] [SKIPPED] pf_loopback_busy
[01:00:25] [SKIPPED] pf_loopback_retry
[01:00:25] ==================== [PASSED] pf_relay =====================
[01:00:25] ================== vf_relay (3 subtests) ===================
[01:00:25] [PASSED] vf_rejects_guc2vf_too_short
[01:00:25] [PASSED] vf_rejects_guc2vf_too_long
[01:00:25] [PASSED] vf_rejects_guc2vf_no_payload
[01:00:25] ==================== [PASSED] vf_relay =====================
[01:00:25] ================ pf_gt_config (6 subtests) =================
[01:00:25] [PASSED] fair_contexts_1vf
[01:00:25] [PASSED] fair_doorbells_1vf
[01:00:25] [PASSED] fair_ggtt_1vf
[01:00:25] ====================== fair_contexts  ======================
[01:00:25] [PASSED] 1 VF
[01:00:25] [PASSED] 2 VFs
[01:00:25] [PASSED] 3 VFs
[01:00:25] [PASSED] 4 VFs
[01:00:25] [PASSED] 5 VFs
[01:00:25] [PASSED] 6 VFs
[01:00:25] [PASSED] 7 VFs
[01:00:25] [PASSED] 8 VFs
[01:00:25] [PASSED] 9 VFs
[01:00:25] [PASSED] 10 VFs
[01:00:25] [PASSED] 11 VFs
[01:00:25] [PASSED] 12 VFs
[01:00:25] [PASSED] 13 VFs
[01:00:25] [PASSED] 14 VFs
[01:00:25] [PASSED] 15 VFs
[01:00:25] [PASSED] 16 VFs
[01:00:25] [PASSED] 17 VFs
[01:00:25] [PASSED] 18 VFs
[01:00:25] [PASSED] 19 VFs
[01:00:25] [PASSED] 20 VFs
[01:00:25] [PASSED] 21 VFs
[01:00:25] [PASSED] 22 VFs
[01:00:25] [PASSED] 23 VFs
[01:00:25] [PASSED] 24 VFs
[01:00:25] [PASSED] 25 VFs
[01:00:25] [PASSED] 26 VFs
[01:00:25] [PASSED] 27 VFs
[01:00:25] [PASSED] 28 VFs
[01:00:25] [PASSED] 29 VFs
[01:00:25] [PASSED] 30 VFs
[01:00:25] [PASSED] 31 VFs
[01:00:25] [PASSED] 32 VFs
[01:00:25] [PASSED] 33 VFs
[01:00:25] [PASSED] 34 VFs
[01:00:25] [PASSED] 35 VFs
[01:00:25] [PASSED] 36 VFs
[01:00:25] [PASSED] 37 VFs
[01:00:25] [PASSED] 38 VFs
[01:00:25] [PASSED] 39 VFs
[01:00:25] [PASSED] 40 VFs
[01:00:25] [PASSED] 41 VFs
[01:00:25] [PASSED] 42 VFs
[01:00:25] [PASSED] 43 VFs
[01:00:25] [PASSED] 44 VFs
[01:00:25] [PASSED] 45 VFs
[01:00:25] [PASSED] 46 VFs
[01:00:25] [PASSED] 47 VFs
[01:00:25] [PASSED] 48 VFs
[01:00:25] [PASSED] 49 VFs
[01:00:25] [PASSED] 50 VFs
[01:00:25] [PASSED] 51 VFs
[01:00:25] [PASSED] 52 VFs
[01:00:25] [PASSED] 53 VFs
[01:00:25] [PASSED] 54 VFs
[01:00:25] [PASSED] 55 VFs
[01:00:25] [PASSED] 56 VFs
[01:00:25] [PASSED] 57 VFs
[01:00:25] [PASSED] 58 VFs
[01:00:25] [PASSED] 59 VFs
[01:00:25] [PASSED] 60 VFs
[01:00:25] [PASSED] 61 VFs
[01:00:25] [PASSED] 62 VFs
[01:00:25] [PASSED] 63 VFs
[01:00:25] ================== [PASSED] fair_contexts ==================
[01:00:25] ===================== fair_doorbells  ======================
[01:00:25] [PASSED] 1 VF
[01:00:25] [PASSED] 2 VFs
[01:00:25] [PASSED] 3 VFs
[01:00:25] [PASSED] 4 VFs
[01:00:25] [PASSED] 5 VFs
[01:00:25] [PASSED] 6 VFs
[01:00:25] [PASSED] 7 VFs
[01:00:25] [PASSED] 8 VFs
[01:00:25] [PASSED] 9 VFs
[01:00:25] [PASSED] 10 VFs
[01:00:25] [PASSED] 11 VFs
[01:00:25] [PASSED] 12 VFs
[01:00:25] [PASSED] 13 VFs
[01:00:25] [PASSED] 14 VFs
[01:00:25] [PASSED] 15 VFs
[01:00:25] [PASSED] 16 VFs
[01:00:25] [PASSED] 17 VFs
[01:00:25] [PASSED] 18 VFs
[01:00:25] [PASSED] 19 VFs
[01:00:25] [PASSED] 20 VFs
[01:00:25] [PASSED] 21 VFs
[01:00:25] [PASSED] 22 VFs
[01:00:25] [PASSED] 23 VFs
[01:00:25] [PASSED] 24 VFs
[01:00:25] [PASSED] 25 VFs
[01:00:25] [PASSED] 26 VFs
[01:00:25] [PASSED] 27 VFs
[01:00:25] [PASSED] 28 VFs
[01:00:25] [PASSED] 29 VFs
[01:00:25] [PASSED] 30 VFs
[01:00:25] [PASSED] 31 VFs
[01:00:25] [PASSED] 32 VFs
[01:00:25] [PASSED] 33 VFs
[01:00:25] [PASSED] 34 VFs
[01:00:25] [PASSED] 35 VFs
[01:00:25] [PASSED] 36 VFs
[01:00:25] [PASSED] 37 VFs
[01:00:25] [PASSED] 38 VFs
[01:00:25] [PASSED] 39 VFs
[01:00:25] [PASSED] 40 VFs
[01:00:25] [PASSED] 41 VFs
[01:00:25] [PASSED] 42 VFs
[01:00:25] [PASSED] 43 VFs
[01:00:25] [PASSED] 44 VFs
[01:00:26] [PASSED] 45 VFs
[01:00:26] [PASSED] 46 VFs
[01:00:26] [PASSED] 47 VFs
[01:00:26] [PASSED] 48 VFs
[01:00:26] [PASSED] 49 VFs
[01:00:26] [PASSED] 50 VFs
[01:00:26] [PASSED] 51 VFs
[01:00:26] [PASSED] 52 VFs
[01:00:26] [PASSED] 53 VFs
[01:00:26] [PASSED] 54 VFs
[01:00:26] [PASSED] 55 VFs
[01:00:26] [PASSED] 56 VFs
[01:00:26] [PASSED] 57 VFs
[01:00:26] [PASSED] 58 VFs
[01:00:26] [PASSED] 59 VFs
[01:00:26] [PASSED] 60 VFs
[01:00:26] [PASSED] 61 VFs
[01:00:26] [PASSED] 62 VFs
[01:00:26] [PASSED] 63 VFs
[01:00:26] ================= [PASSED] fair_doorbells ==================
[01:00:26] ======================== fair_ggtt  ========================
[01:00:26] [PASSED] 1 VF
[01:00:26] [PASSED] 2 VFs
[01:00:26] [PASSED] 3 VFs
[01:00:26] [PASSED] 4 VFs
[01:00:26] [PASSED] 5 VFs
[01:00:26] [PASSED] 6 VFs
[01:00:26] [PASSED] 7 VFs
[01:00:26] [PASSED] 8 VFs
[01:00:26] [PASSED] 9 VFs
[01:00:26] [PASSED] 10 VFs
[01:00:26] [PASSED] 11 VFs
[01:00:26] [PASSED] 12 VFs
[01:00:26] [PASSED] 13 VFs
[01:00:26] [PASSED] 14 VFs
[01:00:26] [PASSED] 15 VFs
[01:00:26] [PASSED] 16 VFs
[01:00:26] [PASSED] 17 VFs
[01:00:26] [PASSED] 18 VFs
[01:00:26] [PASSED] 19 VFs
[01:00:26] [PASSED] 20 VFs
[01:00:26] [PASSED] 21 VFs
[01:00:26] [PASSED] 22 VFs
[01:00:26] [PASSED] 23 VFs
[01:00:26] [PASSED] 24 VFs
[01:00:26] [PASSED] 25 VFs
[01:00:26] [PASSED] 26 VFs
[01:00:26] [PASSED] 27 VFs
[01:00:26] [PASSED] 28 VFs
[01:00:26] [PASSED] 29 VFs
[01:00:26] [PASSED] 30 VFs
[01:00:26] [PASSED] 31 VFs
[01:00:26] [PASSED] 32 VFs
[01:00:26] [PASSED] 33 VFs
[01:00:26] [PASSED] 34 VFs
[01:00:26] [PASSED] 35 VFs
[01:00:26] [PASSED] 36 VFs
[01:00:26] [PASSED] 37 VFs
[01:00:26] [PASSED] 38 VFs
[01:00:26] [PASSED] 39 VFs
[01:00:26] [PASSED] 40 VFs
[01:00:26] [PASSED] 41 VFs
[01:00:26] [PASSED] 42 VFs
[01:00:26] [PASSED] 43 VFs
[01:00:26] [PASSED] 44 VFs
[01:00:26] [PASSED] 45 VFs
[01:00:26] [PASSED] 46 VFs
[01:00:26] [PASSED] 47 VFs
[01:00:26] [PASSED] 48 VFs
[01:00:26] [PASSED] 49 VFs
[01:00:26] [PASSED] 50 VFs
[01:00:26] [PASSED] 51 VFs
[01:00:26] [PASSED] 52 VFs
[01:00:26] [PASSED] 53 VFs
[01:00:26] [PASSED] 54 VFs
[01:00:26] [PASSED] 55 VFs
[01:00:26] [PASSED] 56 VFs
[01:00:26] [PASSED] 57 VFs
[01:00:26] [PASSED] 58 VFs
[01:00:26] [PASSED] 59 VFs
[01:00:26] [PASSED] 60 VFs
[01:00:26] [PASSED] 61 VFs
[01:00:26] [PASSED] 62 VFs
[01:00:26] [PASSED] 63 VFs
[01:00:26] ==================== [PASSED] fair_ggtt ====================
[01:00:26] ================== [PASSED] pf_gt_config ===================
[01:00:26] ===================== lmtt (1 subtest) =====================
[01:00:26] ======================== test_ops  =========================
[01:00:26] [PASSED] 2-level
[01:00:26] [PASSED] multi-level
[01:00:26] ==================== [PASSED] test_ops =====================
[01:00:26] ====================== [PASSED] lmtt =======================
[01:00:26] ================= pf_service (11 subtests) =================
[01:00:26] [PASSED] pf_negotiate_any
[01:00:26] [PASSED] pf_negotiate_base_match
[01:00:26] [PASSED] pf_negotiate_base_newer
[01:00:26] [PASSED] pf_negotiate_base_next
[01:00:26] [SKIPPED] pf_negotiate_base_older
[01:00:26] [PASSED] pf_negotiate_base_prev
[01:00:26] [PASSED] pf_negotiate_latest_match
[01:00:26] [PASSED] pf_negotiate_latest_newer
[01:00:26] [PASSED] pf_negotiate_latest_next
[01:00:26] [SKIPPED] pf_negotiate_latest_older
[01:00:26] [SKIPPED] pf_negotiate_latest_prev
[01:00:26] =================== [PASSED] pf_service ====================
[01:00:26] ================= xe_guc_g2g (2 subtests) ==================
[01:00:26] ============== xe_live_guc_g2g_kunit_default  ==============
[01:00:26] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[01:00:26] ============== xe_live_guc_g2g_kunit_allmem  ===============
[01:00:26] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[01:00:26] =================== [SKIPPED] xe_guc_g2g ===================
[01:00:26] =================== xe_mocs (2 subtests) ===================
[01:00:26] ================ xe_live_mocs_kernel_kunit  ================
[01:00:26] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[01:00:26] ================ xe_live_mocs_reset_kunit  =================
[01:00:26] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[01:00:26] ==================== [SKIPPED] xe_mocs =====================
[01:00:26] ================= xe_migrate (2 subtests) ==================
[01:00:26] ================= xe_migrate_sanity_kunit  =================
[01:00:26] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[01:00:26] ================== xe_validate_ccs_kunit  ==================
[01:00:26] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[01:00:26] =================== [SKIPPED] xe_migrate ===================
[01:00:26] ================== xe_dma_buf (1 subtest) ==================
[01:00:26] ==================== xe_dma_buf_kunit  =====================
[01:00:26] ================ [SKIPPED] xe_dma_buf_kunit ================
[01:00:26] =================== [SKIPPED] xe_dma_buf ===================
[01:00:26] ================= xe_bo_shrink (1 subtest) =================
[01:00:26] =================== xe_bo_shrink_kunit  ====================
[01:00:26] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[01:00:26] ================== [SKIPPED] xe_bo_shrink ==================
[01:00:26] ==================== xe_bo (2 subtests) ====================
[01:00:26] ================== xe_ccs_migrate_kunit  ===================
[01:00:26] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[01:00:26] ==================== xe_bo_evict_kunit  ====================
[01:00:26] =============== [SKIPPED] xe_bo_evict_kunit ================
[01:00:26] ===================== [SKIPPED] xe_bo ======================
[01:00:26] ==================== args (13 subtests) ====================
[01:00:26] [PASSED] count_args_test
[01:00:26] [PASSED] call_args_example
[01:00:26] [PASSED] call_args_test
[01:00:26] [PASSED] drop_first_arg_example
[01:00:26] [PASSED] drop_first_arg_test
[01:00:26] [PASSED] first_arg_example
[01:00:26] [PASSED] first_arg_test
[01:00:26] [PASSED] last_arg_example
[01:00:26] [PASSED] last_arg_test
[01:00:26] [PASSED] pick_arg_example
[01:00:26] [PASSED] if_args_example
[01:00:26] [PASSED] if_args_test
[01:00:26] [PASSED] sep_comma_example
[01:00:26] ====================== [PASSED] args =======================
[01:00:26] =================== xe_pci (3 subtests) ====================
[01:00:26] ==================== check_graphics_ip  ====================
[01:00:26] [PASSED] 12.00 Xe_LP
[01:00:26] [PASSED] 12.10 Xe_LP+
[01:00:26] [PASSED] 12.55 Xe_HPG
[01:00:26] [PASSED] 12.60 Xe_HPC
[01:00:26] [PASSED] 12.70 Xe_LPG
[01:00:26] [PASSED] 12.71 Xe_LPG
[01:00:26] [PASSED] 12.74 Xe_LPG+
[01:00:26] [PASSED] 20.01 Xe2_HPG
[01:00:26] [PASSED] 20.02 Xe2_HPG
[01:00:26] [PASSED] 20.04 Xe2_LPG
[01:00:26] [PASSED] 30.00 Xe3_LPG
[01:00:26] [PASSED] 30.01 Xe3_LPG
[01:00:26] [PASSED] 30.03 Xe3_LPG
[01:00:26] [PASSED] 30.04 Xe3_LPG
[01:00:26] [PASSED] 30.05 Xe3_LPG
[01:00:26] [PASSED] 35.11 Xe3p_XPC
[01:00:26] ================ [PASSED] check_graphics_ip ================
[01:00:26] ===================== check_media_ip  ======================
[01:00:26] [PASSED] 12.00 Xe_M
[01:00:26] [PASSED] 12.55 Xe_HPM
[01:00:26] [PASSED] 13.00 Xe_LPM+
[01:00:26] [PASSED] 13.01 Xe2_HPM
[01:00:26] [PASSED] 20.00 Xe2_LPM
[01:00:26] [PASSED] 30.00 Xe3_LPM
[01:00:26] [PASSED] 30.02 Xe3_LPM
[01:00:26] [PASSED] 35.00 Xe3p_LPM
[01:00:26] [PASSED] 35.03 Xe3p_HPM
[01:00:26] ================= [PASSED] check_media_ip ==================
[01:00:26] =================== check_platform_desc  ===================
[01:00:26] [PASSED] 0x9A60 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A68 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A70 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A40 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A49 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A59 (TIGERLAKE)
[01:00:26] [PASSED] 0x9A78 (TIGERLAKE)
[01:00:26] [PASSED] 0x9AC0 (TIGERLAKE)
[01:00:26] [PASSED] 0x9AC9 (TIGERLAKE)
[01:00:26] [PASSED] 0x9AD9 (TIGERLAKE)
[01:00:26] [PASSED] 0x9AF8 (TIGERLAKE)
[01:00:26] [PASSED] 0x4C80 (ROCKETLAKE)
[01:00:26] [PASSED] 0x4C8A (ROCKETLAKE)
[01:00:26] [PASSED] 0x4C8B (ROCKETLAKE)
[01:00:26] [PASSED] 0x4C8C (ROCKETLAKE)
[01:00:26] [PASSED] 0x4C90 (ROCKETLAKE)
[01:00:26] [PASSED] 0x4C9A (ROCKETLAKE)
[01:00:26] [PASSED] 0x4680 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4682 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4688 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x468A (ALDERLAKE_S)
[01:00:26] [PASSED] 0x468B (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4690 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4692 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4693 (ALDERLAKE_S)
[01:00:26] [PASSED] 0x46A0 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46A1 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46A2 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46A3 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46A6 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46A8 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46AA (ALDERLAKE_P)
[01:00:26] [PASSED] 0x462A (ALDERLAKE_P)
[01:00:26] [PASSED] 0x4626 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x4628 (ALDERLAKE_P)
stty: 'standard input': Inappropriate ioctl for device
[01:00:26] [PASSED] 0x46B0 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46B1 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46B2 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46B3 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46C0 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46C1 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46C2 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46C3 (ALDERLAKE_P)
[01:00:26] [PASSED] 0x46D0 (ALDERLAKE_N)
[01:00:26] [PASSED] 0x46D1 (ALDERLAKE_N)
[01:00:26] [PASSED] 0x46D2 (ALDERLAKE_N)
[01:00:26] [PASSED] 0x46D3 (ALDERLAKE_N)
[01:00:26] [PASSED] 0x46D4 (ALDERLAKE_N)
[01:00:26] [PASSED] 0xA721 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7A1 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7A9 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7AC (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7AD (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA720 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7A0 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7A8 (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7AA (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA7AB (ALDERLAKE_P)
[01:00:26] [PASSED] 0xA780 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA781 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA782 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA783 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA788 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA789 (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA78A (ALDERLAKE_S)
[01:00:26] [PASSED] 0xA78B (ALDERLAKE_S)
[01:00:26] [PASSED] 0x4905 (DG1)
[01:00:26] [PASSED] 0x4906 (DG1)
[01:00:26] [PASSED] 0x4907 (DG1)
[01:00:26] [PASSED] 0x4908 (DG1)
[01:00:26] [PASSED] 0x4909 (DG1)
[01:00:26] [PASSED] 0x56C0 (DG2)
[01:00:26] [PASSED] 0x56C2 (DG2)
[01:00:26] [PASSED] 0x56C1 (DG2)
[01:00:26] [PASSED] 0x7D51 (METEORLAKE)
[01:00:26] [PASSED] 0x7DD1 (METEORLAKE)
[01:00:26] [PASSED] 0x7D41 (METEORLAKE)
[01:00:26] [PASSED] 0x7D67 (METEORLAKE)
[01:00:26] [PASSED] 0xB640 (METEORLAKE)
[01:00:26] [PASSED] 0x56A0 (DG2)
[01:00:26] [PASSED] 0x56A1 (DG2)
[01:00:26] [PASSED] 0x56A2 (DG2)
[01:00:26] [PASSED] 0x56BE (DG2)
[01:00:26] [PASSED] 0x56BF (DG2)
[01:00:26] [PASSED] 0x5690 (DG2)
[01:00:26] [PASSED] 0x5691 (DG2)
[01:00:26] [PASSED] 0x5692 (DG2)
[01:00:26] [PASSED] 0x56A5 (DG2)
[01:00:26] [PASSED] 0x56A6 (DG2)
[01:00:26] [PASSED] 0x56B0 (DG2)
[01:00:26] [PASSED] 0x56B1 (DG2)
[01:00:26] [PASSED] 0x56BA (DG2)
[01:00:26] [PASSED] 0x56BB (DG2)
[01:00:26] [PASSED] 0x56BC (DG2)
[01:00:26] [PASSED] 0x56BD (DG2)
[01:00:26] [PASSED] 0x5693 (DG2)
[01:00:26] [PASSED] 0x5694 (DG2)
[01:00:26] [PASSED] 0x5695 (DG2)
[01:00:26] [PASSED] 0x56A3 (DG2)
[01:00:26] [PASSED] 0x56A4 (DG2)
[01:00:26] [PASSED] 0x56B2 (DG2)
[01:00:26] [PASSED] 0x56B3 (DG2)
[01:00:26] [PASSED] 0x5696 (DG2)
[01:00:26] [PASSED] 0x5697 (DG2)
[01:00:26] [PASSED] 0xB69 (PVC)
[01:00:26] [PASSED] 0xB6E (PVC)
[01:00:26] [PASSED] 0xBD4 (PVC)
[01:00:26] [PASSED] 0xBD5 (PVC)
[01:00:26] [PASSED] 0xBD6 (PVC)
[01:00:26] [PASSED] 0xBD7 (PVC)
[01:00:26] [PASSED] 0xBD8 (PVC)
[01:00:26] [PASSED] 0xBD9 (PVC)
[01:00:26] [PASSED] 0xBDA (PVC)
[01:00:26] [PASSED] 0xBDB (PVC)
[01:00:26] [PASSED] 0xBE0 (PVC)
[01:00:26] [PASSED] 0xBE1 (PVC)
[01:00:26] [PASSED] 0xBE5 (PVC)
[01:00:26] [PASSED] 0x7D40 (METEORLAKE)
[01:00:26] [PASSED] 0x7D45 (METEORLAKE)
[01:00:26] [PASSED] 0x7D55 (METEORLAKE)
[01:00:26] [PASSED] 0x7D60 (METEORLAKE)
[01:00:26] [PASSED] 0x7DD5 (METEORLAKE)
[01:00:26] [PASSED] 0x6420 (LUNARLAKE)
[01:00:26] [PASSED] 0x64A0 (LUNARLAKE)
[01:00:26] [PASSED] 0x64B0 (LUNARLAKE)
[01:00:26] [PASSED] 0xE202 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE209 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE20B (BATTLEMAGE)
[01:00:26] [PASSED] 0xE20C (BATTLEMAGE)
[01:00:26] [PASSED] 0xE20D (BATTLEMAGE)
[01:00:26] [PASSED] 0xE210 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE211 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE212 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE216 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE220 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE221 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE222 (BATTLEMAGE)
[01:00:26] [PASSED] 0xE223 (BATTLEMAGE)
[01:00:26] [PASSED] 0xB080 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB081 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB082 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB083 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB084 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB085 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB086 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB087 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB08F (PANTHERLAKE)
[01:00:26] [PASSED] 0xB090 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB0A0 (PANTHERLAKE)
[01:00:26] [PASSED] 0xB0B0 (PANTHERLAKE)
[01:00:26] [PASSED] 0xFD80 (PANTHERLAKE)
[01:00:26] [PASSED] 0xFD81 (PANTHERLAKE)
[01:00:26] [PASSED] 0xD740 (NOVALAKE_S)
[01:00:26] [PASSED] 0xD741 (NOVALAKE_S)
[01:00:26] [PASSED] 0xD742 (NOVALAKE_S)
[01:00:26] [PASSED] 0xD743 (NOVALAKE_S)
[01:00:26] [PASSED] 0xD744 (NOVALAKE_S)
[01:00:26] [PASSED] 0xD745 (NOVALAKE_S)
[01:00:26] [PASSED] 0x674C (CRESCENTISLAND)
[01:00:26] =============== [PASSED] check_platform_desc ===============
[01:00:26] ===================== [PASSED] xe_pci ======================
[01:00:26] =================== xe_rtp (2 subtests) ====================
[01:00:26] =============== xe_rtp_process_to_sr_tests  ================
[01:00:26] [PASSED] coalesce-same-reg
[01:00:26] [PASSED] no-match-no-add
[01:00:26] [PASSED] match-or
[01:00:26] [PASSED] match-or-xfail
[01:00:26] [PASSED] no-match-no-add-multiple-rules
[01:00:26] [PASSED] two-regs-two-entries
[01:00:26] [PASSED] clr-one-set-other
[01:00:26] [PASSED] set-field
[01:00:26] [PASSED] conflict-duplicate
[01:00:26] [PASSED] conflict-not-disjoint
[01:00:26] [PASSED] conflict-reg-type
[01:00:26] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[01:00:26] ================== xe_rtp_process_tests  ===================
[01:00:26] [PASSED] active1
[01:00:26] [PASSED] active2
[01:00:26] [PASSED] active-inactive
[01:00:26] [PASSED] inactive-active
[01:00:26] [PASSED] inactive-1st_or_active-inactive
[01:00:26] [PASSED] inactive-2nd_or_active-inactive
[01:00:26] [PASSED] inactive-last_or_active-inactive
[01:00:26] [PASSED] inactive-no_or_active-inactive
[01:00:26] ============== [PASSED] xe_rtp_process_tests ===============
[01:00:26] ===================== [PASSED] xe_rtp ======================
[01:00:26] ==================== xe_wa (1 subtest) =====================
[01:00:26] ======================== xe_wa_gt  =========================
[01:00:26] [PASSED] TIGERLAKE B0
[01:00:26] [PASSED] DG1 A0
[01:00:26] [PASSED] DG1 B0
[01:00:26] [PASSED] ALDERLAKE_S A0
[01:00:26] [PASSED] ALDERLAKE_S B0
[01:00:26] [PASSED] ALDERLAKE_S C0
[01:00:26] [PASSED] ALDERLAKE_S D0
[01:00:26] [PASSED] ALDERLAKE_P A0
[01:00:26] [PASSED] ALDERLAKE_P B0
[01:00:26] [PASSED] ALDERLAKE_P C0
[01:00:26] [PASSED] ALDERLAKE_S RPLS D0
[01:00:26] [PASSED] ALDERLAKE_P RPLU E0
[01:00:26] [PASSED] DG2 G10 C0
[01:00:26] [PASSED] DG2 G11 B1
[01:00:26] [PASSED] DG2 G12 A1
[01:00:26] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[01:00:26] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[01:00:26] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[01:00:26] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[01:00:26] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[01:00:26] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[01:00:26] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[01:00:26] ==================== [PASSED] xe_wa_gt =====================
[01:00:26] ====================== [PASSED] xe_wa ======================
[01:00:26] ============================================================
[01:00:26] Testing complete. Ran 512 tests: passed: 494, skipped: 18
[01:00:26] Elapsed time: 36.563s total, 4.199s configuring, 31.847s building, 0.472s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig
[01:00:26] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[01:00:27] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[01:00:53] Starting KUnit Kernel (1/1)...
[01:00:53] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[01:00:53] ============ drm_test_pick_cmdline (2 subtests) ============
[01:00:53] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[01:00:53] =============== drm_test_pick_cmdline_named  ===============
[01:00:53] [PASSED] NTSC
[01:00:53] [PASSED] NTSC-J
[01:00:53] [PASSED] PAL
[01:00:53] [PASSED] PAL-M
[01:00:53] =========== [PASSED] drm_test_pick_cmdline_named ===========
[01:00:53] ============== [PASSED] drm_test_pick_cmdline ==============
[01:00:53] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[01:00:53] [PASSED] drm_test_drm_atomic_get_connector_for_encoder
[01:00:53] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ====
[01:00:53] =========== drm_validate_clone_mode (2 subtests) ===========
[01:00:53] ============== drm_test_check_in_clone_mode  ===============
[01:00:53] [PASSED] in_clone_mode
[01:00:53] [PASSED] not_in_clone_mode
[01:00:53] ========== [PASSED] drm_test_check_in_clone_mode ===========
[01:00:53] =============== drm_test_check_valid_clones  ===============
[01:00:53] [PASSED] not_in_clone_mode
[01:00:53] [PASSED] valid_clone
[01:00:53] [PASSED] invalid_clone
[01:00:53] =========== [PASSED] drm_test_check_valid_clones ===========
[01:00:53] ============= [PASSED] drm_validate_clone_mode =============
[01:00:53] ============= drm_validate_modeset (1 subtest) =============
[01:00:53] [PASSED] drm_test_check_connector_changed_modeset
[01:00:53] ============== [PASSED] drm_validate_modeset ===============
[01:00:53] ====== drm_test_bridge_get_current_state (2 subtests) ======
[01:00:53] [PASSED] drm_test_drm_bridge_get_current_state_atomic
[01:00:53] [PASSED] drm_test_drm_bridge_get_current_state_legacy
[01:00:53] ======== [PASSED] drm_test_bridge_get_current_state ========
[01:00:53] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ======
[01:00:53] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic
[01:00:53] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled
[01:00:53] [PASSED] drm_test_drm_bridge_helper_reset_crtc_legacy
[01:00:53] ======== [PASSED] drm_test_bridge_helper_reset_crtc ========
[01:00:53] ============== drm_bridge_alloc (2 subtests) ===============
[01:00:53] [PASSED] drm_test_drm_bridge_alloc_basic
[01:00:53] [PASSED] drm_test_drm_bridge_alloc_get_put
[01:00:53] ================ [PASSED] drm_bridge_alloc =================
[01:00:53] ================== drm_buddy (9 subtests) ==================
[01:00:53] [PASSED] drm_test_buddy_alloc_limit
[01:00:53] [PASSED] drm_test_buddy_alloc_optimistic
[01:00:53] [PASSED] drm_test_buddy_alloc_pessimistic
[01:00:53] [PASSED] drm_test_buddy_alloc_pathological
[01:00:53] [PASSED] drm_test_buddy_alloc_contiguous
[01:00:53] [PASSED] drm_test_buddy_alloc_clear
[01:00:53] [PASSED] drm_test_buddy_alloc_range_bias
[01:00:53] [PASSED] drm_test_buddy_fragmentation_performance
[01:00:53] [PASSED] drm_test_buddy_alloc_exceeds_max_order
[01:00:53] ==================== [PASSED] drm_buddy ====================
[01:00:53] ============= drm_cmdline_parser (40 subtests) =============
[01:00:53] [PASSED] drm_test_cmdline_force_d_only
[01:00:53] [PASSED] drm_test_cmdline_force_D_only_dvi
[01:00:53] [PASSED] drm_test_cmdline_force_D_only_hdmi
[01:00:53] [PASSED] drm_test_cmdline_force_D_only_not_digital
[01:00:53] [PASSED] drm_test_cmdline_force_e_only
[01:00:53] [PASSED] drm_test_cmdline_res
[01:00:53] [PASSED] drm_test_cmdline_res_vesa
[01:00:53] [PASSED] drm_test_cmdline_res_vesa_rblank
[01:00:53] [PASSED] drm_test_cmdline_res_rblank
[01:00:53] [PASSED] drm_test_cmdline_res_bpp
[01:00:53] [PASSED] drm_test_cmdline_res_refresh
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[01:00:53] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[01:00:53] [PASSED] drm_test_cmdline_res_margins_force_on
[01:00:53] [PASSED] drm_test_cmdline_res_vesa_margins
[01:00:53] [PASSED] drm_test_cmdline_name
[01:00:53] [PASSED] drm_test_cmdline_name_bpp
[01:00:53] [PASSED] drm_test_cmdline_name_option
[01:00:53] [PASSED] drm_test_cmdline_name_bpp_option
[01:00:53] [PASSED] drm_test_cmdline_rotate_0
[01:00:53] [PASSED] drm_test_cmdline_rotate_90
[01:00:53] [PASSED] drm_test_cmdline_rotate_180
[01:00:53] [PASSED] drm_test_cmdline_rotate_270
[01:00:53] [PASSED] drm_test_cmdline_hmirror
[01:00:53] [PASSED] drm_test_cmdline_vmirror
[01:00:53] [PASSED] drm_test_cmdline_margin_options
[01:00:53] [PASSED] drm_test_cmdline_multiple_options
[01:00:53] [PASSED] drm_test_cmdline_bpp_extra_and_option
[01:00:53] [PASSED] drm_test_cmdline_extra_and_option
[01:00:53] [PASSED] drm_test_cmdline_freestanding_options
[01:00:53] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[01:00:53] [PASSED] drm_test_cmdline_panel_orientation
[01:00:53] ================ drm_test_cmdline_invalid  =================
[01:00:53] [PASSED] margin_only
[01:00:53] [PASSED] interlace_only
[01:00:53] [PASSED] res_missing_x
[01:00:53] [PASSED] res_missing_y
[01:00:53] [PASSED] res_bad_y
[01:00:53] [PASSED] res_missing_y_bpp
[01:00:53] [PASSED] res_bad_bpp
[01:00:53] [PASSED] res_bad_refresh
[01:00:53] [PASSED] res_bpp_refresh_force_on_off
[01:00:53] [PASSED] res_invalid_mode
[01:00:53] [PASSED] res_bpp_wrong_place_mode
[01:00:53] [PASSED] name_bpp_refresh
[01:00:53] [PASSED] name_refresh
[01:00:53] [PASSED] name_refresh_wrong_mode
[01:00:53] [PASSED] name_refresh_invalid_mode
[01:00:53] [PASSED] rotate_multiple
[01:00:53] [PASSED] rotate_invalid_val
[01:00:53] [PASSED] rotate_truncated
[01:00:53] [PASSED] invalid_option
[01:00:53] [PASSED] invalid_tv_option
[01:00:53] [PASSED] truncated_tv_option
[01:00:53] ============ [PASSED] drm_test_cmdline_invalid =============
[01:00:53] =============== drm_test_cmdline_tv_options  ===============
[01:00:53] [PASSED] NTSC
[01:00:53] [PASSED] NTSC_443
[01:00:53] [PASSED] NTSC_J
[01:00:53] [PASSED] PAL
[01:00:53] [PASSED] PAL_M
[01:00:53] [PASSED] PAL_N
[01:00:53] [PASSED] SECAM
[01:00:53] [PASSED] MONO_525
[01:00:53] [PASSED] MONO_625
[01:00:53] =========== [PASSED] drm_test_cmdline_tv_options ===========
[01:00:53] =============== [PASSED] drm_cmdline_parser ================
[01:00:53] ========== drmm_connector_hdmi_init (20 subtests) ==========
[01:00:53] [PASSED] drm_test_connector_hdmi_init_valid
[01:00:53] [PASSED] drm_test_connector_hdmi_init_bpc_8
[01:00:53] [PASSED] drm_test_connector_hdmi_init_bpc_10
[01:00:53] [PASSED] drm_test_connector_hdmi_init_bpc_12
[01:00:53] [PASSED] drm_test_connector_hdmi_init_bpc_invalid
[01:00:53] [PASSED] drm_test_connector_hdmi_init_bpc_null
[01:00:53] [PASSED] drm_test_connector_hdmi_init_formats_empty
[01:00:53] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb
[01:00:53] === drm_test_connector_hdmi_init_formats_yuv420_allowed  ===
[01:00:53] [PASSED] supported_formats=0x9 yuv420_allowed=1
[01:00:53] [PASSED] supported_formats=0x9 yuv420_allowed=0
[01:00:53] [PASSED] supported_formats=0x3 yuv420_allowed=1
[01:00:53] [PASSED] supported_formats=0x3 yuv420_allowed=0
[01:00:53] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[01:00:53] [PASSED] drm_test_connector_hdmi_init_null_ddc
[01:00:53] [PASSED] drm_test_connector_hdmi_init_null_product
[01:00:53] [PASSED] drm_test_connector_hdmi_init_null_vendor
[01:00:53] [PASSED] drm_test_connector_hdmi_init_product_length_exact
[01:00:53] [PASSED] drm_test_connector_hdmi_init_product_length_too_long
[01:00:53] [PASSED] drm_test_connector_hdmi_init_product_valid
[01:00:53] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact
[01:00:53] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long
[01:00:53] [PASSED] drm_test_connector_hdmi_init_vendor_valid
[01:00:53] ========= drm_test_connector_hdmi_init_type_valid  =========
[01:00:53] [PASSED] HDMI-A
[01:00:53] [PASSED] HDMI-B
[01:00:53] ===== [PASSED] drm_test_connector_hdmi_init_type_valid =====
[01:00:53] ======== drm_test_connector_hdmi_init_type_invalid  ========
[01:00:53] [PASSED] Unknown
[01:00:53] [PASSED] VGA
[01:00:53] [PASSED] DVI-I
[01:00:53] [PASSED] DVI-D
[01:00:53] [PASSED] DVI-A
[01:00:53] [PASSED] Composite
[01:00:53] [PASSED] SVIDEO
[01:00:53] [PASSED] LVDS
[01:00:53] [PASSED] Component
[01:00:53] [PASSED] DIN
[01:00:53] [PASSED] DP
[01:00:53] [PASSED] TV
[01:00:53] [PASSED] eDP
[01:00:53] [PASSED] Virtual
[01:00:53] [PASSED] DSI
[01:00:53] [PASSED] DPI
[01:00:53] [PASSED] Writeback
[01:00:53] [PASSED] SPI
[01:00:53] [PASSED] USB
[01:00:53] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ====
[01:00:53] ============ [PASSED] drmm_connector_hdmi_init =============
[01:00:53] ============= drmm_connector_init (3 subtests) =============
[01:00:53] [PASSED] drm_test_drmm_connector_init
[01:00:53] [PASSED] drm_test_drmm_connector_init_null_ddc
[01:00:53] ========= drm_test_drmm_connector_init_type_valid  =========
[01:00:53] [PASSED] Unknown
[01:00:53] [PASSED] VGA
[01:00:53] [PASSED] DVI-I
[01:00:53] [PASSED] DVI-D
[01:00:53] [PASSED] DVI-A
[01:00:53] [PASSED] Composite
[01:00:53] [PASSED] SVIDEO
[01:00:53] [PASSED] LVDS
[01:00:53] [PASSED] Component
[01:00:53] [PASSED] DIN
[01:00:53] [PASSED] DP
[01:00:53] [PASSED] HDMI-A
[01:00:53] [PASSED] HDMI-B
[01:00:53] [PASSED] TV
[01:00:53] [PASSED] eDP
[01:00:53] [PASSED] Virtual
[01:00:53] [PASSED] DSI
[01:00:53] [PASSED] DPI
[01:00:53] [PASSED] Writeback
[01:00:53] [PASSED] SPI
[01:00:53] [PASSED] USB
[01:00:53] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[01:00:53] =============== [PASSED] drmm_connector_init ===============
[01:00:53] ========= drm_connector_dynamic_init (6 subtests) ==========
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_init
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_init_not_added
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_init_properties
[01:00:53] ===== drm_test_drm_connector_dynamic_init_type_valid  ======
[01:00:53] [PASSED] Unknown
[01:00:53] [PASSED] VGA
[01:00:53] [PASSED] DVI-I
[01:00:53] [PASSED] DVI-D
[01:00:53] [PASSED] DVI-A
[01:00:53] [PASSED] Composite
[01:00:53] [PASSED] SVIDEO
[01:00:53] [PASSED] LVDS
[01:00:53] [PASSED] Component
[01:00:53] [PASSED] DIN
[01:00:53] [PASSED] DP
[01:00:53] [PASSED] HDMI-A
[01:00:53] [PASSED] HDMI-B
[01:00:53] [PASSED] TV
[01:00:53] [PASSED] eDP
[01:00:53] [PASSED] Virtual
[01:00:53] [PASSED] DSI
[01:00:53] [PASSED] DPI
[01:00:53] [PASSED] Writeback
[01:00:53] [PASSED] SPI
[01:00:53] [PASSED] USB
[01:00:53] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid ==
[01:00:53] ======== drm_test_drm_connector_dynamic_init_name  =========
[01:00:53] [PASSED] Unknown
[01:00:53] [PASSED] VGA
[01:00:53] [PASSED] DVI-I
[01:00:53] [PASSED] DVI-D
[01:00:53] [PASSED] DVI-A
[01:00:53] [PASSED] Composite
[01:00:53] [PASSED] SVIDEO
[01:00:53] [PASSED] LVDS
[01:00:53] [PASSED] Component
[01:00:53] [PASSED] DIN
[01:00:53] [PASSED] DP
[01:00:53] [PASSED] HDMI-A
[01:00:53] [PASSED] HDMI-B
[01:00:53] [PASSED] TV
[01:00:53] [PASSED] eDP
[01:00:53] [PASSED] Virtual
[01:00:53] [PASSED] DSI
[01:00:53] [PASSED] DPI
[01:00:53] [PASSED] Writeback
[01:00:53] [PASSED] SPI
[01:00:53] [PASSED] USB
[01:00:53] ==== [PASSED] drm_test_drm_connector_dynamic_init_name =====
[01:00:53] =========== [PASSED] drm_connector_dynamic_init ============
[01:00:53] ==== drm_connector_dynamic_register_early (4 subtests) =====
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_early_defer
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object
[01:00:53] ====== [PASSED] drm_connector_dynamic_register_early =======
[01:00:53] ======= drm_connector_dynamic_register (7 subtests) ========
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_on_list
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_no_defer
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_no_init
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_mode_object
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_sysfs
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name
[01:00:53] [PASSED] drm_test_drm_connector_dynamic_register_debugfs
[01:00:53] ========= [PASSED] drm_connector_dynamic_register ==========
[01:00:53] = drm_connector_attach_broadcast_rgb_property (2 subtests) =
[01:00:53] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property
[01:00:53] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector
[01:00:53] === [PASSED] drm_connector_attach_broadcast_rgb_property ===
[01:00:53] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[01:00:53] ========== drm_test_get_tv_mode_from_name_valid  ===========
[01:00:53] [PASSED] NTSC
[01:00:53] [PASSED] NTSC-443
[01:00:53] [PASSED] NTSC-J
[01:00:53] [PASSED] PAL
[01:00:53] [PASSED] PAL-M
[01:00:53] [PASSED] PAL-N
[01:00:53] [PASSED] SECAM
[01:00:53] [PASSED] Mono
[01:00:53] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[01:00:53] [PASSED] drm_test_get_tv_mode_from_name_truncated
[01:00:53] ============ [PASSED] drm_get_tv_mode_from_name ============
[01:00:53] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) =
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1
[01:00:53] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double
[01:00:53] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid  =
[01:00:53] [PASSED] VIC 96
[01:00:53] [PASSED] VIC 97
[01:00:53] [PASSED] VIC 101
[01:00:53] [PASSED] VIC 102
[01:00:53] [PASSED] VIC 106
[01:00:53] [PASSED] VIC 107
[01:00:53] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid ===
[01:00:53] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc
[01:00:53] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc
[01:00:53] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc
[01:00:53] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc
[01:00:53] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc
[01:00:53] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ====
[01:00:53] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) ==
[01:00:53] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name  ====
[01:00:53] [PASSED] Automatic
[01:00:53] [PASSED] Full
[01:00:53] [PASSED] Limited 16:235
[01:00:53] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name ===
[01:00:53] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid
[01:00:53] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ====
[01:00:53] == drm_hdmi_connector_get_output_format_name (2 subtests) ==
[01:00:53] === drm_test_drm_hdmi_connector_get_output_format_name  ====
[01:00:53] [PASSED] RGB
[01:00:53] [PASSED] YUV 4:2:0
[01:00:53] [PASSED] YUV 4:2:2
[01:00:53] [PASSED] YUV 4:4:4
[01:00:53] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name ===
[01:00:53] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid
[01:00:53] ==== [PASSED] drm_hdmi_connector_get_output_format_name ====
[01:00:53] ============= drm_damage_helper (21 subtests) ==============
[01:00:53] [PASSED] drm_test_damage_iter_no_damage
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_src_moved
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_not_visible
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[01:00:53] [PASSED] drm_test_damage_iter_no_damage_no_fb
[01:00:53] [PASSED] drm_test_damage_iter_simple_damage
[01:00:53] [PASSED] drm_test_damage_iter_single_damage
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_outside_src
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_src_moved
[01:00:53] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[01:00:53] [PASSED] drm_test_damage_iter_damage
[01:00:53] [PASSED] drm_test_damage_iter_damage_one_intersect
[01:00:53] [PASSED] drm_test_damage_iter_damage_one_outside
[01:00:53] [PASSED] drm_test_damage_iter_damage_src_moved
[01:00:53] [PASSED] drm_test_damage_iter_damage_not_visible
[01:00:53] ================ [PASSED] drm_damage_helper ================
[01:00:53] ============== drm_dp_mst_helper (3 subtests) ==============
[01:00:53] ============== drm_test_dp_mst_calc_pbn_mode  ==============
[01:00:53] [PASSED] Clock 154000 BPP 30 DSC disabled
[01:00:53] [PASSED] Clock 234000 BPP 30 DSC disabled
[01:00:53] [PASSED] Clock 297000 BPP 24 DSC disabled
[01:00:53] [PASSED] Clock 332880 BPP 24 DSC enabled
[01:00:53] [PASSED] Clock 324540 BPP 24 DSC enabled
[01:00:53] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[01:00:53] ============== drm_test_dp_mst_calc_pbn_div  ===============
[01:00:53] [PASSED] Link rate 2000000 lane count 4
[01:00:53] [PASSED] Link rate 2000000 lane count 2
[01:00:53] [PASSED] Link rate 2000000 lane count 1
[01:00:53] [PASSED] Link rate 1350000 lane count 4
[01:00:53] [PASSED] Link rate 1350000 lane count 2
[01:00:53] [PASSED] Link rate 1350000 lane count 1
[01:00:53] [PASSED] Link rate 1000000 lane count 4
[01:00:53] [PASSED] Link rate 1000000 lane count 2
[01:00:53] [PASSED] Link rate 1000000 lane count 1
[01:00:53] [PASSED] Link rate 810000 lane count 4
[01:00:53] [PASSED] Link rate 810000 lane count 2
[01:00:53] [PASSED] Link rate 810000 lane count 1
[01:00:53] [PASSED] Link rate 540000 lane count 4
[01:00:53] [PASSED] Link rate 540000 lane count 2
[01:00:53] [PASSED] Link rate 540000 lane count 1
[01:00:53] [PASSED] Link rate 270000 lane count 4
[01:00:53] [PASSED] Link rate 270000 lane count 2
[01:00:53] [PASSED] Link rate 270000 lane count 1
[01:00:53] [PASSED] Link rate 162000 lane count 4
[01:00:53] [PASSED] Link rate 162000 lane count 2
[01:00:53] [PASSED] Link rate 162000 lane count 1
[01:00:53] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[01:00:53] ========= drm_test_dp_mst_sideband_msg_req_decode  =========
[01:00:53] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[01:00:53] [PASSED] DP_POWER_UP_PHY with port number
[01:00:53] [PASSED] DP_POWER_DOWN_PHY with port number
[01:00:53] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[01:00:53] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[01:00:53] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[01:00:53] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[01:00:53] [PASSED] DP_QUERY_PAYLOAD with port number
[01:00:53] [PASSED] DP_QUERY_PAYLOAD with VCPI
[01:00:53] [PASSED] DP_REMOTE_DPCD_READ with port number
[01:00:53] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[01:00:53] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[01:00:53] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[01:00:53] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[01:00:53] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[01:00:53] [PASSED] DP_REMOTE_I2C_READ with port number
[01:00:53] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[01:00:53] [PASSED] DP_REMOTE_I2C_READ with transactions array
[01:00:53] [PASSED] DP_REMOTE_I2C_WRITE with port number
[01:00:53] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[01:00:53] [PASSED] DP_REMOTE_I2C_WRITE with data array
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[01:00:53] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[01:00:53] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[01:00:53] ================ [PASSED] drm_dp_mst_helper ================
[01:00:53] ================== drm_exec (7 subtests) ===================
[01:00:53] [PASSED] sanitycheck
[01:00:53] [PASSED] test_lock
[01:00:53] [PASSED] test_lock_unlock
[01:00:53] [PASSED] test_duplicates
[01:00:53] [PASSED] test_prepare
[01:00:53] [PASSED] test_prepare_array
[01:00:53] [PASSED] test_multiple_loops
[01:00:53] ==================== [PASSED] drm_exec =====================
[01:00:53] =========== drm_format_helper_test (17 subtests) ===========
[01:00:53] ============== drm_test_fb_xrgb8888_to_gray8  ==============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[01:00:53] ============= drm_test_fb_xrgb8888_to_rgb332  ==============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[01:00:53] ============= drm_test_fb_xrgb8888_to_rgb565  ==============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[01:00:53] ============ drm_test_fb_xrgb8888_to_xrgb1555  =============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[01:00:53] ============ drm_test_fb_xrgb8888_to_argb1555  =============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[01:00:53] ============ drm_test_fb_xrgb8888_to_rgba5551  =============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[01:00:53] ============= drm_test_fb_xrgb8888_to_rgb888  ==============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[01:00:53] ============= drm_test_fb_xrgb8888_to_bgr888  ==============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ==========
[01:00:53] ============ drm_test_fb_xrgb8888_to_argb8888  =============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[01:00:53] =========== drm_test_fb_xrgb8888_to_xrgb2101010  ===========
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[01:00:53] =========== drm_test_fb_xrgb8888_to_argb2101010  ===========
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[01:00:53] ============== drm_test_fb_xrgb8888_to_mono  ===============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[01:00:53] ==================== drm_test_fb_swab  =====================
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:53] ================ [PASSED] drm_test_fb_swab =================
[01:00:53] ============ drm_test_fb_xrgb8888_to_xbgr8888  =============
[01:00:53] [PASSED] single_pixel_source_buffer
[01:00:53] [PASSED] single_pixel_clip_rectangle
[01:00:53] [PASSED] well_known_colors
[01:00:53] [PASSED] destination_pitch
[01:00:54] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[01:00:54] ============ drm_test_fb_xrgb8888_to_abgr8888  =============
[01:00:54] [PASSED] single_pixel_source_buffer
[01:00:54] [PASSED] single_pixel_clip_rectangle
[01:00:54] [PASSED] well_known_colors
[01:00:54] [PASSED] destination_pitch
[01:00:54] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[01:00:54] ================= drm_test_fb_clip_offset  =================
[01:00:54] [PASSED] pass through
[01:00:54] [PASSED] horizontal offset
[01:00:54] [PASSED] vertical offset
[01:00:54] [PASSED] horizontal and vertical offset
[01:00:54] [PASSED] horizontal offset (custom pitch)
[01:00:54] [PASSED] vertical offset (custom pitch)
[01:00:54] [PASSED] horizontal and vertical offset (custom pitch)
[01:00:54] ============= [PASSED] drm_test_fb_clip_offset =============
[01:00:54] =================== drm_test_fb_memcpy  ====================
[01:00:54] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[01:00:54] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[01:00:54] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[01:00:54] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[01:00:54] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[01:00:54] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[01:00:54] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[01:00:54] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[01:00:54] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[01:00:54] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[01:00:54] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[01:00:54] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[01:00:54] =============== [PASSED] drm_test_fb_memcpy ================
[01:00:54] ============= [PASSED] drm_format_helper_test ==============
[01:00:54] ================= drm_format (18 subtests) =================
[01:00:54] [PASSED] drm_test_format_block_width_invalid
[01:00:54] [PASSED] drm_test_format_block_width_one_plane
[01:00:54] [PASSED] drm_test_format_block_width_two_plane
[01:00:54] [PASSED] drm_test_format_block_width_three_plane
[01:00:54] [PASSED] drm_test_format_block_width_tiled
[01:00:54] [PASSED] drm_test_format_block_height_invalid
[01:00:54] [PASSED] drm_test_format_block_height_one_plane
[01:00:54] [PASSED] drm_test_format_block_height_two_plane
[01:00:54] [PASSED] drm_test_format_block_height_three_plane
[01:00:54] [PASSED] drm_test_format_block_height_tiled
[01:00:54] [PASSED] drm_test_format_min_pitch_invalid
[01:00:54] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[01:00:54] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[01:00:54] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[01:00:54] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[01:00:54] [PASSED] drm_test_format_min_pitch_two_plane
[01:00:54] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[01:00:54] [PASSED] drm_test_format_min_pitch_tiled
[01:00:54] =================== [PASSED] drm_format ====================
[01:00:54] ============== drm_framebuffer (10 subtests) ===============
[01:00:54] ========== drm_test_framebuffer_check_src_coords  ==========
[01:00:54] [PASSED] Success: source fits into fb
[01:00:54] [PASSED] Fail: overflowing fb with x-axis coordinate
[01:00:54] [PASSED] Fail: overflowing fb with y-axis coordinate
[01:00:54] [PASSED] Fail: overflowing fb with source width
[01:00:54] [PASSED] Fail: overflowing fb with source height
[01:00:54] ====== [PASSED] drm_test_framebuffer_check_src_coords ======
[01:00:54] [PASSED] drm_test_framebuffer_cleanup
[01:00:54] =============== drm_test_framebuffer_create  ===============
[01:00:54] [PASSED] ABGR8888 normal sizes
[01:00:54] [PASSED] ABGR8888 max sizes
[01:00:54] [PASSED] ABGR8888 pitch greater than min required
[01:00:54] [PASSED] ABGR8888 pitch less than min required
[01:00:54] [PASSED] ABGR8888 Invalid width
[01:00:54] [PASSED] ABGR8888 Invalid buffer handle
[01:00:54] [PASSED] No pixel format
[01:00:54] [PASSED] ABGR8888 Width 0
[01:00:54] [PASSED] ABGR8888 Height 0
[01:00:54] [PASSED] ABGR8888 Out of bound height * pitch combination
[01:00:54] [PASSED] ABGR8888 Large buffer offset
[01:00:54] [PASSED] ABGR8888 Buffer offset for inexistent plane
[01:00:54] [PASSED] ABGR8888 Invalid flag
[01:00:54] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[01:00:54] [PASSED] ABGR8888 Valid buffer modifier
[01:00:54] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[01:00:54] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] NV12 Normal sizes
[01:00:54] [PASSED] NV12 Max sizes
[01:00:54] [PASSED] NV12 Invalid pitch
[01:00:54] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[01:00:54] [PASSED] NV12 different  modifier per-plane
[01:00:54] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[01:00:54] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] NV12 Modifier for inexistent plane
[01:00:54] [PASSED] NV12 Handle for inexistent plane
[01:00:54] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[01:00:54] [PASSED] YVU420 Normal sizes
[01:00:54] [PASSED] YVU420 Max sizes
[01:00:54] [PASSED] YVU420 Invalid pitch
[01:00:54] [PASSED] YVU420 Different pitches
[01:00:54] [PASSED] YVU420 Different buffer offsets/pitches
[01:00:54] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[01:00:54] [PASSED] YVU420 Valid modifier
[01:00:54] [PASSED] YVU420 Different modifiers per plane
[01:00:54] [PASSED] YVU420 Modifier for inexistent plane
[01:00:54] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)
[01:00:54] [PASSED] X0L2 Normal sizes
[01:00:54] [PASSED] X0L2 Max sizes
[01:00:54] [PASSED] X0L2 Invalid pitch
[01:00:54] [PASSED] X0L2 Pitch greater than minimum required
[01:00:54] [PASSED] X0L2 Handle for inexistent plane
[01:00:54] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[01:00:54] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[01:00:54] [PASSED] X0L2 Valid modifier
[01:00:54] [PASSED] X0L2 Modifier for inexistent plane
[01:00:54] =========== [PASSED] drm_test_framebuffer_create ===========
[01:00:54] [PASSED] drm_test_framebuffer_free
[01:00:54] [PASSED] drm_test_framebuffer_init
[01:00:54] [PASSED] drm_test_framebuffer_init_bad_format
[01:00:54] [PASSED] drm_test_framebuffer_init_dev_mismatch
[01:00:54] [PASSED] drm_test_framebuffer_lookup
[01:00:54] [PASSED] drm_test_framebuffer_lookup_inexistent
[01:00:54] [PASSED] drm_test_framebuffer_modifiers_not_supported
[01:00:54] ================= [PASSED] drm_framebuffer =================
[01:00:54] ================ drm_gem_shmem (8 subtests) ================
[01:00:54] [PASSED] drm_gem_shmem_test_obj_create
[01:00:54] [PASSED] drm_gem_shmem_test_obj_create_private
[01:00:54] [PASSED] drm_gem_shmem_test_pin_pages
[01:00:54] [PASSED] drm_gem_shmem_test_vmap
[01:00:54] [PASSED] drm_gem_shmem_test_get_sg_table
[01:00:54] [PASSED] drm_gem_shmem_test_get_pages_sgt
[01:00:54] [PASSED] drm_gem_shmem_test_madvise
[01:00:54] [PASSED] drm_gem_shmem_test_purge
[01:00:54] ================== [PASSED] drm_gem_shmem ==================
[01:00:54] === drm_atomic_helper_connector_hdmi_check (27 subtests) ===
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1
[01:00:54] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420  =======
[01:00:54] [PASSED] Automatic
[01:00:54] [PASSED] Full
[01:00:54] [PASSED] Limited 16:235
[01:00:54] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 ===
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed
[01:00:54] [PASSED] drm_test_check_disable_connector
[01:00:54] [PASSED] drm_test_check_hdmi_funcs_reject_rate
[01:00:54] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb
[01:00:54] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420
[01:00:54] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422
[01:00:54] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420
[01:00:54] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420
[01:00:54] [PASSED] drm_test_check_output_bpc_crtc_mode_changed
[01:00:54] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed
[01:00:54] [PASSED] drm_test_check_output_bpc_dvi
[01:00:54] [PASSED] drm_test_check_output_bpc_format_vic_1
[01:00:54] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only
[01:00:54] [PASSED] drm_test_check_output_bpc_format_display_rgb_only
[01:00:54] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only
[01:00:54] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only
[01:00:54] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc
[01:00:54] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc
[01:00:54] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc
[01:00:54] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ======
[01:00:54] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ====
[01:00:54] [PASSED] drm_test_check_broadcast_rgb_value
[01:00:54] [PASSED] drm_test_check_bpc_8_value
[01:00:54] [PASSED] drm_test_check_bpc_10_value
[01:00:54] [PASSED] drm_test_check_bpc_12_value
[01:00:54] [PASSED] drm_test_check_format_value
[01:00:54] [PASSED] drm_test_check_tmds_char_value
[01:00:54] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ======
[01:00:54] = drm_atomic_helper_connector_hdmi_mode_valid (4 subtests) =
[01:00:54] [PASSED] drm_test_check_mode_valid
[01:00:54] [PASSED] drm_test_check_mode_valid_reject
[01:00:54] [PASSED] drm_test_check_mode_valid_reject_rate
[01:00:54] [PASSED] drm_test_check_mode_valid_reject_max_clock
[01:00:54] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid ===
[01:00:54] = drm_atomic_helper_connector_hdmi_infoframes (5 subtests) =
[01:00:54] [PASSED] drm_test_check_infoframes
[01:00:54] [PASSED] drm_test_check_reject_avi_infoframe
[01:00:54] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_8
[01:00:54] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_10
[01:00:54] [PASSED] drm_test_check_reject_audio_infoframe
[01:00:54] === [PASSED] drm_atomic_helper_connector_hdmi_infoframes ===
[01:00:54] ================= drm_managed (2 subtests) =================
[01:00:54] [PASSED] drm_test_managed_release_action
[01:00:54] [PASSED] drm_test_managed_run_action
[01:00:54] =================== [PASSED] drm_managed ===================
[01:00:54] =================== drm_mm (6 subtests) ====================
[01:00:54] [PASSED] drm_test_mm_init
[01:00:54] [PASSED] drm_test_mm_debug
[01:00:54] [PASSED] drm_test_mm_align32
[01:00:54] [PASSED] drm_test_mm_align64
[01:00:54] [PASSED] drm_test_mm_lowest
[01:00:54] [PASSED] drm_test_mm_highest
[01:00:54] ===================== [PASSED] drm_mm ======================
[01:00:54] ============= drm_modes_analog_tv (5 subtests) =============
[01:00:54] [PASSED] drm_test_modes_analog_tv_mono_576i
[01:00:54] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[01:00:54] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[01:00:54] [PASSED] drm_test_modes_analog_tv_pal_576i
[01:00:54] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[01:00:54] =============== [PASSED] drm_modes_analog_tv ===============
[01:00:54] ============== drm_plane_helper (2 subtests) ===============
[01:00:54] =============== drm_test_check_plane_state  ================
[01:00:54] [PASSED] clipping_simple
[01:00:54] [PASSED] clipping_rotate_reflect
[01:00:54] [PASSED] positioning_simple
[01:00:54] [PASSED] upscaling
[01:00:54] [PASSED] downscaling
[01:00:54] [PASSED] rounding1
[01:00:54] [PASSED] rounding2
[01:00:54] [PASSED] rounding3
[01:00:54] [PASSED] rounding4
[01:00:54] =========== [PASSED] drm_test_check_plane_state ============
[01:00:54] =========== drm_test_check_invalid_plane_state  ============
[01:00:54] [PASSED] positioning_invalid
[01:00:54] [PASSED] upscaling_invalid
[01:00:54] [PASSED] downscaling_invalid
[01:00:54] ======= [PASSED] drm_test_check_invalid_plane_state ========
[01:00:54] ================ [PASSED] drm_plane_helper =================
[01:00:54] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[01:00:54] ====== drm_test_connector_helper_tv_get_modes_check  =======
[01:00:54] [PASSED] None
[01:00:54] [PASSED] PAL
[01:00:54] [PASSED] NTSC
[01:00:54] [PASSED] Both, NTSC Default
[01:00:54] [PASSED] Both, PAL Default
[01:00:54] [PASSED] Both, NTSC Default, with PAL on command-line
[01:00:54] [PASSED] Both, PAL Default, with NTSC on command-line
[01:00:54] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[01:00:54] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[01:00:54] ================== drm_rect (9 subtests) ===================
[01:00:54] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[01:00:54] [PASSED] drm_test_rect_clip_scaled_not_clipped
[01:00:54] [PASSED] drm_test_rect_clip_scaled_clipped
[01:00:54] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[01:00:54] ================= drm_test_rect_intersect  =================
[01:00:54] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[01:00:54] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[01:00:54] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[01:00:54] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[01:00:54] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[01:00:54] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[01:00:54] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[01:00:54] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[01:00:54] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[01:00:54] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[01:00:54] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[01:00:54] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[01:00:54] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[01:00:54] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[01:00:54] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
stty: 'standard input': Inappropriate ioctl for device
[01:00:54] ============= [PASSED] drm_test_rect_intersect =============
[01:00:54] ================ drm_test_rect_calc_hscale  ================
[01:00:54] [PASSED] normal use
[01:00:54] [PASSED] out of max range
[01:00:54] [PASSED] out of min range
[01:00:54] [PASSED] zero dst
[01:00:54] [PASSED] negative src
[01:00:54] [PASSED] negative dst
[01:00:54] ============ [PASSED] drm_test_rect_calc_hscale ============
[01:00:54] ================ drm_test_rect_calc_vscale  ================
[01:00:54] [PASSED] normal use
[01:00:54] [PASSED] out of max range
[01:00:54] [PASSED] out of min range
[01:00:54] [PASSED] zero dst
[01:00:54] [PASSED] negative src
[01:00:54] [PASSED] negative dst
[01:00:54] ============ [PASSED] drm_test_rect_calc_vscale ============
[01:00:54] ================== drm_test_rect_rotate  ===================
[01:00:54] [PASSED] reflect-x
[01:00:54] [PASSED] reflect-y
[01:00:54] [PASSED] rotate-0
[01:00:54] [PASSED] rotate-90
[01:00:54] [PASSED] rotate-180
[01:00:54] [PASSED] rotate-270
[01:00:54] ============== [PASSED] drm_test_rect_rotate ===============
[01:00:54] ================ drm_test_rect_rotate_inv  =================
[01:00:54] [PASSED] reflect-x
[01:00:54] [PASSED] reflect-y
[01:00:54] [PASSED] rotate-0
[01:00:54] [PASSED] rotate-90
[01:00:54] [PASSED] rotate-180
[01:00:54] [PASSED] rotate-270
[01:00:54] ============ [PASSED] drm_test_rect_rotate_inv =============
[01:00:54] ==================== [PASSED] drm_rect =====================
[01:00:54] ============ drm_sysfb_modeset_test (1 subtest) ============
[01:00:54] ============ drm_test_sysfb_build_fourcc_list  =============
[01:00:54] [PASSED] no native formats
[01:00:54] [PASSED] XRGB8888 as native format
[01:00:54] [PASSED] remove duplicates
[01:00:54] [PASSED] convert alpha formats
[01:00:54] [PASSED] random formats
[01:00:54] ======== [PASSED] drm_test_sysfb_build_fourcc_list =========
[01:00:54] ============= [PASSED] drm_sysfb_modeset_test ==============
[01:00:54] ================== drm_fixp (2 subtests) ===================
[01:00:54] [PASSED] drm_test_int2fixp
[01:00:54] [PASSED] drm_test_sm2fixp
[01:00:54] ==================== [PASSED] drm_fixp =====================
[01:00:54] ============================================================
[01:00:54] Testing complete. Ran 630 tests: passed: 630
[01:00:54] Elapsed time: 27.801s total, 1.683s configuring, 25.651s building, 0.427s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig
[01:00:54] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[01:00:55] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[01:01:05] Starting KUnit Kernel (1/1)...
[01:01:05] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[01:01:05] ================= ttm_device (5 subtests) ==================
[01:01:05] [PASSED] ttm_device_init_basic
[01:01:05] [PASSED] ttm_device_init_multiple
[01:01:05] [PASSED] ttm_device_fini_basic
[01:01:05] [PASSED] ttm_device_init_no_vma_man
[01:01:05] ================== ttm_device_init_pools  ==================
[01:01:05] [PASSED] No DMA allocations, no DMA32 required
[01:01:05] [PASSED] DMA allocations, DMA32 required
[01:01:05] [PASSED] No DMA allocations, DMA32 required
[01:01:05] [PASSED] DMA allocations, no DMA32 required
[01:01:05] ============== [PASSED] ttm_device_init_pools ==============
[01:01:05] =================== [PASSED] ttm_device ====================
[01:01:05] ================== ttm_pool (8 subtests) ===================
[01:01:05] ================== ttm_pool_alloc_basic  ===================
[01:01:05] [PASSED] One page
[01:01:05] [PASSED] More than one page
[01:01:05] [PASSED] Above the allocation limit
[01:01:05] [PASSED] One page, with coherent DMA mappings enabled
[01:01:05] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[01:01:05] ============== [PASSED] ttm_pool_alloc_basic ===============
[01:01:05] ============== ttm_pool_alloc_basic_dma_addr  ==============
[01:01:05] [PASSED] One page
[01:01:05] [PASSED] More than one page
[01:01:05] [PASSED] Above the allocation limit
[01:01:05] [PASSED] One page, with coherent DMA mappings enabled
[01:01:05] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[01:01:05] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[01:01:05] [PASSED] ttm_pool_alloc_order_caching_match
[01:01:05] [PASSED] ttm_pool_alloc_caching_mismatch
[01:01:05] [PASSED] ttm_pool_alloc_order_mismatch
[01:01:05] [PASSED] ttm_pool_free_dma_alloc
[01:01:05] [PASSED] ttm_pool_free_no_dma_alloc
[01:01:05] [PASSED] ttm_pool_fini_basic
[01:01:05] ==================== [PASSED] ttm_pool =====================
[01:01:05] ================ ttm_resource (8 subtests) =================
[01:01:05] ================= ttm_resource_init_basic  =================
[01:01:05] [PASSED] Init resource in TTM_PL_SYSTEM
[01:01:05] [PASSED] Init resource in TTM_PL_VRAM
[01:01:05] [PASSED] Init resource in a private placement
[01:01:05] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[01:01:05] ============= [PASSED] ttm_resource_init_basic =============
[01:01:05] [PASSED] ttm_resource_init_pinned
[01:01:05] [PASSED] ttm_resource_fini_basic
[01:01:05] [PASSED] ttm_resource_manager_init_basic
[01:01:05] [PASSED] ttm_resource_manager_usage_basic
[01:01:05] [PASSED] ttm_resource_manager_set_used_basic
[01:01:05] [PASSED] ttm_sys_man_alloc_basic
[01:01:05] [PASSED] ttm_sys_man_free_basic
[01:01:05] ================== [PASSED] ttm_resource ===================
[01:01:05] =================== ttm_tt (15 subtests) ===================
[01:01:05] ==================== ttm_tt_init_basic  ====================
[01:01:05] [PASSED] Page-aligned size
[01:01:05] [PASSED] Extra pages requested
[01:01:05] ================ [PASSED] ttm_tt_init_basic ================
[01:01:05] [PASSED] ttm_tt_init_misaligned
[01:01:05] [PASSED] ttm_tt_fini_basic
[01:01:05] [PASSED] ttm_tt_fini_sg
[01:01:05] [PASSED] ttm_tt_fini_shmem
[01:01:05] [PASSED] ttm_tt_create_basic
[01:01:05] [PASSED] ttm_tt_create_invalid_bo_type
[01:01:05] [PASSED] ttm_tt_create_ttm_exists
[01:01:05] [PASSED] ttm_tt_create_failed
[01:01:05] [PASSED] ttm_tt_destroy_basic
[01:01:05] [PASSED] ttm_tt_populate_null_ttm
[01:01:05] [PASSED] ttm_tt_populate_populated_ttm
[01:01:05] [PASSED] ttm_tt_unpopulate_basic
[01:01:05] [PASSED] ttm_tt_unpopulate_empty_ttm
[01:01:05] [PASSED] ttm_tt_swapin_basic
[01:01:05] ===================== [PASSED] ttm_tt ======================
[01:01:05] =================== ttm_bo (14 subtests) ===================
[01:01:05] =========== ttm_bo_reserve_optimistic_no_ticket  ===========
[01:01:05] [PASSED] Cannot be interrupted and sleeps
[01:01:05] [PASSED] Cannot be interrupted, locks straight away
[01:01:05] [PASSED] Can be interrupted, sleeps
[01:01:05] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[01:01:05] [PASSED] ttm_bo_reserve_locked_no_sleep
[01:01:05] [PASSED] ttm_bo_reserve_no_wait_ticket
[01:01:05] [PASSED] ttm_bo_reserve_double_resv
[01:01:05] [PASSED] ttm_bo_reserve_interrupted
[01:01:05] [PASSED] ttm_bo_reserve_deadlock
[01:01:05] [PASSED] ttm_bo_unreserve_basic
[01:01:05] [PASSED] ttm_bo_unreserve_pinned
[01:01:05] [PASSED] ttm_bo_unreserve_bulk
[01:01:05] [PASSED] ttm_bo_fini_basic
[01:01:05] [PASSED] ttm_bo_fini_shared_resv
[01:01:05] [PASSED] ttm_bo_pin_basic
[01:01:05] [PASSED] ttm_bo_pin_unpin_resource
[01:01:05] [PASSED] ttm_bo_multiple_pin_one_unpin
[01:01:05] ===================== [PASSED] ttm_bo ======================
[01:01:05] ============== ttm_bo_validate (21 subtests) ===============
[01:01:05] ============== ttm_bo_init_reserved_sys_man  ===============
[01:01:05] [PASSED] Buffer object for userspace
[01:01:05] [PASSED] Kernel buffer object
[01:01:05] [PASSED] Shared buffer object
[01:01:05] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[01:01:05] ============== ttm_bo_init_reserved_mock_man  ==============
[01:01:05] [PASSED] Buffer object for userspace
[01:01:05] [PASSED] Kernel buffer object
[01:01:05] [PASSED] Shared buffer object
[01:01:05] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[01:01:05] [PASSED] ttm_bo_init_reserved_resv
[01:01:05] ================== ttm_bo_validate_basic  ==================
[01:01:05] [PASSED] Buffer object for userspace
[01:01:05] [PASSED] Kernel buffer object
[01:01:05] [PASSED] Shared buffer object
[01:01:05] ============== [PASSED] ttm_bo_validate_basic ==============
[01:01:05] [PASSED] ttm_bo_validate_invalid_placement
[01:01:05] ============= ttm_bo_validate_same_placement  ==============
[01:01:05] [PASSED] System manager
[01:01:05] [PASSED] VRAM manager
[01:01:05] ========= [PASSED] ttm_bo_validate_same_placement ==========
[01:01:05] [PASSED] ttm_bo_validate_failed_alloc
[01:01:05] [PASSED] ttm_bo_validate_pinned
[01:01:05] [PASSED] ttm_bo_validate_busy_placement
[01:01:05] ================ ttm_bo_validate_multihop  =================
[01:01:05] [PASSED] Buffer object for userspace
[01:01:05] [PASSED] Kernel buffer object
[01:01:05] [PASSED] Shared buffer object
[01:01:05] ============ [PASSED] ttm_bo_validate_multihop =============
[01:01:05] ========== ttm_bo_validate_no_placement_signaled  ==========
[01:01:05] [PASSED] Buffer object in system domain, no page vector
[01:01:05] [PASSED] Buffer object in system domain with an existing page vector
[01:01:05] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[01:01:05] ======== ttm_bo_validate_no_placement_not_signaled  ========
[01:01:05] [PASSED] Buffer object for userspace
[01:01:05] [PASSED] Kernel buffer object
[01:01:05] [PASSED] Shared buffer object
[01:01:05] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[01:01:05] [PASSED] ttm_bo_validate_move_fence_signaled
[01:01:05] ========= ttm_bo_validate_move_fence_not_signaled  =========
[01:01:05] [PASSED] Waits for GPU
[01:01:05] [PASSED] Tries to lock straight away
[01:01:05] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[01:01:05] [PASSED] ttm_bo_validate_happy_evict
[01:01:05] [PASSED] ttm_bo_validate_all_pinned_evict
[01:01:05] [PASSED] ttm_bo_validate_allowed_only_evict
[01:01:05] [PASSED] ttm_bo_validate_deleted_evict
[01:01:05] [PASSED] ttm_bo_validate_busy_domain_evict
[01:01:05] [PASSED] ttm_bo_validate_evict_gutting
[01:01:05] [PASSED] ttm_bo_validate_recrusive_evict
stty: 'standard input': Inappropriate ioctl for device
[01:01:05] ================= [PASSED] ttm_bo_validate =================
[01:01:05] ============================================================
[01:01:05] Testing complete. Ran 101 tests: passed: 101
[01:01:05] Elapsed time: 11.400s total, 1.657s configuring, 9.527s building, 0.179s running

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel



^ permalink raw reply	[flat|nested] 30+ messages in thread

* ✓ Xe.CI.BAT: success for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
  2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
                   ` (12 preceding siblings ...)
  2026-01-28  1:01 ` ✓ CI.KUnit: success " Patchwork
@ 2026-01-28  1:42 ` Patchwork
  13 siblings, 0 replies; 30+ messages in thread
From: Patchwork @ 2026-01-28  1:42 UTC (permalink / raw)
  To: Matthew Brost; +Cc: intel-xe

[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]

== Series Details ==

Series: Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3)
URL   : https://patchwork.freedesktop.org/series/160587/
State : success

== Summary ==

CI Bug Log - changes from xe-4461-16ebc35d8e7bbd5321711b6755590a8dd0aea8ef_BAT -> xe-pw-160587v3_BAT
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (12 -> 12)
------------------------------

  No changes in participating hosts

Known issues
------------

  Here are the changes found in xe-pw-160587v3_BAT that come from known issues:

### IGT changes ###

#### Possible fixes ####

  * igt@xe_waitfence@engine:
    - bat-dg2-oem2:       [FAIL][1] ([Intel XE#6519]) -> [PASS][2]
   [1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4461-16ebc35d8e7bbd5321711b6755590a8dd0aea8ef/bat-dg2-oem2/igt@xe_waitfence@engine.html
   [2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-160587v3/bat-dg2-oem2/igt@xe_waitfence@engine.html

  
  [Intel XE#6519]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6519


Build changes
-------------

  * Linux: xe-4461-16ebc35d8e7bbd5321711b6755590a8dd0aea8ef -> xe-pw-160587v3

  IGT_8721: 3707bb4267de22a18d61b232c4ab5fbaf61db90c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  xe-4461-16ebc35d8e7bbd5321711b6755590a8dd0aea8ef: 16ebc35d8e7bbd5321711b6755590a8dd0aea8ef
  xe-pw-160587v3: 160587v3

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-160587v3/index.html

[-- Attachment #2: Type: text/html, Size: 2101 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data
  2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
@ 2026-01-28 13:53   ` Leon Romanovsky
  0 siblings, 0 replies; 30+ messages in thread
From: Leon Romanovsky @ 2026-01-28 13:53 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, dri-devel, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray, jgg

On Tue, Jan 27, 2026 at 04:48:31PM -0800, Matthew Brost wrote:
> From: Francois Dugast <francois.dugast@intel.com>
> 
> This new helper helps ensure all accesses to zone_device_data use the
> correct API whether the page is part of a folio or not.
> 
> v2:
> - Move to drm_pagemap.h, stick to folio_zone_device_data (Matthew Brost)
> - Return struct drm_pagemap_zdd * (Matthew Brost)

The common practice is to put changelog under --- trailer as it doesn't
belong to commit history. There is no value in this changelog while
running git log ....

Thanks

> 
> Suggested-by: Matthew Brost <matthew.brost@intel.com>
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
> ---
>  drivers/gpu/drm/drm_gpusvm.c  |  7 +++++--
>  drivers/gpu/drm/drm_pagemap.c | 21 ++++++++++++---------
>  include/drm/drm_pagemap.h     | 14 ++++++++++++++
>  3 files changed, 31 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
> index aa9a0b60e727..585d913d3d19 100644
> --- a/drivers/gpu/drm/drm_gpusvm.c
> +++ b/drivers/gpu/drm/drm_gpusvm.c
> @@ -1488,12 +1488,15 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  		order = drm_gpusvm_hmm_pfn_to_order(pfns[i], i, npages);
>  		if (is_device_private_page(page) ||
>  		    is_device_coherent_page(page)) {
> +			struct drm_pagemap_zdd *__zdd =
> +				drm_pagemap_page_zone_device_data(page);
> +
>  			if (!ctx->allow_mixed &&
> -			    zdd != page->zone_device_data && i > 0) {
> +			    zdd != __zdd && i > 0) {
>  				err = -EOPNOTSUPP;
>  				goto err_unmap;
>  			}
> -			zdd = page->zone_device_data;
> +			zdd = __zdd;
>  			if (pagemap != page_pgmap(page)) {
>  				if (i > 0) {
>  					err = -EOPNOTSUPP;
> diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
> index 03ee39a761a4..2c67aabd8d65 100644
> --- a/drivers/gpu/drm/drm_pagemap.c
> +++ b/drivers/gpu/drm/drm_pagemap.c
> @@ -244,7 +244,7 @@ static int drm_pagemap_migrate_map_pages(struct device *dev,
>  		order = folio_order(folio);
>  
>  		if (is_device_private_page(page)) {
> -			struct drm_pagemap_zdd *zdd = page->zone_device_data;
> +			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
>  			struct drm_pagemap *dpagemap = zdd->dpagemap;
>  			struct drm_pagemap_addr addr;
>  
> @@ -315,7 +315,7 @@ static void drm_pagemap_migrate_unmap_pages(struct device *dev,
>  			goto next;
>  
>  		if (is_zone_device_page(page)) {
> -			struct drm_pagemap_zdd *zdd = page->zone_device_data;
> +			struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
>  			struct drm_pagemap *dpagemap = zdd->dpagemap;
>  
>  			dpagemap->ops->device_unmap(dpagemap, dev, pagemap_addr[i]);
> @@ -603,7 +603,8 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
>  
>  		pages[i] = NULL;
>  		if (src_page && is_device_private_page(src_page)) {
> -			struct drm_pagemap_zdd *src_zdd = src_page->zone_device_data;
> +			struct drm_pagemap_zdd *src_zdd =
> +				drm_pagemap_page_zone_device_data(src_page);
>  
>  			if (page_pgmap(src_page) == pagemap &&
>  			    !mdetails->can_migrate_same_pagemap) {
> @@ -725,8 +726,8 @@ static int drm_pagemap_migrate_populate_ram_pfn(struct vm_area_struct *vas,
>  			goto next;
>  
>  		if (fault_page) {
> -			if (src_page->zone_device_data !=
> -			    fault_page->zone_device_data)
> +			if (drm_pagemap_page_zone_device_data(src_page) !=
> +			    drm_pagemap_page_zone_device_data(fault_page))
>  				goto next;
>  		}
>  
> @@ -1067,7 +1068,7 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
>  	void *buf;
>  	int i, err = 0;
>  
> -	zdd = page->zone_device_data;
> +	zdd = drm_pagemap_page_zone_device_data(page);
>  	if (time_before64(get_jiffies_64(), zdd->devmem_allocation->timeslice_expiration))
>  		return 0;
>  
> @@ -1150,7 +1151,9 @@ static int __drm_pagemap_migrate_to_ram(struct vm_area_struct *vas,
>   */
>  static void drm_pagemap_folio_free(struct folio *folio)
>  {
> -	drm_pagemap_zdd_put(folio->page.zone_device_data);
> +	struct page *page = folio_page(folio, 0);
> +
> +	drm_pagemap_zdd_put(drm_pagemap_page_zone_device_data(page));
>  }
>  
>  /**
> @@ -1166,7 +1169,7 @@ static void drm_pagemap_folio_free(struct folio *folio)
>   */
>  static vm_fault_t drm_pagemap_migrate_to_ram(struct vm_fault *vmf)
>  {
> -	struct drm_pagemap_zdd *zdd = vmf->page->zone_device_data;
> +	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(vmf->page);
>  	int err;
>  
>  	err = __drm_pagemap_migrate_to_ram(vmf->vma,
> @@ -1232,7 +1235,7 @@ EXPORT_SYMBOL_GPL(drm_pagemap_devmem_init);
>   */
>  struct drm_pagemap *drm_pagemap_page_to_dpagemap(struct page *page)
>  {
> -	struct drm_pagemap_zdd *zdd = page->zone_device_data;
> +	struct drm_pagemap_zdd *zdd = drm_pagemap_page_zone_device_data(page);
>  
>  	return zdd->devmem_allocation->dpagemap;
>  }
> diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
> index 2baf0861f78f..14e1db564c25 100644
> --- a/include/drm/drm_pagemap.h
> +++ b/include/drm/drm_pagemap.h
> @@ -4,6 +4,7 @@
>  
>  #include <linux/dma-direction.h>
>  #include <linux/hmm.h>
> +#include <linux/memremap.h>
>  #include <linux/types.h>
>  
>  #define NR_PAGES(order) (1U << (order))
> @@ -341,6 +342,19 @@ struct drm_pagemap_migrate_details {
>  	u32 source_peer_migrates : 1;
>  };
>  
> +/**
> + * drm_pagemap_page_zone_device_data() - Page to zone_device_data
> + * @page: Pointer to the page
> + *
> + * Return: Page's zone_device_data
> + */
> +static inline struct drm_pagemap_zdd *drm_pagemap_page_zone_device_data(struct page *page)
> +{
> +	struct folio *folio = page_folio(page);
> +
> +	return folio_zone_device_data(folio);
> +}
> +
>  #if IS_ENABLED(CONFIG_ZONE_DEVICE)
>  
>  int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
  2026-01-28  0:48 ` [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
@ 2026-01-28 14:04   ` Leon Romanovsky
  0 siblings, 0 replies; 30+ messages in thread
From: Leon Romanovsky @ 2026-01-28 14:04 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, dri-devel, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray, jgg

On Tue, Jan 27, 2026 at 04:48:32PM -0800, Matthew Brost wrote:
> The dma-map IOVA alloc, link, and sync APIs perform significantly better
> than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
> This difference is especially noticeable when mapping a 2MB region in
> 4KB pages.
> 
> Use the IOVA alloc, link, and sync APIs for GPU SVM, which create DMA
> mappings between the CPU and GPU.
> 
> v3:
>  - Always link IOVA in mixed mappings
>  - Sync IOVA

The same comment as before.

> 
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>  drivers/gpu/drm/drm_gpusvm.c | 87 ++++++++++++++++++++++++++++--------
>  include/drm/drm_gpusvm.h     |  3 ++
>  2 files changed, 71 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
> index 585d913d3d19..084e78fa0f32 100644
> --- a/drivers/gpu/drm/drm_gpusvm.c
> +++ b/drivers/gpu/drm/drm_gpusvm.c
> @@ -1139,19 +1139,26 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
>  		struct drm_gpusvm_pages_flags flags = {
>  			.__flags = svm_pages->flags.__flags,
>  		};
> +		struct dma_iova_state __state = {};

Why don't you use svm_pages->state directly?

>  
> -		for (i = 0, j = 0; i < npages; j++) {
> -			struct drm_pagemap_addr *addr = &svm_pages->dma_addr[j];
> -
> -			if (addr->proto == DRM_INTERCONNECT_SYSTEM)
> -				dma_unmap_page(dev,
> -					       addr->addr,
> -					       PAGE_SIZE << addr->order,
> -					       addr->dir);
> -			else if (dpagemap && dpagemap->ops->device_unmap)
> -				dpagemap->ops->device_unmap(dpagemap,
> -							    dev, *addr);
> -			i += 1 << addr->order;
> +		if (dma_use_iova(&svm_pages->state)) {
> +			dma_iova_destroy(dev, &svm_pages->state,
> +					 npages * PAGE_SIZE,
> +					 svm_pages->dma_addr[0].dir, 0);
> +		} else {
> +			for (i = 0, j = 0; i < npages; j++) {
> +				struct drm_pagemap_addr *addr = &svm_pages->dma_addr[j];
> +
> +				if (addr->proto == DRM_INTERCONNECT_SYSTEM)
> +					dma_unmap_page(dev,
> +						       addr->addr,
> +						       PAGE_SIZE << addr->order,
> +						       addr->dir);
> +				else if (dpagemap && dpagemap->ops->device_unmap)
> +					dpagemap->ops->device_unmap(dpagemap,
> +								    dev, *addr);
> +				i += 1 << addr->order;
> +			}
>  		}
>  
>  		/* WRITE_ONCE pairs with READ_ONCE for opportunistic checks */
> @@ -1161,6 +1168,7 @@ static void __drm_gpusvm_unmap_pages(struct drm_gpusvm *gpusvm,
>  
>  		drm_pagemap_put(svm_pages->dpagemap);
>  		svm_pages->dpagemap = NULL;
> +		svm_pages->state = __state;
>  	}
>  }
>  
> @@ -1402,12 +1410,14 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  	unsigned long num_dma_mapped;
>  	unsigned int order = 0;
>  	unsigned long *pfns;
> +	phys_addr_t last_phys;
>  	int err = 0;
>  	struct dev_pagemap *pagemap;
>  	struct drm_pagemap *dpagemap;
>  	struct drm_gpusvm_pages_flags flags;
>  	enum dma_data_direction dma_dir = ctx->read_only ? DMA_TO_DEVICE :
>  							   DMA_BIDIRECTIONAL;
> +	struct dma_iova_state *state = &svm_pages->state;
>  
>  retry:
>  	if (time_after(jiffies, timeout))
> @@ -1496,6 +1506,17 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  				err = -EOPNOTSUPP;
>  				goto err_unmap;
>  			}
> +
> +			if (dma_use_iova(state)) {
> +				err = dma_iova_link(gpusvm->drm->dev, state,
> +						    last_phys,
> +						    i * PAGE_SIZE,
> +						    PAGE_SIZE << order,
> +						    dma_dir, 0);
> +				if (err)
> +					goto err_unmap;
> +			}
> +
>  			zdd = __zdd;
>  			if (pagemap != page_pgmap(page)) {
>  				if (i > 0) {
> @@ -1539,13 +1560,34 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  				goto err_unmap;
>  			}
>  
> -			addr = dma_map_page(gpusvm->drm->dev,
> -					    page, 0,
> -					    PAGE_SIZE << order,
> -					    dma_dir);
> -			if (dma_mapping_error(gpusvm->drm->dev, addr)) {
> -				err = -EFAULT;
> -				goto err_unmap;
> +			if (!i)
> +				dma_iova_try_alloc(gpusvm->drm->dev, state,
> +						   npages * PAGE_SIZE >=
> +						   HPAGE_PMD_SIZE ?
> +						   HPAGE_PMD_SIZE : 0,
> +						   npages * PAGE_SIZE);
> +
> +			if (dma_use_iova(state)) {
> +				last_phys = page_to_phys(page);

hmm_pfn_to_phys().

> +
> +				err = dma_iova_link(gpusvm->drm->dev, state,
> +						    page_to_phys(page),

you have last_phys here.

> +						    i * PAGE_SIZE,
> +						    PAGE_SIZE << order,
> +						    dma_dir, 0);
> +				if (err)
> +					goto err_unmap;
> +

Thanks

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28  0:48 ` [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
@ 2026-01-28 14:28   ` Leon Romanovsky
  2026-01-28 17:46     ` Matthew Brost
  0 siblings, 1 reply; 30+ messages in thread
From: Leon Romanovsky @ 2026-01-28 14:28 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, dri-devel, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray, jgg

On Tue, Jan 27, 2026 at 04:48:34PM -0800, Matthew Brost wrote:
> The dma-map IOVA alloc, link, and sync APIs perform significantly better
> than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
> This difference is especially noticeable when mapping a 2MB region in
> 4KB pages.
> 
> Use the IOVA alloc, link, and sync APIs for DRM pagemap, which create DMA
> mappings between the CPU and GPU for copying data.
> 
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>  drivers/gpu/drm/drm_pagemap.c | 121 +++++++++++++++++++++++++++-------
>  1 file changed, 96 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
> index 4b79d4019453..b928c89f4bd1 100644
> --- a/drivers/gpu/drm/drm_pagemap.c
> +++ b/drivers/gpu/drm/drm_pagemap.c
> @@ -287,6 +287,7 @@ drm_pagemap_migrate_map_device_pages(struct device *dev,
>   * @migrate_pfn: Array of page frame numbers of system pages or peer pages to map.
>   * @npages: Number of system pages or peer pages to map.
>   * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
> + * @state: DMA IOVA state for mapping.
>   *
>   * This function maps pages of memory for migration usage in GPU SVM. It
>   * iterates over each page frame number provided in @migrate_pfn, maps the
> @@ -300,26 +301,79 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
>  				     struct drm_pagemap_addr *pagemap_addr,
>  				     unsigned long *migrate_pfn,
>  				     unsigned long npages,
> -				     enum dma_data_direction dir)
> +				     enum dma_data_direction dir,
> +				     struct dma_iova_state *state)
>  {
> -	unsigned long i;
> +	struct page *dummy_page = NULL;
> +	unsigned long i, psize;
> +	bool try_alloc = false;
>  
>  	for (i = 0; i < npages;) {
>  		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
> -		dma_addr_t dma_addr;
> -		struct folio *folio;
> +		dma_addr_t dma_addr = -1;
>  		unsigned int order = 0;
>  
> -		if (!page)
> -			goto next;
> +		if (!page) {
> +			if (!dummy_page)
> +				goto next;
>  
> -		WARN_ON_ONCE(is_device_private_page(page));
> -		folio = page_folio(page);
> -		order = folio_order(folio);
> +			page = dummy_page;

Why is this dummy_page required? Is it intended to introduce holes in the
IOVA space? If so, what necessitates those holes? You can have less mapped
than IOVA and dma_iova_*() API can handle it.

Thanks

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28 14:28   ` Leon Romanovsky
@ 2026-01-28 17:46     ` Matthew Brost
       [not found]       ` <20260128175531.GR1641016@ziepe.ca>
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 17:46 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: intel-xe, dri-devel, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray, jgg

On Wed, Jan 28, 2026 at 04:28:53PM +0200, Leon Romanovsky wrote:
> On Tue, Jan 27, 2026 at 04:48:34PM -0800, Matthew Brost wrote:
> > The dma-map IOVA alloc, link, and sync APIs perform significantly better
> > than dma-map / dma-unmap, as they avoid costly IOMMU synchronizations.
> > This difference is especially noticeable when mapping a 2MB region in
> > 4KB pages.
> > 
> > Use the IOVA alloc, link, and sync APIs for DRM pagemap, which create DMA
> > mappings between the CPU and GPU for copying data.
> > 
> > Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> >  drivers/gpu/drm/drm_pagemap.c | 121 +++++++++++++++++++++++++++-------
> >  1 file changed, 96 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
> > index 4b79d4019453..b928c89f4bd1 100644
> > --- a/drivers/gpu/drm/drm_pagemap.c
> > +++ b/drivers/gpu/drm/drm_pagemap.c
> > @@ -287,6 +287,7 @@ drm_pagemap_migrate_map_device_pages(struct device *dev,
> >   * @migrate_pfn: Array of page frame numbers of system pages or peer pages to map.
> >   * @npages: Number of system pages or peer pages to map.
> >   * @dir: Direction of data transfer (e.g., DMA_BIDIRECTIONAL)
> > + * @state: DMA IOVA state for mapping.
> >   *
> >   * This function maps pages of memory for migration usage in GPU SVM. It
> >   * iterates over each page frame number provided in @migrate_pfn, maps the
> > @@ -300,26 +301,79 @@ drm_pagemap_migrate_map_system_pages(struct device *dev,
> >  				     struct drm_pagemap_addr *pagemap_addr,
> >  				     unsigned long *migrate_pfn,
> >  				     unsigned long npages,
> > -				     enum dma_data_direction dir)
> > +				     enum dma_data_direction dir,
> > +				     struct dma_iova_state *state)
> >  {
> > -	unsigned long i;
> > +	struct page *dummy_page = NULL;
> > +	unsigned long i, psize;
> > +	bool try_alloc = false;
> >  
> >  	for (i = 0; i < npages;) {
> >  		struct page *page = migrate_pfn_to_page(migrate_pfn[i]);
> > -		dma_addr_t dma_addr;
> > -		struct folio *folio;
> > +		dma_addr_t dma_addr = -1;
> >  		unsigned int order = 0;
> >  
> > -		if (!page)
> > -			goto next;
> > +		if (!page) {
> > +			if (!dummy_page)
> > +				goto next;
> >  
> > -		WARN_ON_ONCE(is_device_private_page(page));
> > -		folio = page_folio(page);
> > -		order = folio_order(folio);
> > +			page = dummy_page;
> 
> Why is this dummy_page required? Is it intended to introduce holes in the

It is intended to fill holes. The input pages come from the
migrate_vma_* functions, which can return a sparsely populated array of
pages for a region (e.g., it scans a 2M range but only finds several of
the 512 pages eligible for migration). As a result, if (!page) is true
for many entries.

> IOVA space? If so, what necessitates those holes? You can have less mapped
> than IOVA and dma_iova_*() API can handle it.

I was actually going to ask you about this, so I’m glad you brought it
up here. Again, this is a hack to avoid holes — the holes are never
touched by our copy function, but rather skipped, so we just jam in a
dummy address so the entire IOVA range has valid IOMMU pages.

It is meant to avoid the warning in [1] — without this, unmapped != size
as only some of the IOMMU pages are populated for size being destroyed.
I added this early on when everything was breaking and then moved on, so
at the moment I’m not sure whether this warning affects actual
functionality or if we could just delete it. Let me get back to you on
whether it just causes dmesg spam or if it has functional implications.
If it’s the former, I’d much prefer to remove the warning rather than
carry this hack.

Perhaps you can also explain why this warning exists?

Matt

[1] https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/iommu/dma-iommu.c#L2045

> 
> Thanks

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
       [not found]   ` <20260128151458.GJ1641016@ziepe.ca>
@ 2026-01-28 18:42     ` Matthew Brost
  2026-01-28 19:41       ` Matthew Brost
       [not found]       ` <20260128193509.GU1641016@ziepe.ca>
  0 siblings, 2 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 18:42 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 11:14:58AM -0400, Jason Gunthorpe wrote:
> On Tue, Jan 27, 2026 at 04:48:36PM -0800, Matthew Brost wrote:
> > Add an IOVA interface to the DRM pagemap layer. This provides a semantic
> > wrapper around the dma-map IOVA alloc/link/sync/unlink/free API while
> > remaining flexible enough to support future high-speed interconnects
> > between devices.
> 
> I don't think this is a very clear justification.
> 
> "IOVA" and dma_addr_t should be strictly reserved for communication
> that flows through the interconnect that Linux struct device is aware
> of (ie the PCIe fabric). It should not ever be used for "high speed
> interconnects" implying some private and hidden things like
> xgmi/nvlink/ualink type stuff.
> 

Yes, the future is looking forward to xgmi/nvlink/ualink type stuff. I
agree we (DRM pagemap, GPU SVM, Xe) need a refactor to avoid using
dma_addr_t for any interfaces here once we unify this xgmi/nvlink/ualink
as dma_addr_t doesn't make tons of sense. This is a PoC the code structure.
s/IOVA/something else/ for interfaces may make sense too.

> I can't think of any reason why you'd want to delegate constructing
> the IOVA to some other code. I can imagine you'd want to get a pfn
> list from someplace else and turn that into a mapping.
>

Yes, this is exactly what I envision here. First, let me explain the
possible addressing modes on the UAL fabric:

 - Physical (akin to IOMMU passthrough)
 - Virtual (akin to IOMMU enabled)

Physical mode is straightforward — resolve the PFN to a cross-device
physical address, then install it into the initiator’s page tables along
with a bit indicating routing over the network. In this mode, the vfuncs
here are basically NOPs.

Virtual mode is the tricky one. There are addressing modes where a
virtual address must be allocated at the target device (i.e., the
address on the wire is translated at the target via a page-table walk).
This is why the code is structured the way it is, and why I envision a
UAL API that mirrors dma-map. At the initiator the initiator target
virtual addresss is installed the page tables along with a bit
indicating routing over the network.

Let me give some examples of what this would look like in a few of the
vfuncs — see [1] for the dma-map implementation. Also ignore dma_addr_t
abuse for now.

[1] https://patchwork.freedesktop.org/patch/701149/?series=160587&rev=3

struct xe_svm_iova_cookie {
	struct dma_iova_state state;
	struct ual_iova_state ual_state;
};

static void *xe_drm_pagemap_device_iova_alloc(struct drm_pagemap *dpagemap,
 					      struct device *dev, size_t length,
 					      enum dma_data_direction dir)
{
	struct device *pgmap_dev = dpagemap->drm->dev;
	struct xe_svm_iova_cookie *cookie;
	static bool locking_proved = false;

	xe_drm_pagemap_device_iova_prove_locking(&locking_proved);

	if (pgmap_dev == dev)
		return NULL;

	cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
	if (!cookie)
		return NULL;

	if (ual_distance(pgmap_dev, dev) < 0) {
		dma_iova_try_alloc(dev, &cookie->state, length >= SZ_2M ? SZ_2M : 0,
				   length);
		if (dma_use_iova(&cookie->state))
			return cookie;
	} else {
		err = ual_iova_try_alloc(pgmap_dev, &cookie->ual_state,
					 length >= SZ_2M ? SZ_2M : 0,
					 length);
		if (err)
			return ERR_PTR(err);

		if (ual_use_iova(&cookie->state))
			return cookie;
	}

	kfree(cookie);
 	return NULL;
}

So, here in physical mode - 'ual_use_iova' would return false, true in virtual.

This function is also interesting because ual_iova_try_alloc in virtual
mode can allocate memory for PTEs on the target device. This is why the
kernel doc explanation for Context, along with
xe_drm_pagemap_device_iova_prove_locking, is important to ensure that
all the locking is correct.

Now this function:

static struct drm_pagemap_addr
xe_drm_pagemap_device_iova_link(struct drm_pagemap *dpagemap,
				struct device *dev, struct page *page,
				size_t length, size_t offset, void *cookie,
				enum dma_data_direction dir)
{
	struct device *pgmap_dev = dpagemap->drm->dev;
	struct xe_svm_iova_cookie *__cookie = cookie;
	struct xe_device *xe = to_xe_device(dpagemap->drm);
	enum drm_interconnect_protocol prot;
	dma_addr_t addr;
	int err;

	if (dma_use_iova(&__cookie->state) {
		addr = __cookie->state.addr + offset;
		proto = XE_INTERCONNECT_P2P;
		err = dma_iova_link(dev, &__cookie->state, xe_page_to_pcie(page),
				    offset, length, dir, DMA_ATTR_SKIP_CPU_SYNC |
				    DMA_ATTR_MMIO);
	} else {
		addr = __cookie->ual_state.addr + offset;
		proto = XE_INTERCONNECT_VRAM;	/* Also means over fabric */
		err = ual_iova_link(dev, &__cookie->ual_state, xe_page_to_pcie(page),
				    offset, length, dir);
	}
	if (err)
		addr = DMA_MAPPING_ERROR;

	return drm_pagemap_addr_encode(addr, proto, ilog2(length), dir);
}

Note that the above function can only be called in virtual mode (i.e.,
the first function returns an IOVA cookie). Here we’d jam the target’s
PTEs with physical page addresses (reclaim-safe) and return the network
virtual address.

Lastly a physical UAL example (i.e., first function returns NULL).

static struct drm_pagemap_addr
xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
                          struct device *dev,
                          struct page *page,
                          unsigned int order,
                          enum dma_data_direction dir)
{
        struct device *pgmap_dev = dpagemap->drm->dev;
        enum drm_interconnect_protocol prot;
        dma_addr_t addr;

        if (pgmap_dev == dev || ual_distance(pgmap_dev, dev) >= 0) {
                addr = xe_page_to_dpa(page);
                prot = XE_INTERCONNECT_VRAM;
        } else {
                addr = dma_map_resource(dev,
                                        xe_page_to_pcie(page),
                                        PAGE_SIZE << order, dir,
                                        DMA_ATTR_SKIP_CPU_SYNC);
                prot = XE_INTERCONNECT_P2P;
        }

        return drm_pagemap_addr_encode(addr, prot, order, dir);
}

So, if it isn’t clear — these vfuncs hide whether PCIe P2P is being used
(IOMMU in passthrough or enabled) or UAL is being used (physical or
virtual) for DRM common layer. They manage the resources for the
connection and provide the information needed to program the initiator
PTEs (address + “use interconnect” vs. “use PCIe P2P bit”).

This reasoning is why it would be nice if drivers were allowed to
dma-map IOVA alloc/link/sync/unlink/free API for PCIe P2P directly.

> My understanding of all the private interconnects is you get an
> interconnect address and program it directly into the device HW,
> possibly with a "use interconnect" bit, and the device never touches
> the PCIe fabric at all.
> 

Yes, but see physical vs virtual explaination. The "use interconnect" is
just one part of this.

Matt

> Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
       [not found]       ` <20260128175531.GR1641016@ziepe.ca>
@ 2026-01-28 19:29         ` Matthew Brost
  2026-01-28 19:45           ` Leon Romanovsky
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 19:29 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Leon Romanovsky, intel-xe, dri-devel, francois.dugast,
	thomas.hellstrom, himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 01:55:31PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 28, 2026 at 09:46:44AM -0800, Matthew Brost wrote:
> 
> > It is intended to fill holes. The input pages come from the
> > migrate_vma_* functions, which can return a sparsely populated array of
> > pages for a region (e.g., it scans a 2M range but only finds several of
> > the 512 pages eligible for migration). As a result, if (!page) is true
> > for many entries.
> 
> This is migration?? So something is DMA'ing from A -> B - why put
> holes in the first place? Can you tightly pack the pages in the IOVA?
> 

This could probably could be made to work. I think it would be an
initial pass to figure out the IOVA size then tightly pack.

Let me look at this. Probably better too as installing dummy pages is a
non-zero cost as I assume dma_iova_link is a radix tree walk.

> If there is no iommu then the addresses are scattered all over anyhow
> so it can't be relying on some dma_addr_t relationship?

Scattered dma-addresses is already handled in the copy code, likewise
holes so non-issue.

> 
> You don't have to fully populate the allocated iova, you can link from
> A-B and then unlink from A-B even if B is less than the total size
> requested.
> 
> The hmm users have the holes because hmm is dynamically
> adding/removing pages as it runs and it can't do anything to pack the
> mapping.
> 
> > > IOVA space? If so, what necessitates those holes? You can have less mapped
> > > than IOVA and dma_iova_*() API can handle it.
> > 
> > I was actually going to ask you about this, so I’m glad you brought it
> > up here. Again, this is a hack to avoid holes — the holes are never
> > touched by our copy function, but rather skipped, so we just jam in a
> > dummy address so the entire IOVA range has valid IOMMU pages.
> 
> I would say what you are doing is trying to optimize unmap by

Yes and make the code simplish.

> unmapping everything in one shot instead of just the mapped areas, and
> the WARN_ON is telling you that it isn't allowed to unmap across a
> hole.
> 
> > at the moment I’m not sure whether this warning affects actual
> > functionality or if we could just delete it. 
> 
> It means the iommu page table stopped unmapping when it hit a hole and
> there is a bunch of left over maps in the page table that shouldn't be
> there. So yes, it is serious and cannot be deleted.
>

Cool, this explains the warning.
 
> This is a possible option to teach things to detect the holes and
> ignore them..

Another option — and IMO probably the best one — as it makes potential
usages with holes the simplest at the driver level. Let me look at this
too.

Do you think we need flag somewhere for 'ignore holes' or can I just
blindly skip them?

Matt

> 
> Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
  2026-01-28 18:42     ` Matthew Brost
@ 2026-01-28 19:41       ` Matthew Brost
       [not found]       ` <20260128193509.GU1641016@ziepe.ca>
  1 sibling, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 19:41 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 10:42:53AM -0800, Matthew Brost wrote:

Let me fix a couple typos...

> On Wed, Jan 28, 2026 at 11:14:58AM -0400, Jason Gunthorpe wrote:
> > On Tue, Jan 27, 2026 at 04:48:36PM -0800, Matthew Brost wrote:
> > > Add an IOVA interface to the DRM pagemap layer. This provides a semantic
> > > wrapper around the dma-map IOVA alloc/link/sync/unlink/free API while
> > > remaining flexible enough to support future high-speed interconnects
> > > between devices.
> > 
> > I don't think this is a very clear justification.
> > 
> > "IOVA" and dma_addr_t should be strictly reserved for communication
> > that flows through the interconnect that Linux struct device is aware
> > of (ie the PCIe fabric). It should not ever be used for "high speed
> > interconnects" implying some private and hidden things like
> > xgmi/nvlink/ualink type stuff.
> > 
> 
> Yes, the future is looking forward to xgmi/nvlink/ualink type stuff. I
> agree we (DRM pagemap, GPU SVM, Xe) need a refactor to avoid using
> dma_addr_t for any interfaces here once we unify this xgmi/nvlink/ualink
> as dma_addr_t doesn't make tons of sense. This is a PoC the code structure.
> s/IOVA/something else/ for interfaces may make sense too.
> 
> > I can't think of any reason why you'd want to delegate constructing
> > the IOVA to some other code. I can imagine you'd want to get a pfn
> > list from someplace else and turn that into a mapping.
> >
> 
> Yes, this is exactly what I envision here. First, let me explain the
> possible addressing modes on the UAL fabric:
> 
>  - Physical (akin to IOMMU passthrough)
>  - Virtual (akin to IOMMU enabled)
> 
> Physical mode is straightforward — resolve the PFN to a cross-device
> physical address, then install it into the initiator’s page tables along
> with a bit indicating routing over the network. In this mode, the vfuncs
> here are basically NOPs.
> 
> Virtual mode is the tricky one. There are addressing modes where a
> virtual address must be allocated at the target device (i.e., the
> address on the wire is translated at the target via a page-table walk).
> This is why the code is structured the way it is, and why I envision a
> UAL API that mirrors dma-map. At the initiator the initiator target

s/initiator target/target

> virtual addresss is installed the page tables along with a bit
> indicating routing over the network.
> 
> Let me give some examples of what this would look like in a few of the
> vfuncs — see [1] for the dma-map implementation. Also ignore dma_addr_t
> abuse for now.
> 
> [1] https://patchwork.freedesktop.org/patch/701149/?series=160587&rev=3
> 
> struct xe_svm_iova_cookie {
> 	struct dma_iova_state state;
> 	struct ual_iova_state ual_state;
> };
> 
> static void *xe_drm_pagemap_device_iova_alloc(struct drm_pagemap *dpagemap,
>  					      struct device *dev, size_t length,
>  					      enum dma_data_direction dir)
> {
> 	struct device *pgmap_dev = dpagemap->drm->dev;
> 	struct xe_svm_iova_cookie *cookie;
> 	static bool locking_proved = false;
> 
> 	xe_drm_pagemap_device_iova_prove_locking(&locking_proved);
> 
> 	if (pgmap_dev == dev)
> 		return NULL;
> 
> 	cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
> 	if (!cookie)
> 		return NULL;
> 
> 	if (ual_distance(pgmap_dev, dev) < 0) {
> 		dma_iova_try_alloc(dev, &cookie->state, length >= SZ_2M ? SZ_2M : 0,
> 				   length);
> 		if (dma_use_iova(&cookie->state))
> 			return cookie;
> 	} else {
> 		err = ual_iova_try_alloc(pgmap_dev, &cookie->ual_state,
> 					 length >= SZ_2M ? SZ_2M : 0,
> 					 length);
> 		if (err)
> 			return ERR_PTR(err);
> 
> 		if (ual_use_iova(&cookie->state))

s/ual_use_iova(&cookie->state)/ual_use_iova(&cookie->ual_state)

> 			return cookie;
> 	}
> 
> 	kfree(cookie);
>  	return NULL;
> }
> 
> So, here in physical mode - 'ual_use_iova' would return false, true in virtual.
> 
> This function is also interesting because ual_iova_try_alloc in virtual
> mode can allocate memory for PTEs on the target device. This is why the
> kernel doc explanation for Context, along with
> xe_drm_pagemap_device_iova_prove_locking, is important to ensure that
> all the locking is correct.
> 
> Now this function:
> 
> static struct drm_pagemap_addr
> xe_drm_pagemap_device_iova_link(struct drm_pagemap *dpagemap,
> 				struct device *dev, struct page *page,
> 				size_t length, size_t offset, void *cookie,
> 				enum dma_data_direction dir)
> {
> 	struct device *pgmap_dev = dpagemap->drm->dev;
> 	struct xe_svm_iova_cookie *__cookie = cookie;
> 	struct xe_device *xe = to_xe_device(dpagemap->drm);
> 	enum drm_interconnect_protocol prot;
> 	dma_addr_t addr;
> 	int err;
> 
> 	if (dma_use_iova(&__cookie->state) {
> 		addr = __cookie->state.addr + offset;
> 		proto = XE_INTERCONNECT_P2P;
> 		err = dma_iova_link(dev, &__cookie->state, xe_page_to_pcie(page),
> 				    offset, length, dir, DMA_ATTR_SKIP_CPU_SYNC |
> 				    DMA_ATTR_MMIO);
> 	} else {
> 		addr = __cookie->ual_state.addr + offset;
> 		proto = XE_INTERCONNECT_VRAM;	/* Also means over fabric */
> 		err = ual_iova_link(dev, &__cookie->ual_state, xe_page_to_pcie(page),

s/xe_page_to_pcie/xe_page_to_dpa

Matt

> 				    offset, length, dir);
> 	}
> 	if (err)
> 		addr = DMA_MAPPING_ERROR;
> 
> 	return drm_pagemap_addr_encode(addr, proto, ilog2(length), dir);
> }
> 
> Note that the above function can only be called in virtual mode (i.e.,
> the first function returns an IOVA cookie). Here we’d jam the target’s
> PTEs with physical page addresses (reclaim-safe) and return the network
> virtual address.
> 
> Lastly a physical UAL example (i.e., first function returns NULL).
> 
> static struct drm_pagemap_addr
> xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
>                           struct device *dev,
>                           struct page *page,
>                           unsigned int order,
>                           enum dma_data_direction dir)
> {
>         struct device *pgmap_dev = dpagemap->drm->dev;
>         enum drm_interconnect_protocol prot;
>         dma_addr_t addr;
> 
>         if (pgmap_dev == dev || ual_distance(pgmap_dev, dev) >= 0) {
>                 addr = xe_page_to_dpa(page);
>                 prot = XE_INTERCONNECT_VRAM;
>         } else {
>                 addr = dma_map_resource(dev,
>                                         xe_page_to_pcie(page),
>                                         PAGE_SIZE << order, dir,
>                                         DMA_ATTR_SKIP_CPU_SYNC);
>                 prot = XE_INTERCONNECT_P2P;
>         }
> 
>         return drm_pagemap_addr_encode(addr, prot, order, dir);
> }
> 
> So, if it isn’t clear — these vfuncs hide whether PCIe P2P is being used
> (IOMMU in passthrough or enabled) or UAL is being used (physical or
> virtual) for DRM common layer. They manage the resources for the
> connection and provide the information needed to program the initiator
> PTEs (address + “use interconnect” vs. “use PCIe P2P bit”).
> 
> This reasoning is why it would be nice if drivers were allowed to
> dma-map IOVA alloc/link/sync/unlink/free API for PCIe P2P directly.
> 
> > My understanding of all the private interconnects is you get an
> > interconnect address and program it directly into the device HW,
> > possibly with a "use interconnect" bit, and the device never touches
> > the PCIe fabric at all.
> > 
> 
> Yes, but see physical vs virtual explaination. The "use interconnect" is
> just one part of this.
> 
> Matt
> 
> > Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28 19:29         ` Matthew Brost
@ 2026-01-28 19:45           ` Leon Romanovsky
  2026-01-28 21:04             ` Matthew Brost
  0 siblings, 1 reply; 30+ messages in thread
From: Leon Romanovsky @ 2026-01-28 19:45 UTC (permalink / raw)
  To: Matthew Brost
  Cc: Jason Gunthorpe, intel-xe, dri-devel, francois.dugast,
	thomas.hellstrom, himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 11:29:23AM -0800, Matthew Brost wrote:
> On Wed, Jan 28, 2026 at 01:55:31PM -0400, Jason Gunthorpe wrote:
> > On Wed, Jan 28, 2026 at 09:46:44AM -0800, Matthew Brost wrote:
> > 
> > > It is intended to fill holes. The input pages come from the
> > > migrate_vma_* functions, which can return a sparsely populated array of
> > > pages for a region (e.g., it scans a 2M range but only finds several of
> > > the 512 pages eligible for migration). As a result, if (!page) is true
> > > for many entries.
> > 
> > This is migration?? So something is DMA'ing from A -> B - why put
> > holes in the first place? Can you tightly pack the pages in the IOVA?
> > 
> 
> This could probably could be made to work. I think it would be an
> initial pass to figure out the IOVA size then tightly pack.
> 
> Let me look at this. Probably better too as installing dummy pages is a
> non-zero cost as I assume dma_iova_link is a radix tree walk.
> 
> > If there is no iommu then the addresses are scattered all over anyhow
> > so it can't be relying on some dma_addr_t relationship?
> 
> Scattered dma-addresses is already handled in the copy code, likewise
> holes so non-issue.
> 
> > 
> > You don't have to fully populate the allocated iova, you can link from
> > A-B and then unlink from A-B even if B is less than the total size
> > requested.
> > 
> > The hmm users have the holes because hmm is dynamically
> > adding/removing pages as it runs and it can't do anything to pack the
> > mapping.
> > 
> > > > IOVA space? If so, what necessitates those holes? You can have less mapped
> > > > than IOVA and dma_iova_*() API can handle it.
> > > 
> > > I was actually going to ask you about this, so I’m glad you brought it
> > > up here. Again, this is a hack to avoid holes — the holes are never
> > > touched by our copy function, but rather skipped, so we just jam in a
> > > dummy address so the entire IOVA range has valid IOMMU pages.
> > 
> > I would say what you are doing is trying to optimize unmap by
> 
> Yes and make the code simplish.
> 
> > unmapping everything in one shot instead of just the mapped areas, and
> > the WARN_ON is telling you that it isn't allowed to unmap across a
> > hole.
> > 
> > > at the moment I’m not sure whether this warning affects actual
> > > functionality or if we could just delete it. 
> > 
> > It means the iommu page table stopped unmapping when it hit a hole and
> > there is a bunch of left over maps in the page table that shouldn't be
> > there. So yes, it is serious and cannot be deleted.
> >
> 
> Cool, this explains the warning.
>  
> > This is a possible option to teach things to detect the holes and
> > ignore them..
> 
> Another option — and IMO probably the best one — as it makes potential
> usages with holes the simplest at the driver level. Let me look at this
> too.

It would be ideal if we could code a more general solution. In HMM we
release pages one by one, and it would be preferable to have a single-shot
unmap routine instead. In similar to NVMe which release all IOVA space
with one call to dma_iova_destroy().

HMM chain:

ib_umem_odp_unmap_dma_pages()
 -> for (...)
   -> hmm_dma_unmap_pfn()

After giving more thought to my earlier suggestion to use
hmm_pfn_to_phys(), I began to wonder why did not you use the
hmm_dma_*() API instead?

> 
> Do you think we need flag somewhere for 'ignore holes' or can I just
> blindly skip them?

Better if we will have something like dma_iova_with_holes_destroy()
function call to make sure that we don't hurt performance of existing
dma_iova_destroy() users.

Thanks

> 
> Matt
> 
> > 
> > Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
       [not found]       ` <20260128193509.GU1641016@ziepe.ca>
@ 2026-01-28 20:24         ` Matthew Brost
  2026-01-29 18:57           ` Jason Gunthorpe
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 20:24 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 03:35:09PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 28, 2026 at 10:42:53AM -0800, Matthew Brost wrote:
> > Yes, this is exactly what I envision here. First, let me explain the
> > possible addressing modes on the UAL fabric:
> > 
> >  - Physical (akin to IOMMU passthrough)
> >  - Virtual (akin to IOMMU enabled)
> > 
> > Physical mode is straightforward — resolve the PFN to a cross-device
> > physical address, then install it into the initiator’s page tables along
> > with a bit indicating routing over the network. In this mode, the vfuncs
> > here are basically NOPs.
> 
> Ugh of course they would invent something so complicated.
> 

Why wouldn't we... But conceptually really fairly close to IOMMU
paththrough vs. enabled.

> I'm not convinced this should be hidden inside DRM. The DMA API is the


Well, what I’m suggesting isn’t in DRM. A UAL API would be its own
layer, much like the DMA API. Of course we could stick this in the DMA
API and make it high-speed-fabric-generic, etc., but I do think the
fabric functions would have their own signatures and semantics (see my
explanation around device_ual_alloc reclaim rules, what locks it is
allowed to take, etc.).

> place to make things mappable and for an open standard like UALink it
> would make sense that the DMA API is the broker to connect things as
> it will be more than just one GPU driver talking to itself.
> 

I agree that a UAL API would just be a broker, similar to the DMA API.
It should support multiple devices and drivers communicating with each
other. If the UAL API only works with, let’s say, two Xe devices, then
we’d be broken.

> There is a journey to get there, but I don't think it is too
> complicated. It also probably ties in fairly nicely with the ideas

I agree it will be a journey and really shouldn't be too complicated.
Open to other ideas here.

> coming for multi path PCIe fabrics.
> 
> > So, if it isn’t clear — these vfuncs hide whether PCIe P2P is being used
> > (IOMMU in passthrough or enabled) or UAL is being used (physical or
> > virtual) for DRM common layer. They manage the resources for the
> > connection and provide the information needed to program the initiator
> > PTEs (address + “use interconnect” vs. “use PCIe P2P bit”).
> 
> This looks like it is taking the DMA API and sticking drm_ in front of
> it :( I don't think this is a good direction for the kernel, DRM
> should not be internally building such key infrastructure.
>

Again, it’s not my intent to stick DRM into this. The DRM parts are
specific to how we do SVM (locking, migrations, page collections for
bindings, etc.) so each driver doesn’t reinvent this piece (see AMD’s
and Nouveau’s implementations), but the UAL mapping logic should be
generic, also being able to used in dma-buf, etc. Also, all of the DRM
SVM parts can be pulled into the device layer if needed as there really
isn't anything DRM specific in it and parts the existing DRM SVM code
could be pushed down into HMM type helpers too. The DRM SVM code only
has a single user for now (Xe) and this will evolve as others just in. 

I can park the latter half of this series for now, as it isn’t really
required aside from multi-GPU performance work, and with larger device
pages this really shouldn’t matter anyway.

My feeling is we probably need to circle back to some high-speed-fabric
API consensus within the next 6-9 months though.

This was just a PoC I started thinking about when converting to IOVA
link for dma-map and UAL ideas popped into my head.

> I'm confident we will see NICs and storage wired up to these fabrics
> as well.
> 

Yes, I agree eventually this will happen.

Matt

> Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28 19:45           ` Leon Romanovsky
@ 2026-01-28 21:04             ` Matthew Brost
  2026-01-29 10:14               ` Leon Romanovsky
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-28 21:04 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Jason Gunthorpe, intel-xe, dri-devel, francois.dugast,
	thomas.hellstrom, himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 09:45:40PM +0200, Leon Romanovsky wrote:
> On Wed, Jan 28, 2026 at 11:29:23AM -0800, Matthew Brost wrote:
> > On Wed, Jan 28, 2026 at 01:55:31PM -0400, Jason Gunthorpe wrote:
> > > On Wed, Jan 28, 2026 at 09:46:44AM -0800, Matthew Brost wrote:
> > > 
> > > > It is intended to fill holes. The input pages come from the
> > > > migrate_vma_* functions, which can return a sparsely populated array of
> > > > pages for a region (e.g., it scans a 2M range but only finds several of
> > > > the 512 pages eligible for migration). As a result, if (!page) is true
> > > > for many entries.
> > > 
> > > This is migration?? So something is DMA'ing from A -> B - why put
> > > holes in the first place? Can you tightly pack the pages in the IOVA?
> > > 
> > 
> > This could probably could be made to work. I think it would be an
> > initial pass to figure out the IOVA size then tightly pack.
> > 
> > Let me look at this. Probably better too as installing dummy pages is a
> > non-zero cost as I assume dma_iova_link is a radix tree walk.
> > 
> > > If there is no iommu then the addresses are scattered all over anyhow
> > > so it can't be relying on some dma_addr_t relationship?
> > 
> > Scattered dma-addresses is already handled in the copy code, likewise
> > holes so non-issue.
> > 
> > > 
> > > You don't have to fully populate the allocated iova, you can link from
> > > A-B and then unlink from A-B even if B is less than the total size
> > > requested.
> > > 
> > > The hmm users have the holes because hmm is dynamically
> > > adding/removing pages as it runs and it can't do anything to pack the
> > > mapping.
> > > 
> > > > > IOVA space? If so, what necessitates those holes? You can have less mapped
> > > > > than IOVA and dma_iova_*() API can handle it.
> > > > 
> > > > I was actually going to ask you about this, so I’m glad you brought it
> > > > up here. Again, this is a hack to avoid holes — the holes are never
> > > > touched by our copy function, but rather skipped, so we just jam in a
> > > > dummy address so the entire IOVA range has valid IOMMU pages.
> > > 
> > > I would say what you are doing is trying to optimize unmap by
> > 
> > Yes and make the code simplish.
> > 
> > > unmapping everything in one shot instead of just the mapped areas, and
> > > the WARN_ON is telling you that it isn't allowed to unmap across a
> > > hole.
> > > 
> > > > at the moment I’m not sure whether this warning affects actual
> > > > functionality or if we could just delete it. 
> > > 
> > > It means the iommu page table stopped unmapping when it hit a hole and
> > > there is a bunch of left over maps in the page table that shouldn't be
> > > there. So yes, it is serious and cannot be deleted.
> > >
> > 
> > Cool, this explains the warning.
> >  
> > > This is a possible option to teach things to detect the holes and
> > > ignore them..
> > 
> > Another option — and IMO probably the best one — as it makes potential
> > usages with holes the simplest at the driver level. Let me look at this
> > too.
> 
> It would be ideal if we could code a more general solution. In HMM we
> release pages one by one, and it would be preferable to have a single-shot
> unmap routine instead. In similar to NVMe which release all IOVA space
> with one call to dma_iova_destroy().
> 
> HMM chain:
> 
> ib_umem_odp_unmap_dma_pages()
>  -> for (...)
>    -> hmm_dma_unmap_pfn()
> 
> After giving more thought to my earlier suggestion to use
> hmm_pfn_to_phys(), I began to wonder why did not you use the
> hmm_dma_*() API instead?
> 

That is ill-suited for high-speed fabrics, but so is our existing
implementation — we’re just in slightly better shape (?). It also seems
ill-suited [1][2][3] for variable page sizes (which are possible with
our API), as well as the way we currently program device PTEs in our
driver. We also receive PFNs from the migrate_vma_* layer, which must
also be mapped.

I also believe the hmm_dma_* code predates the DRM code being merged, or
was merged around the same time.

We could work to unify the HMM helpers and make them usable, but that
won’t happen overnight. The HMM layer needs quite a bit of work to
useable, and then we’d have to propagate everything upward through
DRM/Xe and any new users. Let me play around with this though a bit
though to get rough idea what would need to be done here.

[1] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L255
[2] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L193
[3] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L104 

Also this is some odd stuff going... Why sync after every mapping [4].
Blindly doing BIDIRECTIONAL [5]... 

[4] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L826
[5] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L821

> > 
> > Do you think we need flag somewhere for 'ignore holes' or can I just
> > blindly skip them?
> 
> Better if we will have something like dma_iova_with_holes_destroy()
> function call to make sure that we don't hurt performance of existing
> dma_iova_destroy() users.
>

Yes, I think this is the best route for the time being. Let me look at
this.

Matt

> Thanks
> 
> > 
> > Matt
> > 
> > > 
> > > Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-28 21:04             ` Matthew Brost
@ 2026-01-29 10:14               ` Leon Romanovsky
  2026-01-29 18:22                 ` Matthew Brost
  0 siblings, 1 reply; 30+ messages in thread
From: Leon Romanovsky @ 2026-01-29 10:14 UTC (permalink / raw)
  To: Matthew Brost
  Cc: Jason Gunthorpe, intel-xe, dri-devel, francois.dugast,
	thomas.hellstrom, himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 01:04:49PM -0800, Matthew Brost wrote:
> On Wed, Jan 28, 2026 at 09:45:40PM +0200, Leon Romanovsky wrote:
> > On Wed, Jan 28, 2026 at 11:29:23AM -0800, Matthew Brost wrote:
> > > On Wed, Jan 28, 2026 at 01:55:31PM -0400, Jason Gunthorpe wrote:
> > > > On Wed, Jan 28, 2026 at 09:46:44AM -0800, Matthew Brost wrote:
> > > > 
> > > > > It is intended to fill holes. The input pages come from the
> > > > > migrate_vma_* functions, which can return a sparsely populated array of
> > > > > pages for a region (e.g., it scans a 2M range but only finds several of
> > > > > the 512 pages eligible for migration). As a result, if (!page) is true
> > > > > for many entries.
> > > > 
> > > > This is migration?? So something is DMA'ing from A -> B - why put
> > > > holes in the first place? Can you tightly pack the pages in the IOVA?
> > > > 
> > > 
> > > This could probably could be made to work. I think it would be an
> > > initial pass to figure out the IOVA size then tightly pack.
> > > 
> > > Let me look at this. Probably better too as installing dummy pages is a
> > > non-zero cost as I assume dma_iova_link is a radix tree walk.
> > > 
> > > > If there is no iommu then the addresses are scattered all over anyhow
> > > > so it can't be relying on some dma_addr_t relationship?
> > > 
> > > Scattered dma-addresses is already handled in the copy code, likewise
> > > holes so non-issue.
> > > 
> > > > 
> > > > You don't have to fully populate the allocated iova, you can link from
> > > > A-B and then unlink from A-B even if B is less than the total size
> > > > requested.
> > > > 
> > > > The hmm users have the holes because hmm is dynamically
> > > > adding/removing pages as it runs and it can't do anything to pack the
> > > > mapping.
> > > > 
> > > > > > IOVA space? If so, what necessitates those holes? You can have less mapped
> > > > > > than IOVA and dma_iova_*() API can handle it.
> > > > > 
> > > > > I was actually going to ask you about this, so I’m glad you brought it
> > > > > up here. Again, this is a hack to avoid holes — the holes are never
> > > > > touched by our copy function, but rather skipped, so we just jam in a
> > > > > dummy address so the entire IOVA range has valid IOMMU pages.
> > > > 
> > > > I would say what you are doing is trying to optimize unmap by
> > > 
> > > Yes and make the code simplish.
> > > 
> > > > unmapping everything in one shot instead of just the mapped areas, and
> > > > the WARN_ON is telling you that it isn't allowed to unmap across a
> > > > hole.
> > > > 
> > > > > at the moment I’m not sure whether this warning affects actual
> > > > > functionality or if we could just delete it. 
> > > > 
> > > > It means the iommu page table stopped unmapping when it hit a hole and
> > > > there is a bunch of left over maps in the page table that shouldn't be
> > > > there. So yes, it is serious and cannot be deleted.
> > > >
> > > 
> > > Cool, this explains the warning.
> > >  
> > > > This is a possible option to teach things to detect the holes and
> > > > ignore them..
> > > 
> > > Another option — and IMO probably the best one — as it makes potential
> > > usages with holes the simplest at the driver level. Let me look at this
> > > too.
> > 
> > It would be ideal if we could code a more general solution. In HMM we
> > release pages one by one, and it would be preferable to have a single-shot
> > unmap routine instead. In similar to NVMe which release all IOVA space
> > with one call to dma_iova_destroy().
> > 
> > HMM chain:
> > 
> > ib_umem_odp_unmap_dma_pages()
> >  -> for (...)
> >    -> hmm_dma_unmap_pfn()
> > 
> > After giving more thought to my earlier suggestion to use
> > hmm_pfn_to_phys(), I began to wonder why did not you use the
> > hmm_dma_*() API instead?
> > 
> 
> That is ill-suited for high-speed fabrics, but so is our existing
> implementation — we’re just in slightly better shape (?). It also seems
> ill-suited [1][2][3] for variable page sizes (which are possible with
> our API), as well as the way we currently program device PTEs in our
> driver. We also receive PFNs from the migrate_vma_* layer, which must
> also be mapped.
> 
> I also believe the hmm_dma_* code predates the DRM code being merged, or
> was merged around the same time.
> 
> We could work to unify the HMM helpers and make them usable, but that
> won’t happen overnight. The HMM layer needs quite a bit of work to
> useable, and then we’d have to propagate everything upward through
> DRM/Xe and any new users. Let me play around with this though a bit
> though to get rough idea what would need to be done here.
> 
> [1] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L255
> [2] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L193
> [3] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L104 
> 
> Also this is some odd stuff going... Why sync after every mapping [4].

Right now, hmm_dma_map_pfn() user is page-based one, we need to sync
after every pagefault.

> Blindly doing BIDIRECTIONAL [5]... 

It was promoted from old code, callers can provide direction.

> 
> [4] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L826
> [5] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L821
> 
> > > 
> > > Do you think we need flag somewhere for 'ignore holes' or can I just
> > > blindly skip them?
> > 
> > Better if we will have something like dma_iova_with_holes_destroy()
> > function call to make sure that we don't hurt performance of existing
> > dma_iova_destroy() users.
> >
> 
> Yes, I think this is the best route for the time being. Let me look at
> this.
> 
> Matt
> 
> > Thanks
> > 
> > > 
> > > Matt
> > > 
> > > > 
> > > > Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap
  2026-01-29 10:14               ` Leon Romanovsky
@ 2026-01-29 18:22                 ` Matthew Brost
  0 siblings, 0 replies; 30+ messages in thread
From: Matthew Brost @ 2026-01-29 18:22 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Jason Gunthorpe, intel-xe, dri-devel, francois.dugast,
	thomas.hellstrom, himal.prasad.ghimiray

On Thu, Jan 29, 2026 at 12:14:27PM +0200, Leon Romanovsky wrote:
> On Wed, Jan 28, 2026 at 01:04:49PM -0800, Matthew Brost wrote:
> > On Wed, Jan 28, 2026 at 09:45:40PM +0200, Leon Romanovsky wrote:
> > > On Wed, Jan 28, 2026 at 11:29:23AM -0800, Matthew Brost wrote:
> > > > On Wed, Jan 28, 2026 at 01:55:31PM -0400, Jason Gunthorpe wrote:
> > > > > On Wed, Jan 28, 2026 at 09:46:44AM -0800, Matthew Brost wrote:
> > > > > 
> > > > > > It is intended to fill holes. The input pages come from the
> > > > > > migrate_vma_* functions, which can return a sparsely populated array of
> > > > > > pages for a region (e.g., it scans a 2M range but only finds several of
> > > > > > the 512 pages eligible for migration). As a result, if (!page) is true
> > > > > > for many entries.
> > > > > 
> > > > > This is migration?? So something is DMA'ing from A -> B - why put
> > > > > holes in the first place? Can you tightly pack the pages in the IOVA?
> > > > > 
> > > > 
> > > > This could probably could be made to work. I think it would be an
> > > > initial pass to figure out the IOVA size then tightly pack.
> > > > 
> > > > Let me look at this. Probably better too as installing dummy pages is a
> > > > non-zero cost as I assume dma_iova_link is a radix tree walk.
> > > > 
> > > > > If there is no iommu then the addresses are scattered all over anyhow
> > > > > so it can't be relying on some dma_addr_t relationship?
> > > > 
> > > > Scattered dma-addresses is already handled in the copy code, likewise
> > > > holes so non-issue.
> > > > 
> > > > > 
> > > > > You don't have to fully populate the allocated iova, you can link from
> > > > > A-B and then unlink from A-B even if B is less than the total size
> > > > > requested.
> > > > > 
> > > > > The hmm users have the holes because hmm is dynamically
> > > > > adding/removing pages as it runs and it can't do anything to pack the
> > > > > mapping.
> > > > > 
> > > > > > > IOVA space? If so, what necessitates those holes? You can have less mapped
> > > > > > > than IOVA and dma_iova_*() API can handle it.
> > > > > > 
> > > > > > I was actually going to ask you about this, so I’m glad you brought it
> > > > > > up here. Again, this is a hack to avoid holes — the holes are never
> > > > > > touched by our copy function, but rather skipped, so we just jam in a
> > > > > > dummy address so the entire IOVA range has valid IOMMU pages.
> > > > > 
> > > > > I would say what you are doing is trying to optimize unmap by
> > > > 
> > > > Yes and make the code simplish.
> > > > 
> > > > > unmapping everything in one shot instead of just the mapped areas, and
> > > > > the WARN_ON is telling you that it isn't allowed to unmap across a
> > > > > hole.
> > > > > 
> > > > > > at the moment I’m not sure whether this warning affects actual
> > > > > > functionality or if we could just delete it. 
> > > > > 
> > > > > It means the iommu page table stopped unmapping when it hit a hole and
> > > > > there is a bunch of left over maps in the page table that shouldn't be
> > > > > there. So yes, it is serious and cannot be deleted.
> > > > >
> > > > 
> > > > Cool, this explains the warning.
> > > >  
> > > > > This is a possible option to teach things to detect the holes and
> > > > > ignore them..
> > > > 
> > > > Another option — and IMO probably the best one — as it makes potential
> > > > usages with holes the simplest at the driver level. Let me look at this
> > > > too.
> > > 
> > > It would be ideal if we could code a more general solution. In HMM we
> > > release pages one by one, and it would be preferable to have a single-shot
> > > unmap routine instead. In similar to NVMe which release all IOVA space
> > > with one call to dma_iova_destroy().
> > > 
> > > HMM chain:
> > > 
> > > ib_umem_odp_unmap_dma_pages()
> > >  -> for (...)
> > >    -> hmm_dma_unmap_pfn()
> > > 
> > > After giving more thought to my earlier suggestion to use
> > > hmm_pfn_to_phys(), I began to wonder why did not you use the
> > > hmm_dma_*() API instead?
> > > 
> > 
> > That is ill-suited for high-speed fabrics, but so is our existing
> > implementation — we’re just in slightly better shape (?). It also seems
> > ill-suited [1][2][3] for variable page sizes (which are possible with
> > our API), as well as the way we currently program device PTEs in our
> > driver. We also receive PFNs from the migrate_vma_* layer, which must
> > also be mapped.
> > 
> > I also believe the hmm_dma_* code predates the DRM code being merged, or
> > was merged around the same time.
> > 
> > We could work to unify the HMM helpers and make them usable, but that
> > won’t happen overnight. The HMM layer needs quite a bit of work to
> > useable, and then we’d have to propagate everything upward through
> > DRM/Xe and any new users. Let me play around with this though a bit
> > though to get rough idea what would need to be done here.
> > 
> > [1] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L255
> > [2] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L193
> > [3] https://elixir.bootlin.com/linux/v6.18.6/source/drivers/infiniband/core/umem_odp.c#L104 
> > 
> > Also this is some odd stuff going... Why sync after every mapping [4].
> 
> Right now, hmm_dma_map_pfn() user is page-based one, we need to sync
> after every pagefault.
> 

Right. On GPUs we typically fault in chunks because it involves a copy
to/from the device, which is expensive, and it’s much more efficient to
transfer larger sizes. (IIRC, faulting 2M with 512 × 4K pages versus 512
separate 4K faults was about 58× faster in the former case.)

THP device pages (+mTHP) make the “one fault == one page” model more
palatable, but memory gets fragmented, and if THP/mTHP allocations fail,
we really need the path where we can move multiple pages in a single
fault. Because of that, we wouldn’t want to sync until all dma-mappings
are linked.

Also, I dug into hmm_dma_map_pfn; it doesn’t handle device-private pages
either, which is something we need.

As a long-term goal, having a function like hmm_dma_map_pfn that handled
multiple pages of various sizes, supported device-private memory,
sparsely populated regions, unified handling with migration PFNs,
handled high-speed fabric vs. P2P, and simply returned a mapping that a
driver could take and program into PTEs would be great. Perhaps that’s a
goal we can work toward eventually, though making this generic across
many driver/subsystem use cases seems difficult. The code I'm writing
here make this generic across DRM but my driver (Xe) is the only user
thus far so really impossible to know if I've got this correct until
another vender jumps in which hopefully is happening soonish.

Matt

> > Blindly doing BIDIRECTIONAL [5]... 
> 
> It was promoted from old code, callers can provide direction.
> 
> > 
> > [4] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L826
> > [5] https://elixir.bootlin.com/linux/v6.18.6/source/mm/hmm.c#L821
> > 
> > > > 
> > > > Do you think we need flag somewhere for 'ignore holes' or can I just
> > > > blindly skip them?
> > > 
> > > Better if we will have something like dma_iova_with_holes_destroy()
> > > function call to make sure that we don't hurt performance of existing
> > > dma_iova_destroy() users.
> > >
> > 
> > Yes, I think this is the best route for the time being. Let me look at
> > this.
> > 
> > Matt
> > 
> > > Thanks
> > > 
> > > > 
> > > > Matt
> > > > 
> > > > > 
> > > > > Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
  2026-01-28 20:24         ` Matthew Brost
@ 2026-01-29 18:57           ` Jason Gunthorpe
  2026-01-29 19:28             ` Matthew Brost
  0 siblings, 1 reply; 30+ messages in thread
From: Jason Gunthorpe @ 2026-01-29 18:57 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Wed, Jan 28, 2026 at 12:24:25PM -0800, Matthew Brost wrote:
> On Wed, Jan 28, 2026 at 03:35:09PM -0400, Jason Gunthorpe wrote:
> > On Wed, Jan 28, 2026 at 10:42:53AM -0800, Matthew Brost wrote:
> > > Yes, this is exactly what I envision here. First, let me explain the
> > > possible addressing modes on the UAL fabric:
> > > 
> > >  - Physical (akin to IOMMU passthrough)
> > >  - Virtual (akin to IOMMU enabled)
> > > 
> > > Physical mode is straightforward — resolve the PFN to a cross-device
> > > physical address, then install it into the initiator’s page tables along
> > > with a bit indicating routing over the network. In this mode, the vfuncs
> > > here are basically NOPs.
> > 
> > Ugh of course they would invent something so complicated.
> 
> Why wouldn't we... But conceptually really fairly close to IOMMU
> paththrough vs. enabled.

Why do you need address virtualization on the scale up fabric :( I can
see access control but full virtualization sounds like overkill,
especially considering how slow it will necessarily be compared to the
fabric itself.

We are already in a world where even PCI can't manage untranslated
requests and a scale up fabric with 3TB/sec of bandwidth is somehow
going to have address translation too? Doesn't seem reasonable.

> > I'm not convinced this should be hidden inside DRM. The DMA API is the
> 
> 
> Well, what I’m suggesting isn’t in DRM. A UAL API would be its own
> layer, much like the DMA API. Of course we could stick this in the DMA
> API and make it high-speed-fabric-generic, etc., but I do think the
> fabric functions would have their own signatures and semantics (see my
> explanation around device_ual_alloc reclaim rules, what locks it is
> allowed to take, etc.).

DMA API is already bus agnostic, I think there is no issue to plug in
a ualink_device or whatever under there and make it do something
sensible, and it would be *particularly* easy if the address
translation can slot in as an attached iommu.

Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
  2026-01-29 18:57           ` Jason Gunthorpe
@ 2026-01-29 19:28             ` Matthew Brost
  2026-01-29 19:32               ` Jason Gunthorpe
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Brost @ 2026-01-29 19:28 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Thu, Jan 29, 2026 at 02:57:31PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 28, 2026 at 12:24:25PM -0800, Matthew Brost wrote:
> > On Wed, Jan 28, 2026 at 03:35:09PM -0400, Jason Gunthorpe wrote:
> > > On Wed, Jan 28, 2026 at 10:42:53AM -0800, Matthew Brost wrote:
> > > > Yes, this is exactly what I envision here. First, let me explain the
> > > > possible addressing modes on the UAL fabric:
> > > > 
> > > >  - Physical (akin to IOMMU passthrough)
> > > >  - Virtual (akin to IOMMU enabled)
> > > > 
> > > > Physical mode is straightforward — resolve the PFN to a cross-device
> > > > physical address, then install it into the initiator’s page tables along
> > > > with a bit indicating routing over the network. In this mode, the vfuncs
> > > > here are basically NOPs.
> > > 
> > > Ugh of course they would invent something so complicated.
> > 
> > Why wouldn't we... But conceptually really fairly close to IOMMU
> > paththrough vs. enabled.
> 
> Why do you need address virtualization on the scale up fabric :( I can
> see access control but full virtualization sounds like overkill,
> especially considering how slow it will necessarily be compared to the
> fabric itself.
> 
> We are already in a world where even PCI can't manage untranslated
> requests and a scale up fabric with 3TB/sec of bandwidth is somehow
> going to have address translation too? Doesn't seem reasonable.
> 

I don’t design hardware…

But inter-OS security wants virtualization. In practice, intra-OS (what
we’re talking about here) should always be physical, but it doesn’t have
to be. Thus, IMO, any common API we come up with should support all
conceivable addressing modes that might be implemented.

> > > I'm not convinced this should be hidden inside DRM. The DMA API is the
> > 
> > 
> > Well, what I’m suggesting isn’t in DRM. A UAL API would be its own
> > layer, much like the DMA API. Of course we could stick this in the DMA
> > API and make it high-speed-fabric-generic, etc., but I do think the
> > fabric functions would have their own signatures and semantics (see my
> > explanation around device_ual_alloc reclaim rules, what locks it is
> > allowed to take, etc.).
> 
> DMA API is already bus agnostic, I think there is no issue to plug in
> a ualink_device or whatever under there and make it do something

I have thought about this, which is why our idea was to roughly duplicate
the DMA API and layer it almost exactly the same. My only concern would
be the semantics.

dma_iova_alloc() ← This is reclaim-safe currently, AFAIK.

ual_iova_alloc() ← If this allocates GPU memory for page tables, it is
basically impossible to make reclaim-safe (i.e. call under a notifier
lock), avoid dma-resv locks (i.e., call in map_dma_buf) without
subsysem-level rewrites in DRM for allocating memory and driver-level
rewrites of the bind code / for Xe, Nouveau (likely Nova), and AMDGPU.

Then of course dma_addr_t now means something entirely different from
the original intent.

If we can work something out here, then yes, maybe we can just use the
DMA API, as I believe it should work aside from the semantic changes and
perhaps minor tweaks to go from struct page -> physical address over the
network.

> sensible, and it would be *particularly* easy if the address
> translation can slot in as an attached iommu.

I'm out of my depth on the IOMMU layer so I can't really comment.

Matt

> 
> Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap
  2026-01-29 19:28             ` Matthew Brost
@ 2026-01-29 19:32               ` Jason Gunthorpe
  0 siblings, 0 replies; 30+ messages in thread
From: Jason Gunthorpe @ 2026-01-29 19:32 UTC (permalink / raw)
  To: Matthew Brost
  Cc: intel-xe, dri-devel, leonro, francois.dugast, thomas.hellstrom,
	himal.prasad.ghimiray

On Thu, Jan 29, 2026 at 11:28:38AM -0800, Matthew Brost wrote:
> > DMA API is already bus agnostic, I think there is no issue to plug in
> > a ualink_device or whatever under there and make it do something
> 
> I have thought about this, which is why our idea was to roughly duplicate
> the DMA API and layer it almost exactly the same. My only concern would
> be the semantics.
> 
> dma_iova_alloc() ← This is reclaim-safe currently, AFAIK.
> 
> ual_iova_alloc() ← If this allocates GPU memory for page tables, it is
> basically impossible to make reclaim-safe (i.e. call under a notifier
> lock), avoid dma-resv locks (i.e., call in map_dma_buf) without
> subsysem-level rewrites in DRM for allocating memory and driver-level
> rewrites of the bind code / for Xe, Nouveau (likely Nova), and AMDGPU.

If GFP_NO_RECLAIM is your only issue I'm sure that can be delt with.

> Then of course dma_addr_t now means something entirely different from
> the original intent.

No, dma_addr_t means an address the DMA API created for a specific
struct device that represents that device's address space.

There is no issue to have a seperate address space for a ual_link
device from a pci_device.

> DMA API, as I believe it should work aside from the semantic changes and
> perhaps minor tweaks to go from struct page -> physical address over the
> network.

We got rid of struct page from the core DMA API already..

I think your biggest challenge will be to describe the GPU VRAM in a
way that is relative to the ualink networking... phys_addr_t might not
cut it.

Jason

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2026-01-29 19:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28  0:48 [RFC PATCH v3 00/11] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 01/11] drm/pagemap: Add helper to access zone_device_data Matthew Brost
2026-01-28 13:53   ` Leon Romanovsky
2026-01-28  0:48 ` [RFC PATCH v3 02/11] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
2026-01-28 14:04   ` Leon Romanovsky
2026-01-28  0:48 ` [RFC PATCH v3 03/11] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 04/11] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
2026-01-28 14:28   ` Leon Romanovsky
2026-01-28 17:46     ` Matthew Brost
     [not found]       ` <20260128175531.GR1641016@ziepe.ca>
2026-01-28 19:29         ` Matthew Brost
2026-01-28 19:45           ` Leon Romanovsky
2026-01-28 21:04             ` Matthew Brost
2026-01-29 10:14               ` Leon Romanovsky
2026-01-29 18:22                 ` Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 05/11] drm/pagemap: Reduce number of IOVA link calls Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 06/11] drm/pagemap: Add IOVA interface to DRM pagemap Matthew Brost
     [not found]   ` <20260128151458.GJ1641016@ziepe.ca>
2026-01-28 18:42     ` Matthew Brost
2026-01-28 19:41       ` Matthew Brost
     [not found]       ` <20260128193509.GU1641016@ziepe.ca>
2026-01-28 20:24         ` Matthew Brost
2026-01-29 18:57           ` Jason Gunthorpe
2026-01-29 19:28             ` Matthew Brost
2026-01-29 19:32               ` Jason Gunthorpe
2026-01-28  0:48 ` [RFC PATCH v3 07/11] drm/xe: Stub out DRM pagemap IOVA alloc implementation Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 08/11] drm/pagemap: Use device-to-device IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 09/11] drm/xe: Drop BO dma-resv lock during SVM migrate-to-device Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 10/11] drm/xe: Implement DRM pagemap IOVA vfuncs Matthew Brost
2026-01-28  0:48 ` [RFC PATCH v3 11/11] drm/gpusvm: Use device-to-device IOVA alloc, link, and sync API in GPU SVM Matthew Brost
2026-01-28  0:59 ` ✗ CI.checkpatch: warning for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev3) Patchwork
2026-01-28  1:01 ` ✓ CI.KUnit: success " Patchwork
2026-01-28  1:42 ` ✓ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox