Skip to contentSkip to conversation

drm/ttm: stop setting page->index for the ttm_tt

PATCH In review Matthew Auld 4 participants 25 messages Sep 15, 2021 – Sep 16, 2021

Subsystems (6)
lore
Share & tools
lore

Matthew Auld

author reviewer
#0 lore raw

PATCH v3 1/12 drm/ttm: stop setting page->index for the ttm_tt

In commit:

commit 58aa6622d32af7d2c08d45085f44c54554a16ed7

Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:47:23 2014 +0100

drm/ttm: Correctly set page mapping and -index members

we started setting the page->mapping and page->index to point to the virtual address space, if the pages were faulted with TTM. Apparently this was needed for core-mm to able to reverse lookup the virtual address given the struct page, and potentially unmap it from the page tables. However as pointed out by Thomas, since we are now using PFN_MAP, instead of say PFN_MIXED, this should no longer be the case.

There was also apparently some usecase in vmwgfx which needed this for dirty tracking, but that also doesn't appear to be the case anymore, as pointed out by Thomas.

We still need keep the page->mapping for now, since that is still needed for different reasons, but we try to address that in the next patch.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 --
 drivers/gpu/drm/ttm/ttm_tt.c    | 4 +---
 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +0 -2
index f56be5bc0861..906ec8a1bf5a 100644
@@ -346,8 +346,6 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
 			} else if (unlikely(!page)) {
 				break;
 			}
-			page->index = drm_vma_node_start(&bo->base.vma_node) +
-				page_offset;
 			pfn = page_to_pfn(page);
 		}
 
drivers/gpu/drm/ttm/ttm_tt.c +1 -3
index dae52433beeb..1cc04c224988 100644
@@ -367,10 +367,8 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
 		return;
 
-	for (i = 0; i < ttm->num_pages; ++i) {
+	for (i = 0; i < ttm->num_pages; ++i)
 		(*page)->mapping = NULL;
-		(*page++)->index = 0;
-	}
 }
 
 void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
Signature · 1 line
2.26.3
author reviewer
#1 lore raw

PATCH v3 2/12 drm/ttm: move ttm_tt_{add, clear}_mapping into amdgpu

Now that setting page->index shouldn't be needed anymore, we are just left with setting page->mapping, and here it looks like amdgpu is the only user, where pointing the page->mapping at the dev_mapping is used to verify that the pages do indeed belong to the device, if userspace later tries to touch them.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 27 ++++++++++++++++++++++++-
 drivers/gpu/drm/ttm/ttm_tt.c            | 25 -----------------------
 2 files changed, 26 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +26 -1
index 1129e17e9f09..c5fa6e62f6ca 100644
@@ -1107,6 +1107,24 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
 	return &gtt->ttm;
 }
 
+static void amdgpu_ttm_tt_add_mapping(struct ttm_device *bdev,
+				      struct ttm_tt *ttm)
+{
+	pgoff_t i;
+
+	for (i = 0; i < ttm->num_pages; ++i)
+		ttm->pages[i]->mapping = bdev->dev_mapping;
+}
+
+static void amdgpu_ttm_tt_clear_mapping(struct ttm_tt *ttm)
+{
+	struct page **page = ttm->pages;
+	pgoff_t i;
+
+	for (i = 0; i < ttm->num_pages; ++i)
+		(*page)->mapping = NULL;
+}
+
 /*
  * amdgpu_ttm_tt_populate - Map GTT pages visible to the device
  *
@@ -1119,6 +1137,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
 {
 	struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
 	struct amdgpu_ttm_tt *gtt = (void *)ttm;
+	int ret;
 
 	/* user pages are bound by amdgpu_ttm_tt_pin_userptr() */
 	if (gtt->userptr) {
@@ -1131,7 +1150,12 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
 	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
 		return 0;
 
-	return ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
+	ret = ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
+	if (ret)
+		return ret;
+
+	amdgpu_ttm_tt_add_mapping(bdev, ttm);
+	return 0;
 }
 
 /*
@@ -1159,6 +1183,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
 		return;
 
 	adev = amdgpu_ttm_adev(bdev);
+	amdgpu_ttm_tt_clear_mapping(ttm);
 	return ttm_pool_free(&adev->mman.bdev.pool, ttm);
 }
 
drivers/gpu/drm/ttm/ttm_tt.c +0 -25
index 1cc04c224988..980ecb079b2c 100644
@@ -289,17 +289,6 @@ int ttm_tt_swapout(struct ttm_device *bdev, struct ttm_tt *ttm,
 	return ret;
 }
 
-static void ttm_tt_add_mapping(struct ttm_device *bdev, struct ttm_tt *ttm)
-{
-	pgoff_t i;
-
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
-		return;
-
-	for (i = 0; i < ttm->num_pages; ++i)
-		ttm->pages[i]->mapping = bdev->dev_mapping;
-}
-
 int ttm_tt_populate(struct ttm_device *bdev,
 		    struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
 {
@@ -336,7 +325,6 @@ int ttm_tt_populate(struct ttm_device *bdev,
 	if (ret)
 		goto error;
 
-	ttm_tt_add_mapping(bdev, ttm);
 	ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
 	if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
 		ret = ttm_tt_swapin(ttm);
@@ -359,24 +347,11 @@ int ttm_tt_populate(struct ttm_device *bdev,
 }
 EXPORT_SYMBOL(ttm_tt_populate);
 
-static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
-{
-	pgoff_t i;
-	struct page **page = ttm->pages;
-
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
-		return;
-
-	for (i = 0; i < ttm->num_pages; ++i)
-		(*page)->mapping = NULL;
-}
-
 void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
 {
 	if (!ttm_tt_is_populated(ttm))
 		return;
 
-	ttm_tt_clear_mapping(ttm);
 	if (bdev->funcs->ttm_tt_unpopulate)
 		bdev->funcs->ttm_tt_unpopulate(bdev, ttm);
 	else
Signature · 1 line
2.26.3
maintainer
#2 lore raw

Re: [PATCH v3 02/12] drm/ttm: move ttm_tt_{add,clear}_mapping into amdgpu

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 52 lines

Now that setting page->index shouldn't be needed anymore, we are just left with setting page->mapping, and here it looks like amdgpu is the only user, where pointing the page->mapping at the dev_mapping is used to verify that the pages do indeed belong to the device, if userspace later tries to touch them.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 27 ++++++++++++++++++++++++-
  drivers/gpu/drm/ttm/ttm_tt.c            | 25 -----------------------
  2 files changed, 26 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +19 -0
index 1129e17e9f09..c5fa6e62f6ca 100644
@@ -1107,6 +1107,24 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_buffer_object *bo,
  	return &gtt->ttm;
  }
 
+static void amdgpu_ttm_tt_add_mapping(struct ttm_device *bdev,
+				      struct ttm_tt *ttm)
+{
+	pgoff_t i;
+
+	for (i = 0; i < ttm->num_pages; ++i)
+		ttm->pages[i]->mapping = bdev->dev_mapping;
+}
+
+static void amdgpu_ttm_tt_clear_mapping(struct ttm_tt *ttm)
+{
+	struct page **page = ttm->pages;
+	pgoff_t i;
+
+	for (i = 0; i < ttm->num_pages; ++i)
+		(*page)->mapping = NULL;
+}
+
  /*
   * amdgpu_ttm_tt_populate - Map GTT pages visible to the device
   *
@@ -1119,6 +1137,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
  {
  	struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
  	struct amdgpu_ttm_tt *gtt = (void *)ttm;
+	int ret;
 
  	/* user pages are bound by amdgpu_ttm_tt_pin_userptr() */
  	if (gtt->userptr) {

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static int amdgpu_ttm_tt_populate(struct ttm_device *bdev, · line 1157

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +5 -1
@@ -1131,7 +1150,12 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
  	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
  		return 0;
 
-	return ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
+	ret = ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
+	if (ret)
+		return ret;
+
+	amdgpu_ttm_tt_add_mapping(bdev, ttm);

I don't really see why this needs to be a separate function. Just inline the loop here.

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev, · line 1186

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -0
+	return 0;
  }
 
  /*
@@ -1159,6 +1183,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
  		return;
 
  	adev = amdgpu_ttm_adev(bdev);
+	amdgpu_ttm_tt_clear_mapping(ttm);

Same here of course, apart from that looks good to me.

Christian.

Quoted 58 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
  	return ttm_pool_free(&adev->mman.bdev.pool, ttm);
  }
 
drivers/gpu/drm/ttm/ttm_tt.c +0 -25
index 1cc04c224988..980ecb079b2c 100644
@@ -289,17 +289,6 @@ int ttm_tt_swapout(struct ttm_device *bdev, struct ttm_tt *ttm,
  	return ret;
  }
 
-static void ttm_tt_add_mapping(struct ttm_device *bdev, struct ttm_tt *ttm)
-{
-	pgoff_t i;
-
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
-		return;
-
-	for (i = 0; i < ttm->num_pages; ++i)
-		ttm->pages[i]->mapping = bdev->dev_mapping;
-}
-
  int ttm_tt_populate(struct ttm_device *bdev,
  		    struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
  {
@@ -336,7 +325,6 @@ int ttm_tt_populate(struct ttm_device *bdev,
  	if (ret)
  		goto error;
 
-	ttm_tt_add_mapping(bdev, ttm);
  	ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
  	if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
  		ret = ttm_tt_swapin(ttm);
@@ -359,24 +347,11 @@ int ttm_tt_populate(struct ttm_device *bdev,
  }
  EXPORT_SYMBOL(ttm_tt_populate);
 
-static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
-{
-	pgoff_t i;
-	struct page **page = ttm->pages;
-
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
-		return;
-
-	for (i = 0; i < ttm->num_pages; ++i)
-		(*page)->mapping = NULL;
-}
-
  void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
  {
  	if (!ttm_tt_is_populated(ttm))
  		return;
 
-	ttm_tt_clear_mapping(ttm);
  	if (bdev->funcs->ttm_tt_unpopulate)
  		bdev->funcs->ttm_tt_unpopulate(bdev, ttm);
  	else
author reviewer
#3 lore raw

PATCH v3 3/12 drm/ttm: remove TTM_PAGE_FLAG_NO_RETRY

In reply to Matthew Auld

No longer used it seems.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 include/drm/ttm/ttm_tt.h | 1 -
 1 file changed, 1 deletion(-)
include/drm/ttm/ttm_tt.h +0 -1
index 89b15d673b22..842ce756213c 100644
@@ -41,7 +41,6 @@ struct ttm_operation_ctx;
 #define TTM_PAGE_FLAG_SWAPPED         (1 << 4)
 #define TTM_PAGE_FLAG_ZERO_ALLOC      (1 << 6)
 #define TTM_PAGE_FLAG_SG              (1 << 8)
-#define TTM_PAGE_FLAG_NO_RETRY	      (1 << 9)
 
 #define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
 
Signature · 1 line
2.26.3
maintainer Reviewed-by on v3 3/12
#4 lore raw

Re: [PATCH v3 03/12] drm/ttm: remove TTM_PAGE_FLAG_NO_RETRY

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 5 lines

No longer used it seems.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
Quoted 16 lines
---
  include/drm/ttm/ttm_tt.h | 1 -
  1 file changed, 1 deletion(-)
include/drm/ttm/ttm_tt.h +0 -1
index 89b15d673b22..842ce756213c 100644
@@ -41,7 +41,6 @@ struct ttm_operation_ctx;
  #define TTM_PAGE_FLAG_SWAPPED         (1 << 4)
  #define TTM_PAGE_FLAG_ZERO_ALLOC      (1 << 6)
  #define TTM_PAGE_FLAG_SG              (1 << 8)
-#define TTM_PAGE_FLAG_NO_RETRY	      (1 << 9)
 
  #define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
 
author reviewer
#5 lore raw

PATCH v3 4/12 drm/ttm: s/FLAG_SG/FLAG_EXTERNAL/

In reply to Matthew Auld

It covers more than just ttm_bo_type_sg usage, like with say dma-buf, since one other user is userptr in amdgpu, and in the future we might have some more. Hence EXTERNAL is likely a more suitable name.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +++++-----
 drivers/gpu/drm/nouveau/nouveau_bo.c    |  4 ++--
 drivers/gpu/drm/radeon/radeon_ttm.c     |  8 ++++----
 drivers/gpu/drm/ttm/ttm_bo.c            |  2 +-
 drivers/gpu/drm/ttm/ttm_bo_vm.c         |  2 +-
 drivers/gpu/drm/ttm/ttm_tt.c            | 10 +++++-----
 include/drm/ttm/ttm_tt.h                |  6 +++---
 7 files changed, 21 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +5 -5
index c5fa6e62f6ca..a6d606f91dfd 100644
@@ -894,7 +894,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
 			DRM_ERROR("failed to pin userptr\n");
 			return r;
 		}
-	} else if (ttm->page_flags & TTM_PAGE_FLAG_SG) {
+	} else if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL) {
 		if (!ttm->sg) {
 			struct dma_buf_attachment *attach;
 			struct sg_table *sgt;
@@ -1147,7 +1147,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
 		return 0;
 	}
 
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+	if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)
 		return 0;
 
 	ret = ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
@@ -1179,7 +1179,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
 		return;
 	}
 
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+	if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)
 		return;
 
 	adev = amdgpu_ttm_adev(bdev);
@@ -1210,8 +1210,8 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_buffer_object *bo,
 			return -ENOMEM;
 	}
 
-	/* Set TTM_PAGE_FLAG_SG before populate but after create. */
-	bo->ttm->page_flags |= TTM_PAGE_FLAG_SG;
+	/* Set TTM_PAGE_FLAG_EXTERNAL before populate but after create. */
+	bo->ttm->page_flags |= TTM_PAGE_FLAG_EXTERNAL;
 
 	gtt = (void *)bo->ttm;
 	gtt->userptr = addr;
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -2
index 33dca2565cca..ba0fec252df7 100644
@@ -1249,7 +1249,7 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
 	struct ttm_tt *ttm_dma = (void *)ttm;
 	struct nouveau_drm *drm;
 	struct device *dev;
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
 	if (ttm_tt_is_populated(ttm))
 		return 0;
@@ -1272,7 +1272,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
 {
 	struct nouveau_drm *drm;
 	struct device *dev;
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
 	if (slave)
 		return;
drivers/gpu/drm/radeon/radeon_ttm.c +4 -4
index 7793249bc549..d891491b6da8 100644
@@ -545,14 +545,14 @@ static int radeon_ttm_tt_populate(struct ttm_device *bdev,
 {
 	struct radeon_device *rdev = radeon_get_rdev(bdev);
 	struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(rdev, ttm);
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
 	if (gtt && gtt->userptr) {
 		ttm->sg = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
 		if (!ttm->sg)
 			return -ENOMEM;
 
-		ttm->page_flags |= TTM_PAGE_FLAG_SG;
+		ttm->page_flags |= TTM_PAGE_FLAG_EXTERNAL;
 		return 0;
 	}
 
@@ -569,13 +569,13 @@ static void radeon_ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm
 {
 	struct radeon_device *rdev = radeon_get_rdev(bdev);
 	struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(rdev, ttm);
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
 	radeon_ttm_tt_unbind(bdev, ttm);
 
 	if (gtt && gtt->userptr) {
 		kfree(ttm->sg);
-		ttm->page_flags &= ~TTM_PAGE_FLAG_SG;
+		ttm->page_flags &= ~TTM_PAGE_FLAG_EXTERNAL;
 		return;
 	}
 
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index 3b22c0013dbf..642dc7ce3081 100644
@@ -1115,7 +1115,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
 		return -EBUSY;
 
 	if (!bo->ttm || !ttm_tt_is_populated(bo->ttm) ||
-	    bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
+	    bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL ||
 	    bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED ||
 	    !ttm_bo_get_unless_zero(bo)) {
 		if (locked)
drivers/gpu/drm/ttm/ttm_bo_vm.c +1 -1
index 906ec8a1bf5a..708390588c7c 100644
@@ -162,7 +162,7 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
 	 * Refuse to fault imported pages. This should be handled
 	 * (if at all) by redirecting mmap to the exporter.
 	 */
-	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
 		dma_resv_unlock(bo->base.resv);
 		return VM_FAULT_SIGBUS;
 	}
drivers/gpu/drm/ttm/ttm_tt.c +5 -5
index 980ecb079b2c..9c586b613737 100644
@@ -73,7 +73,7 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
 	case ttm_bo_type_kernel:
 		break;
 	case ttm_bo_type_sg:
-		page_flags |= TTM_PAGE_FLAG_SG;
+		page_flags |= TTM_PAGE_FLAG_EXTERNAL;
 		break;
 	default:
 		pr_err("Illegal buffer object type\n");
@@ -178,7 +178,7 @@ int ttm_sg_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
 
 	ttm_tt_init_fields(ttm, bo, page_flags, caching);
 
-	if (page_flags & TTM_PAGE_FLAG_SG)
+	if (page_flags & TTM_PAGE_FLAG_EXTERNAL)
 		ret = ttm_sg_tt_alloc_page_directory(ttm);
 	else
 		ret = ttm_dma_tt_alloc_page_directory(ttm);
@@ -300,7 +300,7 @@ int ttm_tt_populate(struct ttm_device *bdev,
 	if (ttm_tt_is_populated(ttm))
 		return 0;
 
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
 		atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
 		if (bdev->pool.use_dma32)
 			atomic_long_add(ttm->num_pages,
@@ -337,7 +337,7 @@ int ttm_tt_populate(struct ttm_device *bdev,
 	return 0;
 
 error:
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
 		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
 		if (bdev->pool.use_dma32)
 			atomic_long_sub(ttm->num_pages,
@@ -357,7 +357,7 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
 	else
 		ttm_pool_free(&bdev->pool, ttm);
 
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
 		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
 		if (bdev->pool.use_dma32)
 			atomic_long_sub(ttm->num_pages,
include/drm/ttm/ttm_tt.h +3 -3
index 842ce756213c..a6c284c21e72 100644
@@ -38,9 +38,9 @@ struct ttm_resource;
 struct ttm_buffer_object;
 struct ttm_operation_ctx;
 
-#define TTM_PAGE_FLAG_SWAPPED         (1 << 4)
-#define TTM_PAGE_FLAG_ZERO_ALLOC      (1 << 6)
-#define TTM_PAGE_FLAG_SG              (1 << 8)
+#define TTM_PAGE_FLAG_SWAPPED		(1 << 4)
+#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 6)
+#define TTM_PAGE_FLAG_EXTERNAL		(1 << 8)
 
 #define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
 
Signature · 1 line
2.26.3
maintainer
#6 lore raw

Re: [PATCH v3 04/12] drm/ttm: s/FLAG_SG/FLAG_EXTERNAL/

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 199 lines

It covers more than just ttm_bo_type_sg usage, like with say dma-buf, since one other user is userptr in amdgpu, and in the future we might have some more. Hence EXTERNAL is likely a more suitable name.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +++++-----
  drivers/gpu/drm/nouveau/nouveau_bo.c    |  4 ++--
  drivers/gpu/drm/radeon/radeon_ttm.c     |  8 ++++----
  drivers/gpu/drm/ttm/ttm_bo.c            |  2 +-
  drivers/gpu/drm/ttm/ttm_bo_vm.c         |  2 +-
  drivers/gpu/drm/ttm/ttm_tt.c            | 10 +++++-----
  include/drm/ttm/ttm_tt.h                |  6 +++---
  7 files changed, 21 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +5 -5
index c5fa6e62f6ca..a6d606f91dfd 100644
@@ -894,7 +894,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
  			DRM_ERROR("failed to pin userptr\n");
  			return r;
  		}
-	} else if (ttm->page_flags & TTM_PAGE_FLAG_SG) {
+	} else if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL) {
  		if (!ttm->sg) {
  			struct dma_buf_attachment *attach;
  			struct sg_table *sgt;
@@ -1147,7 +1147,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
  		return 0;
  	}
 
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+	if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)
  		return 0;
 
  	ret = ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx);
@@ -1179,7 +1179,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_device *bdev,
  		return;
  	}
 
-	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
+	if (ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)
  		return;
 
  	adev = amdgpu_ttm_adev(bdev);
@@ -1210,8 +1210,8 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_buffer_object *bo,
  			return -ENOMEM;
  	}
 
-	/* Set TTM_PAGE_FLAG_SG before populate but after create. */
-	bo->ttm->page_flags |= TTM_PAGE_FLAG_SG;
+	/* Set TTM_PAGE_FLAG_EXTERNAL before populate but after create. */
+	bo->ttm->page_flags |= TTM_PAGE_FLAG_EXTERNAL;
 
  	gtt = (void *)bo->ttm;
  	gtt->userptr = addr;
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -2
index 33dca2565cca..ba0fec252df7 100644
@@ -1249,7 +1249,7 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev,
  	struct ttm_tt *ttm_dma = (void *)ttm;
  	struct nouveau_drm *drm;
  	struct device *dev;
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
  	if (ttm_tt_is_populated(ttm))
  		return 0;
@@ -1272,7 +1272,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
  {
  	struct nouveau_drm *drm;
  	struct device *dev;
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
  	if (slave)
  		return;
drivers/gpu/drm/radeon/radeon_ttm.c +4 -4
index 7793249bc549..d891491b6da8 100644
@@ -545,14 +545,14 @@ static int radeon_ttm_tt_populate(struct ttm_device *bdev,
  {
  	struct radeon_device *rdev = radeon_get_rdev(bdev);
  	struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(rdev, ttm);
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
  	if (gtt && gtt->userptr) {
  		ttm->sg = kzalloc(sizeof(struct sg_table), GFP_KERNEL);
  		if (!ttm->sg)
  			return -ENOMEM;
 
-		ttm->page_flags |= TTM_PAGE_FLAG_SG;
+		ttm->page_flags |= TTM_PAGE_FLAG_EXTERNAL;
  		return 0;
  	}
 
@@ -569,13 +569,13 @@ static void radeon_ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm
  {
  	struct radeon_device *rdev = radeon_get_rdev(bdev);
  	struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(rdev, ttm);
-	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
+	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL);
 
  	radeon_ttm_tt_unbind(bdev, ttm);
 
  	if (gtt && gtt->userptr) {
  		kfree(ttm->sg);
-		ttm->page_flags &= ~TTM_PAGE_FLAG_SG;
+		ttm->page_flags &= ~TTM_PAGE_FLAG_EXTERNAL;
  		return;
  	}
 
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index 3b22c0013dbf..642dc7ce3081 100644
@@ -1115,7 +1115,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
  		return -EBUSY;
 
  	if (!bo->ttm || !ttm_tt_is_populated(bo->ttm) ||
-	    bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
+	    bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL ||
  	    bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED ||
  	    !ttm_bo_get_unless_zero(bo)) {
  		if (locked)
drivers/gpu/drm/ttm/ttm_bo_vm.c +1 -1
index 906ec8a1bf5a..708390588c7c 100644
@@ -162,7 +162,7 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
  	 * Refuse to fault imported pages. This should be handled
  	 * (if at all) by redirecting mmap to the exporter.
  	 */
-	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
  		dma_resv_unlock(bo->base.resv);
  		return VM_FAULT_SIGBUS;
  	}
drivers/gpu/drm/ttm/ttm_tt.c +5 -5
index 980ecb079b2c..9c586b613737 100644
@@ -73,7 +73,7 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
  	case ttm_bo_type_kernel:
  		break;
  	case ttm_bo_type_sg:
-		page_flags |= TTM_PAGE_FLAG_SG;
+		page_flags |= TTM_PAGE_FLAG_EXTERNAL;
  		break;
  	default:
  		pr_err("Illegal buffer object type\n");
@@ -178,7 +178,7 @@ int ttm_sg_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
 
  	ttm_tt_init_fields(ttm, bo, page_flags, caching);
 
-	if (page_flags & TTM_PAGE_FLAG_SG)
+	if (page_flags & TTM_PAGE_FLAG_EXTERNAL)
  		ret = ttm_sg_tt_alloc_page_directory(ttm);
  	else
  		ret = ttm_dma_tt_alloc_page_directory(ttm);
@@ -300,7 +300,7 @@ int ttm_tt_populate(struct ttm_device *bdev,
  	if (ttm_tt_is_populated(ttm))
  		return 0;
 
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
  		atomic_long_add(ttm->num_pages, &ttm_pages_allocated);
  		if (bdev->pool.use_dma32)
  			atomic_long_add(ttm->num_pages,
@@ -337,7 +337,7 @@ int ttm_tt_populate(struct ttm_device *bdev,
  	return 0;
 
  error:
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
  		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
  		if (bdev->pool.use_dma32)
  			atomic_long_sub(ttm->num_pages,
@@ -357,7 +357,7 @@ void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
  	else
  		ttm_pool_free(&bdev->pool, ttm);
 
-	if (!(ttm->page_flags & TTM_PAGE_FLAG_SG)) {
+	if (!(ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
  		atomic_long_sub(ttm->num_pages, &ttm_pages_allocated);
  		if (bdev->pool.use_dma32)
  			atomic_long_sub(ttm->num_pages,
include/drm/ttm/ttm_tt.h +0 -0
index 842ce756213c..a6c284c21e72 100644

include/drm/ttm/ttm_tt.h struct ttm_resource; · line 43

Quoted 9 lines
include/drm/ttm/ttm_tt.h +3 -3
@@ -38,9 +38,9 @@ struct ttm_resource;
  struct ttm_buffer_object;
  struct ttm_operation_ctx;
 
-#define TTM_PAGE_FLAG_SWAPPED         (1 << 4)
-#define TTM_PAGE_FLAG_ZERO_ALLOC      (1 << 6)
-#define TTM_PAGE_FLAG_SG              (1 << 8)
+#define TTM_PAGE_FLAG_SWAPPED		(1 << 4)
+#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 6)
+#define TTM_PAGE_FLAG_EXTERNAL		(1 << 8)

While at it please renumber those and maybe also rename everything.

E.g. TTM_TT_FLAG_* instead of TTM_PAGE_FLAG_* since this really controls the TT object behavior.

Christian.

Quoted 3 lines
include/drm/ttm/ttm_tt.h +0 -0
  #define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
 
author reviewer
#7 lore raw

PATCH v3 5/12 drm/ttm: add some kernel-doc for TTM_PAGE_FLAG_*

In reply to Matthew Auld

Move it to inline kernel-doc, otherwise we can't add empty lines it seems. Also drop the kernel-doc for pages_list, which doesn't seem to exist, and get rid of all the strange holes.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 include/drm/ttm/ttm_tt.h | 57 ++++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 19 deletions(-)
include/drm/ttm/ttm_tt.h +38 -19
index a6c284c21e72..7f54a83c95ef 100644
@@ -38,35 +38,54 @@ struct ttm_resource;
 struct ttm_buffer_object;
 struct ttm_operation_ctx;
 
-#define TTM_PAGE_FLAG_SWAPPED		(1 << 4)
-#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 6)
-#define TTM_PAGE_FLAG_EXTERNAL		(1 << 8)
-
-#define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
-
 /**
- * struct ttm_tt
- *
- * @pages: Array of pages backing the data.
- * @page_flags: see TTM_PAGE_FLAG_*
- * @num_pages: Number of pages in the page array.
- * @sg: for SG objects via dma-buf
- * @dma_address: The DMA (bus) addresses of the pages
- * @swap_storage: Pointer to shmem struct file for swap storage.
- * @pages_list: used by some page allocation backend
- * @caching: The current caching state of the pages, see enum ttm_caching.
- *
- * This is a structure holding the pages, caching- and aperture binding
- * status for a buffer object that isn't backed by fixed (VRAM / AGP)
+ * struct ttm_tt - This is a structure holding the pages, caching- and aperture
+ * binding status for a buffer object that isn't backed by fixed (VRAM / AGP)
  * memory.
  */
 struct ttm_tt {
+	/** @pages: Array of pages backing the data. */
 	struct page **pages;
+	/**
+	 * @page_flags: The page flags.
+	 *
+	 * Supported values:
+	 *
+	 * TTM_PAGE_FLAG_SWAPPED: Set if the pages have been swapped out.
+	 * Calling ttm_tt_populate() will swap the pages back in, and unset the
+	 * flag.
+	 *
+	 * TTM_PAGE_FLAG_ZERO_ALLOC: Set if the pages will be zeroed on
+	 * allocation.
+	 *
+	 * TTM_PAGE_FLAG_EXTERNAL: Set if the underlying pages were allocated
+	 * externally, like with dma-buf or userptr. This effectively disables
+	 * TTM swapping out such pages.  Also important is to prevent TTM from
+	 * ever directly mapping these pages.
+	 *
+	 * Note that enum ttm_bo_type.ttm_bo_type_sg objects will always enable
+	 * this flag.
+	 *
+	 * TTM_PAGE_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE.
+	 */
+#define TTM_PAGE_FLAG_SWAPPED		(1 << 0)
+#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 1)
+#define TTM_PAGE_FLAG_EXTERNAL		(1 << 2)
+
+#define TTM_PAGE_FLAG_PRIV_POPULATED	(1 << 31)
 	uint32_t page_flags;
+	/** @num_pages: Number of pages in the page array. */
 	uint32_t num_pages;
+	/** @sg: for SG objects via dma-buf. */
 	struct sg_table *sg;
+	/** @dma_address: The DMA (bus) addresses of the pages. */
 	dma_addr_t *dma_address;
+	/** @swap_storage: Pointer to shmem struct file for swap storage. */
 	struct file *swap_storage;
+	/**
+	 * @caching: The current caching state of the pages, see enum
+	 * ttm_caching.
+	 */
 	enum ttm_caching caching;
 };
 
Signature · 1 line
2.26.3
maintainer
#8 lore raw

Re: [PATCH v3 05/12] drm/ttm: add some kernel-doc for TTM_PAGE_FLAG_*

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 3 lines

Move it to inline kernel-doc, otherwise we can't add empty lines it seems. Also drop the kernel-doc for pages_list, which doesn't seem to exist, and get rid of all the strange holes.

As suggested on the other patch I would do the rename and renumbering in there and only the documentation change here.

Christian.

Quoted 86 lines
Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
  include/drm/ttm/ttm_tt.h | 57 ++++++++++++++++++++++++++--------------
  1 file changed, 38 insertions(+), 19 deletions(-)
include/drm/ttm/ttm_tt.h +38 -19
index a6c284c21e72..7f54a83c95ef 100644
@@ -38,35 +38,54 @@ struct ttm_resource;
  struct ttm_buffer_object;
  struct ttm_operation_ctx;
 
-#define TTM_PAGE_FLAG_SWAPPED		(1 << 4)
-#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 6)
-#define TTM_PAGE_FLAG_EXTERNAL		(1 << 8)
-
-#define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
-
  /**
- * struct ttm_tt
- *
- * @pages: Array of pages backing the data.
- * @page_flags: see TTM_PAGE_FLAG_*
- * @num_pages: Number of pages in the page array.
- * @sg: for SG objects via dma-buf
- * @dma_address: The DMA (bus) addresses of the pages
- * @swap_storage: Pointer to shmem struct file for swap storage.
- * @pages_list: used by some page allocation backend
- * @caching: The current caching state of the pages, see enum ttm_caching.
- *
- * This is a structure holding the pages, caching- and aperture binding
- * status for a buffer object that isn't backed by fixed (VRAM / AGP)
+ * struct ttm_tt - This is a structure holding the pages, caching- and aperture
+ * binding status for a buffer object that isn't backed by fixed (VRAM / AGP)
   * memory.
   */
  struct ttm_tt {
+	/** @pages: Array of pages backing the data. */
  	struct page **pages;
+	/**
+	 * @page_flags: The page flags.
+	 *
+	 * Supported values:
+	 *
+	 * TTM_PAGE_FLAG_SWAPPED: Set if the pages have been swapped out.
+	 * Calling ttm_tt_populate() will swap the pages back in, and unset the
+	 * flag.
+	 *
+	 * TTM_PAGE_FLAG_ZERO_ALLOC: Set if the pages will be zeroed on
+	 * allocation.
+	 *
+	 * TTM_PAGE_FLAG_EXTERNAL: Set if the underlying pages were allocated
+	 * externally, like with dma-buf or userptr. This effectively disables
+	 * TTM swapping out such pages.  Also important is to prevent TTM from
+	 * ever directly mapping these pages.
+	 *
+	 * Note that enum ttm_bo_type.ttm_bo_type_sg objects will always enable
+	 * this flag.
+	 *
+	 * TTM_PAGE_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE.
+	 */
+#define TTM_PAGE_FLAG_SWAPPED		(1 << 0)
+#define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 1)
+#define TTM_PAGE_FLAG_EXTERNAL		(1 << 2)
+
+#define TTM_PAGE_FLAG_PRIV_POPULATED	(1 << 31)
  	uint32_t page_flags;
+	/** @num_pages: Number of pages in the page array. */
  	uint32_t num_pages;
+	/** @sg: for SG objects via dma-buf. */
  	struct sg_table *sg;
+	/** @dma_address: The DMA (bus) addresses of the pages. */
  	dma_addr_t *dma_address;
+	/** @swap_storage: Pointer to shmem struct file for swap storage. */
  	struct file *swap_storage;
+	/**
+	 * @caching: The current caching state of the pages, see enum
+	 * ttm_caching.
+	 */
  	enum ttm_caching caching;
  };
 
author reviewer
#9 lore raw

PATCH v3 6/12 drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE

In reply to Matthew Auld

In commit:

commit 667a50db0477d47fdff01c666f5ee1ce26b5264c

Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:17:18 2014 +0100

drm/ttm: Refuse to fault (prime-) imported pages

we introduced the restriction that imported pages should not be directly mappable through TTM(this also extends to userptr). In the next patch we want to introduce a shmem_tt backend, which should follow all the existing rules with TTM_PAGE_FLAG_EXTERNAL, since it will need to handle swapping itself, but with the above mapping restriction lifted.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++--
 include/drm/ttm/ttm_tt.h        | 7 +++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +4 -2
index 708390588c7c..fd6e18f12f50 100644
@@ -163,8 +163,10 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
 	 * (if at all) by redirecting mmap to the exporter.
 	 */
 	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
-		dma_resv_unlock(bo->base.resv);
-		return VM_FAULT_SIGBUS;
+		if (!(bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)) {
+			dma_resv_unlock(bo->base.resv);
+			return VM_FAULT_SIGBUS;
+		}
 	}
 
 	return 0;
include/drm/ttm/ttm_tt.h +7 -0
index 7f54a83c95ef..800c9edb3e10 100644
@@ -66,11 +66,18 @@ struct ttm_tt {
 	 * Note that enum ttm_bo_type.ttm_bo_type_sg objects will always enable
 	 * this flag.
 	 *
+	 * TTM_PAGE_FLAG_EXTERNAL_MAPPABLE: Same behaviour as
+	 * TTM_PAGE_FLAG_EXTERNAL, but with the reduced restriction that it is
+	 * still valid to use TTM to map the pages directly. This is useful when
+	 * implementing a ttm_tt backend which still allocates driver owned
+	 * pages underneath(say with shmem).
+	 *
 	 * TTM_PAGE_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE.
 	 */
 #define TTM_PAGE_FLAG_SWAPPED		(1 << 0)
 #define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 1)
 #define TTM_PAGE_FLAG_EXTERNAL		(1 << 2)
+#define TTM_PAGE_FLAG_EXTERNAL_MAPPABLE	(1 << 3 | TTM_PAGE_FLAG_EXTERNAL)
 
 #define TTM_PAGE_FLAG_PRIV_POPULATED	(1 << 31)
 	uint32_t page_flags;
Signature · 1 line
2.26.3
maintainer
#10 lore raw

Re: [PATCH v3 06/12] drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 49 lines

In commit:

commit 667a50db0477d47fdff01c666f5ee1ce26b5264c

Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:17:18 2014 +0100

drm/ttm: Refuse to fault (prime-) imported pages

we introduced the restriction that imported pages should not be directly mappable through TTM(this also extends to userptr). In the next patch we want to introduce a shmem_tt backend, which should follow all the existing rules with TTM_PAGE_FLAG_EXTERNAL, since it will need to handle swapping itself, but with the above mapping restriction lifted.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
  drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++--
  include/drm/ttm/ttm_tt.h        | 7 +++++++
  2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +4 -2
index 708390588c7c..fd6e18f12f50 100644
@@ -163,8 +163,10 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
  	 * (if at all) by redirecting mmap to the exporter.
  	 */
  	if (bo->ttm && (bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL)) {
-		dma_resv_unlock(bo->base.resv);
-		return VM_FAULT_SIGBUS;
+		if (!(bo->ttm->page_flags & TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)) {
+			dma_resv_unlock(bo->base.resv);
+			return VM_FAULT_SIGBUS;
+		}
  	}
 
  	return 0;
include/drm/ttm/ttm_tt.h +2 -0
index 7f54a83c95ef..800c9edb3e10 100644
@@ -66,11 +66,18 @@ struct ttm_tt {
  	 * Note that enum ttm_bo_type.ttm_bo_type_sg objects will always enable
  	 * this flag.
  	 *
+	 * TTM_PAGE_FLAG_EXTERNAL_MAPPABLE: Same behaviour as
+	 * TTM_PAGE_FLAG_EXTERNAL, but with the reduced restriction that it is

include/drm/ttm/ttm_tt.h struct ttm_tt { · line 80

Quoted 10 lines
include/drm/ttm/ttm_tt.h +5 -0
+	 * still valid to use TTM to map the pages directly. This is useful when
+	 * implementing a ttm_tt backend which still allocates driver owned
+	 * pages underneath(say with shmem).
+	 *
  	 * TTM_PAGE_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE.
  	 */
  #define TTM_PAGE_FLAG_SWAPPED		(1 << 0)
  #define TTM_PAGE_FLAG_ZERO_ALLOC	(1 << 1)
  #define TTM_PAGE_FLAG_EXTERNAL		(1 << 2)
+#define TTM_PAGE_FLAG_EXTERNAL_MAPPABLE	(1 << 3 | TTM_PAGE_FLAG_EXTERNAL)

That's really bad practice because an "if (!(flags & TTM_PAGE_FLAG_EXTERNAL_MAPPABLE))" has a different semantics as an "if (flags & TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)".

Rather add a TTM_PAGE_FLAG_UNMAPPABLE and make sure that it is set as appropriated.

Regards,
Christian.

Quoted 3 lines
include/drm/ttm/ttm_tt.h +0 -0
  #define TTM_PAGE_FLAG_PRIV_POPULATED	(1 << 31)
  	uint32_t page_flags;
#11 lore raw

Re: [PATCH v3 06/12] drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE

Quoted 28 lines · Christian König

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 25 lines

In commit:

commit 667a50db0477d47fdff01c666f5ee1ce26b5264c
Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:17:18 2014 +0100

     drm/ttm: Refuse to fault (prime-) imported pages

we introduced the restriction that imported pages should not be directly
mappable through TTM(this also extends to userptr). In the next patch we
want to introduce a shmem_tt backend, which should follow all the existing rules with TTM_PAGE_FLAG_EXTERNAL, since it will need to handle
swapping itself, but with the above mapping restriction lifted.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>

---
  drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++--
  include/drm/ttm/ttm_tt.h        | 7 +++++++

  2 files changed, 11 insertions(+), 2 deletions(-)
Quoted 15 lines
Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +0 -0
index 708390588c7c..fd6e18f12f50 100644
@@ -163,8 +163,10 @@ vm_fault_t ttm_bo_vm_reserve(struct
 ttm_buffer_object *bo,
          * (if at all) by redirecting mmap to the exporter.
          */
Quoted 6 lines

        if (bo->ttm && (bo->ttm->page_flags &
TTM_PAGE_FLAG_EXTERNAL)) {
-               dma_resv_unlock(bo->base.resv);
-               return VM_FAULT_SIGBUS;
+               if (!(bo->ttm->page_flags &
TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)) {

I saw there was previously a thought about testing for ttm_bo_type_sg here. Was that a dead end?

Thanks,
Thomas

author reviewer
#12 lore raw

Re: [PATCH v3 06/12] drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE

Quoted 39 lines · Thomas Hellström
Quoted 38 lines · Christian König

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 35 lines

In commit:

commit 667a50db0477d47fdff01c666f5ee1ce26b5264c
Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:17:18 2014 +0100

     drm/ttm: Refuse to fault (prime-) imported pages

we introduced the restriction that imported pages should not be directly
mappable through TTM(this also extends to userptr). In the next patch we
want to introduce a shmem_tt backend, which should follow all the existing rules with TTM_PAGE_FLAG_EXTERNAL, since it will need to handle
swapping itself, but with the above mapping restriction lifted.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
   drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++--
   include/drm/ttm/ttm_tt.h        | 7 +++++++
   2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +0 -0
index 708390588c7c..fd6e18f12f50 100644
@@ -163,8 +163,10 @@ vm_fault_t ttm_bo_vm_reserve(struct
 ttm_buffer_object *bo,
          * (if at all) by redirecting mmap to the exporter.
          */
         if (bo->ttm && (bo->ttm->page_flags &
Quoted 8 lines
Quoted 5 lines

drivers/gpu/drm/ttm/ttm_bo_vm.c vm_fault_t ttm_bo_vm_reserve(struct · line 169

Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +1 -2
 TTM_PAGE_FLAG_EXTERNAL)) {
-               dma_resv_unlock(bo->base.resv);
-               return VM_FAULT_SIGBUS;
+               if (!(bo->ttm->page_flags &
 TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)) {

I saw there was previously a thought about testing for ttm_bo_type_sg here. Was that a dead end?

I guess the issue was userptr, which is also EXTERNAL and needs to be rejected here, but underneath it's not type_sg.

Just having an explicit MAPPABLE flag or similar seemed the more flexible approach? Happy to try out other ideas.

Quoted 5 lines

Thanks,
Thomas

#13 lore raw

Re: [PATCH v3 06/12] drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE

Quoted 49 lines · Matthew Auld
Quoted 39 lines · Thomas Hellström
Quoted 38 lines · Christian König

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 35 lines

In commit:

commit 667a50db0477d47fdff01c666f5ee1ce26b5264c
Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:17:18 2014 +0100

      drm/ttm: Refuse to fault (prime-) imported pages

we introduced the restriction that imported pages should not be directly
mappable through TTM(this also extends to userptr). In the next patch we
want to introduce a shmem_tt backend, which should follow all the existing rules with TTM_PAGE_FLAG_EXTERNAL, since it will need to handle
swapping itself, but with the above mapping restriction lifted.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>

---
   drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++--
   include/drm/ttm/ttm_tt.h        | 7 +++++++

   2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +0 -0
index 708390588c7c..fd6e18f12f50 100644
@@ -163,8 +163,10 @@ vm_fault_t ttm_bo_vm_reserve(struct
 ttm_buffer_object *bo,
           * (if at all) by redirecting mmap to the exporter.
           */

         if (bo->ttm && (bo->ttm->page_flags &

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

TTM_PAGE_FLAG_EXTERNAL)) {
-               dma_resv_unlock(bo->base.resv);
-               return VM_FAULT_SIGBUS;
+               if (!(bo->ttm->page_flags &
TTM_PAGE_FLAG_EXTERNAL_MAPPABLE)) {

I saw there was previously a thought about testing for ttm_bo_type_sg here. Was that a dead end?

Quoted 1 line

I guess the issue was userptr, which is also EXTERNAL and needs to be rejected here, but underneath it's not type_sg.

OK, I thought userptr was using type_sg. I wonder what it's for if that's not the case...

Quoted 3 lines

Just having an explicit MAPPABLE flag or similar seemed the more flexible approach? Happy to try out other ideas.

I'm fine with a flag as well.

/Thomas

author reviewer
#14 lore raw

PATCH v3 7/12 drm/i915/gem: Break out some shmem backend utils

In reply to Matthew Auld

From: Thomas Hellström <[email protected]>

Break out some shmem backend utils for future reuse by the TTM backend:
shmem_alloc_st(), shmem_free_st() and __shmem_writeback() which we can use to provide a shmem-backed TTM page pool for cached-only TTM buffer objects.

Main functional change here is that we now compute the page sizes using the dma segments rather than using the physical page address segments.

v2(Reported-by: kernel test robot <[email protected]>)
- Make sure we initialise the mapping on the error path in shmem_get_pages()

---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 181 +++++++++++++---------
 1 file changed, 106 insertions(+), 75 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +106 -75
index 11f072193f3b..36b711ae9e28 100644
@@ -25,46 +25,61 @@ static void check_release_pagevec(struct pagevec *pvec)
 	cond_resched();
 }
 
-static int shmem_get_pages(struct drm_i915_gem_object *obj)
+static void shmem_free_st(struct sg_table *st, struct address_space *mapping,
+			  bool dirty, bool backup)
 {
-	struct drm_i915_private *i915 = to_i915(obj->base.dev);
-	struct intel_memory_region *mem = obj->mm.region;
-	const unsigned long page_count = obj->base.size / PAGE_SIZE;
+	struct sgt_iter sgt_iter;
+	struct pagevec pvec;
+	struct page *page;
+
+	mapping_clear_unevictable(mapping);
+
+	pagevec_init(&pvec);
+	for_each_sgt_page(page, sgt_iter, st) {
+		if (dirty)
+			set_page_dirty(page);
+
+		if (backup)
+			mark_page_accessed(page);
+
+		if (!pagevec_add(&pvec, page))
+			check_release_pagevec(&pvec);
+	}
+	if (pagevec_count(&pvec))
+		check_release_pagevec(&pvec);
+
+	sg_free_table(st);
+	kfree(st);
+}
+
+static struct sg_table *shmem_alloc_st(struct drm_i915_private *i915,
+				       size_t size, struct intel_memory_region *mr,
+				       struct address_space *mapping,
+				       unsigned int max_segment)
+{
+	const unsigned long page_count = size / PAGE_SIZE;
 	unsigned long i;
-	struct address_space *mapping;
 	struct sg_table *st;
 	struct scatterlist *sg;
-	struct sgt_iter sgt_iter;
 	struct page *page;
 	unsigned long last_pfn = 0;	/* suppress gcc warning */
-	unsigned int max_segment = i915_sg_segment_size();
-	unsigned int sg_page_sizes;
 	gfp_t noreclaim;
 	int ret;
 
-	/*
-	 * Assert that the object is not currently in any GPU domain. As it
-	 * wasn't in the GTT, there shouldn't be any way it could have been in
-	 * a GPU cache
-	 */
-	GEM_BUG_ON(obj->read_domains & I915_GEM_GPU_DOMAINS);
-	GEM_BUG_ON(obj->write_domain & I915_GEM_GPU_DOMAINS);
-
 	/*
 	 * If there's no chance of allocating enough pages for the whole
 	 * object, bail early.
 	 */
-	if (obj->base.size > resource_size(&mem->region))
-		return -ENOMEM;
+	if (size > resource_size(&mr->region))
+		return ERR_PTR(-ENOMEM);
 
 	st = kmalloc(sizeof(*st), GFP_KERNEL);
 	if (!st)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
-rebuild_st:
 	if (sg_alloc_table(st, page_count, GFP_KERNEL)) {
 		kfree(st);
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 	}
 
 	/*
@@ -73,14 +88,12 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 	 *
 	 * Fail silently without starting the shrinker
 	 */
-	mapping = obj->base.filp->f_mapping;
 	mapping_set_unevictable(mapping);
 	noreclaim = mapping_gfp_constraint(mapping, ~__GFP_RECLAIM);
 	noreclaim |= __GFP_NORETRY | __GFP_NOWARN;
 
 	sg = st->sgl;
 	st->nents = 0;
-	sg_page_sizes = 0;
 	for (i = 0; i < page_count; i++) {
 		const unsigned int shrink[] = {
 			I915_SHRINK_BOUND | I915_SHRINK_UNBOUND,
@@ -135,10 +148,9 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 		if (!i ||
 		    sg->length >= max_segment ||
 		    page_to_pfn(page) != last_pfn + 1) {
-			if (i) {
-				sg_page_sizes |= sg->length;
+			if (i)
 				sg = sg_next(sg);
-			}
+
 			st->nents++;
 			sg_set_page(sg, page, PAGE_SIZE, 0);
 		} else {
@@ -149,14 +161,65 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 		/* Check that the i965g/gm workaround works. */
 		GEM_BUG_ON(gfp & __GFP_DMA32 && last_pfn >= 0x00100000UL);
 	}
-	if (sg) { /* loop terminated early; short sg table */
-		sg_page_sizes |= sg->length;
+	if (sg) /* loop terminated early; short sg table */
 		sg_mark_end(sg);
-	}
 
 	/* Trim unused sg entries to avoid wasting memory. */
 	i915_sg_trim(st);
 
+	return st;
+err_sg:
+	sg_mark_end(sg);
+	if (sg != st->sgl) {
+		shmem_free_st(st, mapping, false, false);
+	} else {
+		mapping_clear_unevictable(mapping);
+		sg_free_table(st);
+		kfree(st);
+	}
+
+	/*
+	 * shmemfs first checks if there is enough memory to allocate the page
+	 * and reports ENOSPC should there be insufficient, along with the usual
+	 * ENOMEM for a genuine allocation failure.
+	 *
+	 * We use ENOSPC in our driver to mean that we have run out of aperture
+	 * space and so want to translate the error from shmemfs back to our
+	 * usual understanding of ENOMEM.
+	 */
+	if (ret == -ENOSPC)
+		ret = -ENOMEM;
+
+	return ERR_PTR(ret);
+}
+
+static int shmem_get_pages(struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *i915 = to_i915(obj->base.dev);
+	struct intel_memory_region *mem = obj->mm.region;
+	struct address_space *mapping = obj->base.filp->f_mapping;
+	const unsigned long page_count = obj->base.size / PAGE_SIZE;
+	unsigned int max_segment = i915_sg_segment_size();
+	struct sg_table *st;
+	struct sgt_iter sgt_iter;
+	struct page *page;
+	int ret;
+
+	/*
+	 * Assert that the object is not currently in any GPU domain. As it
+	 * wasn't in the GTT, there shouldn't be any way it could have been in
+	 * a GPU cache
+	 */
+	GEM_BUG_ON(obj->read_domains & I915_GEM_GPU_DOMAINS);
+	GEM_BUG_ON(obj->write_domain & I915_GEM_GPU_DOMAINS);
+
+rebuild_st:
+	st = shmem_alloc_st(i915, obj->base.size, mem, mapping, max_segment);
+	if (IS_ERR(st)) {
+		ret = PTR_ERR(st);
+		goto err_st;
+	}
+
 	ret = i915_gem_gtt_prepare_pages(obj, st);
 	if (ret) {
 		/*
@@ -168,6 +231,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 			for_each_sgt_page(page, sgt_iter, st)
 				put_page(page);
 			sg_free_table(st);
+			kfree(st);
 
 			max_segment = PAGE_SIZE;
 			goto rebuild_st;
@@ -200,28 +264,12 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 	if (IS_JSL_EHL(i915) && obj->flags & I915_BO_ALLOC_USER)
 		obj->cache_dirty = true;
 
-	__i915_gem_object_set_pages(obj, st, sg_page_sizes);
+	__i915_gem_object_set_pages(obj, st, i915_sg_dma_sizes(st->sgl));
 
 	return 0;
 
-err_sg:
-	sg_mark_end(sg);
 err_pages:
-	mapping_clear_unevictable(mapping);
-	if (sg != st->sgl) {
-		struct pagevec pvec;
-
-		pagevec_init(&pvec);
-		for_each_sgt_page(page, sgt_iter, st) {
-			if (!pagevec_add(&pvec, page))
-				check_release_pagevec(&pvec);
-		}
-		if (pagevec_count(&pvec))
-			check_release_pagevec(&pvec);
-	}
-	sg_free_table(st);
-	kfree(st);
-
+	shmem_free_st(st, mapping, false, false);
 	/*
 	 * shmemfs first checks if there is enough memory to allocate the page
 	 * and reports ENOSPC should there be insufficient, along with the usual
@@ -231,6 +279,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
 	 * space and so want to translate the error from shmemfs back to our
 	 * usual understanding of ENOMEM.
 	 */
+err_st:
 	if (ret == -ENOSPC)
 		ret = -ENOMEM;
 
@@ -251,10 +300,8 @@ shmem_truncate(struct drm_i915_gem_object *obj)
 	obj->mm.pages = ERR_PTR(-EFAULT);
 }
 
-static void
-shmem_writeback(struct drm_i915_gem_object *obj)
+static void __shmem_writeback(size_t size, struct address_space *mapping)
 {
-	struct address_space *mapping;
 	struct writeback_control wbc = {
 		.sync_mode = WB_SYNC_NONE,
 		.nr_to_write = SWAP_CLUSTER_MAX,
@@ -270,10 +317,9 @@ shmem_writeback(struct drm_i915_gem_object *obj)
 	 * instead of invoking writeback so they are aged and paged out
 	 * as normal.
 	 */
-	mapping = obj->base.filp->f_mapping;
 
 	/* Begin writeback on each dirty page */
-	for (i = 0; i < obj->base.size >> PAGE_SHIFT; i++) {
+	for (i = 0; i < size >> PAGE_SHIFT; i++) {
 		struct page *page;
 
 		page = find_lock_page(mapping, i);
@@ -296,6 +342,12 @@ shmem_writeback(struct drm_i915_gem_object *obj)
 	}
 }
 
+static void
+shmem_writeback(struct drm_i915_gem_object *obj)
+{
+	__shmem_writeback(obj->base.size, obj->base.filp->f_mapping);
+}
+
 void
 __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
 				struct sg_table *pages,
@@ -316,11 +368,6 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
 
 void i915_gem_object_put_pages_shmem(struct drm_i915_gem_object *obj, struct sg_table *pages)
 {
-	struct sgt_iter sgt_iter;
-	struct pagevec pvec;
-	struct page *page;
-
-	GEM_WARN_ON(IS_DGFX(to_i915(obj->base.dev)));
 	__i915_gem_object_release_shmem(obj, pages, true);
 
 	i915_gem_gtt_finish_pages(obj, pages);
@@ -328,25 +375,9 @@ void i915_gem_object_put_pages_shmem(struct drm_i915_gem_object *obj, struct sg_
 	if (i915_gem_object_needs_bit17_swizzle(obj))
 		i915_gem_object_save_bit_17_swizzle(obj, pages);
 
-	mapping_clear_unevictable(file_inode(obj->base.filp)->i_mapping);
-
-	pagevec_init(&pvec);
-	for_each_sgt_page(page, sgt_iter, pages) {
-		if (obj->mm.dirty)
-			set_page_dirty(page);
-
-		if (obj->mm.madv == I915_MADV_WILLNEED)
-			mark_page_accessed(page);
-
-		if (!pagevec_add(&pvec, page))
-			check_release_pagevec(&pvec);
-	}
-	if (pagevec_count(&pvec))
-		check_release_pagevec(&pvec);
+	shmem_free_st(pages, file_inode(obj->base.filp)->i_mapping,
+		      obj->mm.dirty, obj->mm.madv == I915_MADV_WILLNEED);
 	obj->mm.dirty = false;
-
-	sg_free_table(pages);
-	kfree(pages);
 }
 
 static void
Signature · 1 line
2.26.3
author reviewer
#15 lore raw

PATCH v3 8/12 drm/i915/ttm: add tt shmem backend

In reply to Matthew Auld

For cached objects we can allocate our pages directly in shmem. This should make it possible(in a later patch) to utilise the existing i915-gem shrinker code for such objects. For now this is still disabled.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h |   8 +
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c  |  14 +-
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c    | 217 ++++++++++++++++++---
 3 files changed, 209 insertions(+), 30 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.h +8 -0
index 48112b9d76df..561d6bd0a5c9 100644
@@ -618,6 +618,14 @@ int i915_gem_object_wait_migration(struct drm_i915_gem_object *obj,
 bool i915_gem_object_placement_possible(struct drm_i915_gem_object *obj,
 					enum intel_memory_type type);
 
+struct sg_table *shmem_alloc_st(struct drm_i915_private *i915,
+				size_t size, struct intel_memory_region *mr,
+				struct address_space *mapping,
+				unsigned int max_segment);
+void shmem_free_st(struct sg_table *st, struct address_space *mapping,
+		   bool dirty, bool backup);
+void __shmem_writeback(size_t size, struct address_space *mapping);
+
 #ifdef CONFIG_MMU_NOTIFIER
 static inline bool
 i915_gem_object_is_userptr(struct drm_i915_gem_object *obj)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +7 -7
index 36b711ae9e28..19e55cc29a15 100644
@@ -25,8 +25,8 @@ static void check_release_pagevec(struct pagevec *pvec)
 	cond_resched();
 }
 
-static void shmem_free_st(struct sg_table *st, struct address_space *mapping,
-			  bool dirty, bool backup)
+void shmem_free_st(struct sg_table *st, struct address_space *mapping,
+		   bool dirty, bool backup)
 {
 	struct sgt_iter sgt_iter;
 	struct pagevec pvec;
@@ -52,10 +52,10 @@ static void shmem_free_st(struct sg_table *st, struct address_space *mapping,
 	kfree(st);
 }
 
-static struct sg_table *shmem_alloc_st(struct drm_i915_private *i915,
-				       size_t size, struct intel_memory_region *mr,
-				       struct address_space *mapping,
-				       unsigned int max_segment)
+struct sg_table *shmem_alloc_st(struct drm_i915_private *i915,
+				size_t size, struct intel_memory_region *mr,
+				struct address_space *mapping,
+				unsigned int max_segment)
 {
 	const unsigned long page_count = size / PAGE_SIZE;
 	unsigned long i;
@@ -300,7 +300,7 @@ shmem_truncate(struct drm_i915_gem_object *obj)
 	obj->mm.pages = ERR_PTR(-EFAULT);
 }
 
-static void __shmem_writeback(size_t size, struct address_space *mapping)
+void __shmem_writeback(size_t size, struct address_space *mapping)
 {
 	struct writeback_control wbc = {
 		.sync_mode = WB_SYNC_NONE,
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +194 -23

320 lines not on this page · raw message

Signature · 1 line
2.26.3
#16 lore raw

Re: [PATCH v3 08/12] drm/i915/ttm: add tt shmem backend

Quoted 16 lines · Matthew Auld

For cached objects we can allocate our pages directly in shmem. This should make it possible(in a later patch) to utilise the existing i915-gem shrinker code for such objects. For now this is still disabled.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>

---
 drivers/gpu/drm/i915/gem/i915_gem_object.h |   8 + drivers/gpu/drm/i915/gem/i915_gem_shmem.c  |  14 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.c    | 217 ++++++++++++++++++- --

 3 files changed, 209 insertions(+), 30 deletions(-)

...

Quoted 10 lines

 }

drivers/gpu/drm/i915/gem/i915_gem_ttm.c +0 -0
@@ -223,6 +349,10 @@ static bool i915_ttm_eviction_valuable(struct
 ttm_buffer_object *bo,
  {
         struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);


+       if (place->mem_type == TTM_PL_SYSTEM &&
+           bo->ttm && bo->ttm->page_flags & I915_TTM_TT_SHMEM) +               return false;
+

Should we use ttm_bo_pin() / ttm_bo_unpin() to remove the bo from the TTM LRU lists when it's SHMEM populated, and change the above to a GEM_BUG_ON()?

Quoted 23 lines

        /* Will do for now. Our pinned objects are still on TTM's LRU lists */
        return i915_gem_object_evictable(obj);
 }

drivers/gpu/drm/i915/gem/i915_gem_ttm.c +0 -0
@@ -316,9 +446,11 @@ static void
 i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj)
         i915_gem_object_set_cache_coherency(obj, cache_level);
  }

drivers/gpu/drm/i915/gem/i915_gem_ttm.c +1 -1
-static void i915_ttm_purge(struct drm_i915_gem_object *obj)
+static void i915_ttm_writeback(struct drm_i915_gem_object *obj)

 {
        struct ttm_buffer_object *bo = i915_gem_to_ttm(obj); +       struct i915_ttm_tt *i915_tt =
+               container_of(bo->ttm, typeof(*i915_tt), ttm); struct ttm_operation_ctx ctx = { .interruptible = true,
                .no_wait_gpu = false,

drivers/gpu/drm/i915/gem/i915_gem_ttm.c +0 -0
@@ -326,18 +458,52 @@ static void i915_ttm_purge(struct
 drm_i915_gem_object *obj)
         struct ttm_placement place = {};
         int ret;

Quoted 8 lines

-       if (obj->mm.madv == __I915_MADV_PURGED)
+       if (!bo->ttm || !(bo->ttm->page_flags & I915_TTM_TT_SHMEM)) return;

-       /* TTM's purge interface. Note that we might be reentering. */
+       i915_tt->backup = true;
        ret = ttm_bo_validate(bo, &place, &ctx);

It looks like writeback() becomes the backend's primary callback for shrinking, although for the shmem backend, this is put_pages(), and the writeback() callback is only called if needed to accelerate shmem's transfer of pages to the swap cache. It appears like this will break the shrinker reporting of shrunken pages?

Should we try to do the primary shrinking from the put_pages() callback instead, like the shmem backend? Although we'd have to allow NULL pages in put_pages() to account for evicted-to-shmem and adjust other backends if necessary.

Quoted 13 lines

-       if (!ret) {
-               obj->write_domain = 0;
-               obj->read_domains = 0;
-               i915_ttm_adjust_gem_after_move(obj); -               i915_ttm_free_cached_io_st(obj); -               obj->mm.madv = __I915_MADV_PURGED; +       i915_tt->backup = false;
+       if (ret)
+               return;

drivers/gpu/drm/i915/gem/i915_gem_ttm.c +4 -0
+
+       __shmem_writeback(obj->base.size, i915_tt->filp->f_mapping);
+}
+
author reviewer
#17 lore raw

PATCH v3 9/12 drm/i915/ttm: use cached system pages when evicting lmem

In reply to Matthew Auld

This should let us do an accelerated copy directly to the shmem pages when temporarily moving lmem-only objects, where the i915-gem shrinker can later kick in to swap out the pages, if needed.

Cc Thomas Hellström <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +4 -4
index a93e3a9ef698..079a7a655ede 100644
@@ -126,11 +126,11 @@ static enum ttm_caching
 i915_ttm_select_tt_caching(const struct drm_i915_gem_object *obj)
 {
 	/*
-	 * Objects only allowed in system get cached cpu-mappings.
-	 * Other objects get WC mapping for now. Even if in system.
+	 * Objects only allowed in system get cached cpu-mappings, or when
+	 * evicting lmem-only buffers to system for swapping. Other objects get
+	 * WC mapping for now. Even if in system.
 	 */
-	if (obj->mm.region->type == INTEL_MEMORY_SYSTEM &&
-	    obj->mm.n_placements <= 1)
+	if (obj->mm.n_placements <= 1)
 		return ttm_cached;
 
 	return ttm_write_combined;
Signature · 1 line
2.26.3
author reviewer
#18 lore raw

PATCH v3 10/12 drm/i915: try to simplify make_{un}shrinkable

In reply to Matthew Auld

Drop the atomic shrink_pin stuff, and just have make_{un}shrinkable update the shrinker visible lists immediately. This at least simplifies the next patch, and does make the behaviour more obvious. The potential downside is that make_unshrinkable now grabs a global lock even when the object itself is no longer shrinkable(transitioning from purgeable <-> shrinkable doesn't seem to be a thing), for example in the ppGTT insertion paths we should now be careful not to needlessly call make_unshrinkable multiple times. Outside of that there is some fallout in intel_context which relies on nesting calls to shrink_pin.

Cc Thomas Hellström <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c    |  9 ----
 .../gpu/drm/i915/gem/i915_gem_object_types.h  |  3 +-
 drivers/gpu/drm/i915/gem/i915_gem_pages.c     | 16 +-----
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  | 52 +++++++++++++------
 drivers/gpu/drm/i915/gt/gen6_ppgtt.c          |  1 -
 drivers/gpu/drm/i915/gt/gen8_ppgtt.c          |  1 -
 drivers/gpu/drm/i915/gt/intel_context.c       |  9 +---
 7 files changed, 41 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -9
index 6fb9afb65034..e8265a432fcb 100644
@@ -305,15 +305,6 @@ static void i915_gem_free_object(struct drm_gem_object *gem_obj)
 	 */
 	atomic_inc(&i915->mm.free_count);
 
-	/*
-	 * This serializes freeing with the shrinker. Since the free
-	 * is delayed, first by RCU then by the workqueue, we want the
-	 * shrinker to be able to free pages of unreferenced objects,
-	 * or else we may oom whilst there are plenty of deferred
-	 * freed objects.
-	 */
-	i915_gem_object_make_unshrinkable(obj);
-
 	/*
 	 * Since we require blocking on struct_mutex to unbind the freed
 	 * object from the GPU before releasing resources back to the
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +1 -2
index 2471f36aaff3..a035ac26a090 100644
@@ -453,7 +453,6 @@ struct drm_i915_gem_object {
 		 * instead go through the pin/unpin interfaces.
 		 */
 		atomic_t pages_pin_count;
-		atomic_t shrink_pin;
 
 		/**
 		 * Priority list of potential placements for this object.
@@ -514,7 +513,7 @@ struct drm_i915_gem_object {
 		struct i915_gem_object_page_iter get_dma_page;
 
 		/**
-		 * Element within i915->mm.unbound_list or i915->mm.bound_list,
+		 * Element within i915->mm.shrink_list or i915->mm.purge_list,
 		 * locked by i915->mm.obj_lock.
 		 */
 		struct list_head link;
drivers/gpu/drm/i915/gem/i915_gem_pages.c +2 -14
index 8eb1c3a6fc9c..f0df1394d7f6 100644
@@ -64,28 +64,16 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
 		GEM_BUG_ON(i915_gem_object_has_tiling_quirk(obj));
 		i915_gem_object_set_tiling_quirk(obj);
 		GEM_BUG_ON(!list_empty(&obj->mm.link));
-		atomic_inc(&obj->mm.shrink_pin);
 		shrinkable = false;
 	}
 
 	if (shrinkable) {
-		struct list_head *list;
-		unsigned long flags;
-
 		assert_object_held(obj);
-		spin_lock_irqsave(&i915->mm.obj_lock, flags);
-
-		i915->mm.shrink_count++;
-		i915->mm.shrink_memory += obj->base.size;
 
 		if (obj->mm.madv != I915_MADV_WILLNEED)
-			list = &i915->mm.purge_list;
+			i915_gem_object_make_purgeable(obj);
 		else
-			list = &i915->mm.shrink_list;
-		list_add_tail(&obj->mm.link, list);
-
-		atomic_set(&obj->mm.shrink_pin, 0);
-		spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
+			i915_gem_object_make_shrinkable(obj);
 	}
 }
 
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +36 -16

87 lines not on this page · raw message

drivers/gpu/drm/i915/gt/gen6_ppgtt.c +0 -1
index 1aee5e6b1b23..dd5ebc1659cf 100644
@@ -185,7 +185,6 @@ static void gen6_alloc_va_range(struct i915_address_space *vm,
 
 			pt = stash->pt[0];
 			__i915_gem_object_pin_pages(pt->base);
-			i915_gem_object_make_unshrinkable(pt->base);
 
 			fill32_px(pt, vm->scratch[0]->encode);
 
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +0 -1
index 6a5af995f5b1..1b946978e377 100644
@@ -301,7 +301,6 @@ static void __gen8_ppgtt_alloc(struct i915_address_space * const vm,
 
 			pt = stash->pt[!!lvl];
 			__i915_gem_object_pin_pages(pt->base);
-			i915_gem_object_make_unshrinkable(pt->base);
 
 			fill_px(pt, vm->scratch[lvl]->encode);
 
drivers/gpu/drm/i915/gt/intel_context.c +2 -7
index ff637147b1a9..1b7dc57e6ec1 100644
@@ -111,11 +111,6 @@ static int __context_pin_state(struct i915_vma *vma, struct i915_gem_ww_ctx *ww)
 	if (err)
 		goto err_unpin;
 
-	/*
-	 * And mark it as a globally pinned object to let the shrinker know
-	 * it cannot reclaim the object until we release it.
-	 */
-	i915_vma_make_unshrinkable(vma);
 	vma->obj->mm.dirty = true;
 
 	return 0;
@@ -127,7 +122,6 @@ static int __context_pin_state(struct i915_vma *vma, struct i915_gem_ww_ctx *ww)
 
 static void __context_unpin_state(struct i915_vma *vma)
 {
-	i915_vma_make_shrinkable(vma);
 	i915_active_release(&vma->active);
 	__i915_vma_unpin(vma);
 }
@@ -180,7 +174,6 @@ static int intel_context_pre_pin(struct intel_context *ce,
 	if (err)
 		goto err_timeline;
 
-
 	return 0;
 
 err_timeline:
@@ -338,6 +331,8 @@ static void __intel_context_retire(struct i915_active *active)
 
 	set_bit(CONTEXT_VALID_BIT, &ce->flags);
 	intel_context_post_unpin(ce);
+	if (ce->state)
+		i915_vma_make_shrinkable(ce->state);
 	intel_context_put(ce);
 }
 
Signature · 1 line
2.26.3
author reviewer
#19 lore raw

PATCH v3 11/12 drm/i915/ttm: make evicted shmem pages visible to the shrinker

In reply to Matthew Auld

We currently just evict lmem objects to system memory when under memory pressure. For this case we lack the usual object mm.pages, which effectively hides the pages from the i915-gem shrinker, until we actually "attach" the TT to the object, or in the case of lmem-only objects it just gets migrated back to lmem when touched again. For such cases we can make the object visible as soon as we populate the TT with shmem pages, and then hide it again when doing the unpopulate.

Cc Thomas Hellström <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h   |  1 +
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 29 +++++++++++++++-----
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c      | 11 ++++++++
 3 files changed, 34 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.h +1 -0
index 561d6bd0a5c9..28b831c78c47 100644
@@ -540,6 +540,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 
 void i915_gem_object_make_unshrinkable(struct drm_i915_gem_object *obj);
 void i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj);
+void __i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj);
 void i915_gem_object_make_purgeable(struct drm_i915_gem_object *obj);
 
 static inline bool cpu_write_needs_clflush(struct drm_i915_gem_object *obj)
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +22 -7
index 6b38e4414c5a..02175e8ad069 100644
@@ -482,13 +482,12 @@ void i915_gem_object_make_unshrinkable(struct drm_i915_gem_object *obj)
 	spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
 }
 
-static void __i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj,
-					      struct list_head *head)
+static void ___i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj,
+					       struct list_head *head)
 {
 	struct drm_i915_private *i915 = obj_to_i915(obj);
 	unsigned long flags;
 
-	GEM_BUG_ON(!i915_gem_object_has_pages(obj));
 	if (!i915_gem_object_is_shrinkable(obj))
 		return;
 
@@ -507,6 +506,21 @@ static void __i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj,
 	spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
 }
 
+/**
+ * __i915_gem_object_make_shrinkable - Move the object to the tail of the
+ * shrinkable list. Objects on this list might be swapped out. Used with
+ * WILLNEED objects.
+ * @obj: The GEM object.
+ *
+ * DO NOT USE. This is intended to be called on very special objects that don't
+ * yet have mm.pages, but are guaranteed to have potentially reclaimable pages
+ * underneath.
+ */
+void __i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj)
+{
+	___i915_gem_object_make_shrinkable(obj,
+					   &obj_to_i915(obj)->mm.shrink_list);
+}
 
 /**
  * i915_gem_object_make_shrinkable - Move the object to the tail of the
@@ -518,8 +532,8 @@ static void __i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj,
  */
 void i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj)
 {
-	__i915_gem_object_make_shrinkable(obj,
-					  &obj_to_i915(obj)->mm.shrink_list);
+	GEM_BUG_ON(!i915_gem_object_has_pages(obj));
+	__i915_gem_object_make_shrinkable(obj);
 }
 
 /**
@@ -533,6 +547,7 @@ void i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj)
  */
 void i915_gem_object_make_purgeable(struct drm_i915_gem_object *obj)
 {
-	__i915_gem_object_make_shrinkable(obj,
-					  &obj_to_i915(obj)->mm.purge_list);
+	GEM_BUG_ON(!i915_gem_object_has_pages(obj));
+	___i915_gem_object_make_shrinkable(obj,
+					   &obj_to_i915(obj)->mm.purge_list);
 }
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +11 -0
index 079a7a655ede..e758de336b96 100644
@@ -234,6 +234,15 @@ static int i915_ttm_tt_shmem_populate(struct ttm_device *bdev,
 	if (ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
 		ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
 
+	/*
+	 * Even if we lack mm.pages for this object(which will be the case when
+	 * something is evicted to system memory by TTM), we still want to make
+	 * this object visible to the shrinker, since the underlying ttm_tt
+	 * still has the real shmem pages. When unpopulating the tt(possibly due
+	 * to shrinking) we hide it again from the shrinker.
+	 */
+	__i915_gem_object_make_shrinkable(obj);
+
 	i915_tt->cached_st = st;
 	return 0;
 
@@ -248,6 +257,8 @@ static void i915_ttm_tt_shmem_unpopulate(struct ttm_tt *ttm)
 	struct drm_i915_gem_object *obj = i915_tt->obj;
 	bool backup = i915_tt->backup;
 
+	i915_gem_object_make_unshrinkable(obj);
+
 	if (obj->mm.madv == I915_MADV_DONTNEED) {
 		obj->mm.dirty = false;
 		GEM_BUG_ON(backup);
Signature · 1 line
2.26.3
author reviewer
#20 lore raw

PATCH v3 12/12 drm/i915/ttm: enable shmem tt backend

In reply to Matthew Auld

Enable shmem tt backend, and enable shrinking.

Cc Thomas Hellström <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +1 -0
index e758de336b96..6199e8c067ff 100644
@@ -1050,6 +1050,7 @@ static u64 i915_ttm_mmap_offset(struct drm_i915_gem_object *obj)
 
 static const struct drm_i915_gem_object_ops i915_gem_ttm_obj_ops = {
 	.name = "i915_gem_object_ttm",
+	.flags = I915_GEM_OBJECT_IS_SHRINKABLE,
 
 	.get_pages = i915_ttm_get_pages,
 	.put_pages = i915_ttm_put_pages,
Signature · 1 line
2.26.3
#21 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt
URL : https://patchwork.freedesktop.org/series/94705/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
13d749649308 drm/ttm: stop setting page->index for the ttm_tt
-:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 58aa6622d32a ("drm/ttm: Correctly set page mapping and -index members")'
#11: 
commit 58aa6622d32af7d2c08d45085f44c54554a16ed7

total: 1 errors, 0 warnings, 0 checks, 19 lines checked
625b6c6d2e8a drm/ttm: move ttm_tt_{add, clear}_mapping into amdgpu
437d165efeea drm/ttm: remove TTM_PAGE_FLAG_NO_RETRY
7f778166b103 drm/ttm: s/FLAG_SG/FLAG_EXTERNAL/
d5ca5e74a3c8 drm/ttm: add some kernel-doc for TTM_PAGE_FLAG_*
fa296d488d3b drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE
-:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 667a50db0477 ("drm/ttm: Refuse to fault (prime-) imported pages")' #11:
commit 667a50db0477d47fdff01c666f5ee1ce26b5264c

total: 1 errors, 0 warnings, 0 checks, 30 lines checked fc851ac1bf9e drm/i915/gem: Break out some shmem backend utils 6ebd10cc602b drm/i915/ttm: add tt shmem backend 3674047745cb drm/i915/ttm: use cached system pages when evicting lmem de3f5e9a7e28 drm/i915: try to simplify make_{un}shrinkable -:164: CHECK:LINE_SPACING: Please don't use multiple blank lines #164: FILE: drivers/gpu/drm/i915/gem/i915_gem_shrinker.c:510:

+

total: 0 errors, 0 warnings, 1 checks, 194 lines checked 7b31a03b4172 drm/i915/ttm: make evicted shmem pages visible to the shrinker 7401d4e19fbe drm/i915/ttm: enable shmem tt backend

#22 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt
URL : https://patchwork.freedesktop.org/series/94705/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
-
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+./drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:316:49: error: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1345:25:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1346:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:1405:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:354:16: error: incompatible types in comparison expression (different type sizes):
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:354:16:    unsigned long *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:354:16:    unsigned long long *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4483:31: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4483:31:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4483:31:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4485:33: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4485:33:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4485:33:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:294:25: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:294:25:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:294:25:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:295:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:295:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:295:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:344:17: error: incompatible types in comparison expression (different address spaces):
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:344:17:    struct dma_fence *
+drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:344:17:    struct dma_fence [noderef] __rcu *
+drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c:117:1: warning: no newline at end of file
+drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:123:51: error: marked inline, but without a definition
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
+drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: error: static assertion failed: "amd_sriov_msg_vf2p
#23 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt
URL : https://patchwork.freedesktop.org/series/94705/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10593 -> Patchwork_21064
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_21064 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_21064, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_21064:

### IGT changes ###

#### Possible regressions ####

* igt@gem_exec_gttfill@basic:
- fi-kbl-8809g: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-kbl-8809g/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-8809g/igt@[email protected]

* igt@i915_module_load@reload:
- fi-icl-y: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-icl-y/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-icl-y/igt@[email protected]

#### Warnings ####

* igt@i915_module_load@reload:
- fi-cml-u2: [INCOMPLETE][5] ([i915#4136]) -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-cml-u2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cml-u2/igt@[email protected]
- fi-kbl-soraka: [INCOMPLETE][7] ([i915#4136]) -> [INCOMPLETE][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-kbl-soraka/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-soraka/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_module_load@reload:
- {fi-ehl-2}: [INCOMPLETE][9] ([i915#4136]) -> [INCOMPLETE][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-ehl-2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-ehl-2/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- {fi-jsl-1}: NOTRUN -> [INCOMPLETE][11]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-jsl-1/igt@[email protected]

* igt@runner@aborted:
- {fi-jsl-1}: NOTRUN -> [FAIL][12]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-jsl-1/igt@[email protected]

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

Here are the changes found in Patchwork_21064 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@cs-compute:
- fi-cfl-guc: NOTRUN -> [SKIP][13] ([fdo#109271]) +17 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cfl-guc/igt@amdgpu/[email protected]

* igt@amdgpu/amd_basic@cs-sdma:
- fi-kbl-7500u: NOTRUN -> [SKIP][14] ([fdo#109271]) +17 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-7500u/igt@amdgpu/[email protected]

* igt@amdgpu/amd_cs_nop@fork-gfx0:
- fi-icl-u2: NOTRUN -> [SKIP][15] ([fdo#109315]) +17 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-icl-u2/igt@amdgpu/[email protected]

* igt@core_hotunplug@unbind-rebind:
- fi-tgl-1115g4: NOTRUN -> [INCOMPLETE][16] ([i915#4130])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]
- fi-cfl-8700k: [PASS][17] -> [INCOMPLETE][18] ([i915#4130])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-cfl-8700k/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cfl-8700k/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-tgl-1115g4: NOTRUN -> [SKIP][19] ([i915#2190])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@i915_pm_backlight@basic-brightness:
- fi-tgl-1115g4: NOTRUN -> [SKIP][20] ([i915#1155])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-tgl-1115g4: NOTRUN -> [SKIP][21] ([fdo#111827]) +8 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-1115g4: NOTRUN -> [SKIP][22] ([i915#4103]) +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-1115g4: NOTRUN -> [SKIP][23] ([fdo#109285])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@kms_psr@primary_mmap_gtt:
- fi-tgl-1115g4: NOTRUN -> [SKIP][24] ([i915#1072]) +3 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@kms_psr@primary_mmap_gtt.html

* igt@prime_vgem@basic-userptr:
- fi-tgl-1115g4: NOTRUN -> [SKIP][25] ([i915#3301])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

* igt@runner@aborted:
- fi-kbl-8809g: NOTRUN -> [FAIL][26] ([i915#2426] / [i915#3363])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-8809g/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][27] ([i915#2426] / [i915#3363])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-guc/igt@[email protected]
- fi-cml-u2: NOTRUN -> [FAIL][28] ([i915#2082] / [i915#2426] / [i915#3363])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cml-u2/igt@[email protected]
- fi-tgl-1115g4: NOTRUN -> [FAIL][29] ([i915#1602] / [i915#2722])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-tgl-1115g4/igt@[email protected]

#### Possible fixes ####

* igt@core_hotunplug@unbind-rebind:
- fi-icl-u2: [INCOMPLETE][30] ([i915#4130]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-icl-u2/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-icl-u2/igt@[email protected]
- fi-kbl-7500u: [INCOMPLETE][32] ([i915#4130]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-kbl-7500u/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-7500u/igt@[email protected]

* igt@i915_module_load@reload:
- fi-cfl-guc: [INCOMPLETE][34] -> [PASS][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-cfl-guc/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cfl-guc/igt@[email protected]
- fi-cfl-8109u: [DMESG-WARN][36] ([i915#4136]) -> [PASS][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-cfl-8109u/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-cfl-8109u/igt@[email protected]

#### Warnings ####

* igt@i915_module_load@reload:
- fi-kbl-guc: [INCOMPLETE][38] -> [INCOMPLETE][39] ([i915#4136])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10593/fi-kbl-guc/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/fi-kbl-guc/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#2082]: https://gitlab.freedesktop.org/drm/intel/issues/2082
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2722]: https://gitlab.freedesktop.org/drm/intel/issues/2722
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4130]: https://gitlab.freedesktop.org/drm/intel/issues/4130
[i915#4136]: https://gitlab.freedesktop.org/drm/intel/issues/4136

Participating hosts (39 -> 37)
------------------------------

Additional (1): fi-tgl-1115g4
Missing (3): fi-bdw-samus fi-bsw-cyan bat-dg1-6

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

* Linux: CI_DRM_10593 -> Patchwork_21064

CI-20190529: 20190529
CI_DRM_10593: 6bc334de7baec4510b614dc80c330bf81fb8ca6f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6209: 07d6594ed02f55b68d64fa6dd7f80cfbc1ce4ef8 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_21064: 7401d4e19fbe0734cd45caefa8f9f445c7f29ab8 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

7401d4e19fbe drm/i915/ttm: enable shmem tt backend
7b31a03b4172 drm/i915/ttm: make evicted shmem pages visible to the shrinker de3f5e9a7e28 drm/i915: try to simplify make_{un}shrinkable 3674047745cb drm/i915/ttm: use cached system pages when evicting lmem 6ebd10cc602b drm/i915/ttm: add tt shmem backend
fc851ac1bf9e drm/i915/gem: Break out some shmem backend utils fa296d488d3b drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE d5ca5e74a3c8 drm/ttm: add some kernel-doc for TTM_PAGE_FLAG_* 7f778166b103 drm/ttm: s/FLAG_SG/FLAG_EXTERNAL/
437d165efeea drm/ttm: remove TTM_PAGE_FLAG_NO_RETRY 625b6c6d2e8a drm/ttm: move ttm_tt_{add, clear}_mapping into amdgpu 13d749649308 drm/ttm: stop setting page->index for the ttm_tt

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21064/index.html

maintainer Reviewed-by on v3 1/12
#24 lore raw
In reply to Matthew Auld

Am 15.09.21 um 20:59 schrieb Matthew Auld:

Quoted 19 lines

In commit:

commit 58aa6622d32af7d2c08d45085f44c54554a16ed7

Author: Thomas Hellstrom <[email protected]>
Date:   Fri Jan 3 11:47:23 2014 +0100

drm/ttm: Correctly set page mapping and -index members

we started setting the page->mapping and page->index to point to the virtual address space, if the pages were faulted with TTM. Apparently this was needed for core-mm to able to reverse lookup the virtual address given the struct page, and potentially unmap it from the page tables. However as pointed out by Thomas, since we are now using PFN_MAP, instead of say PFN_MIXED, this should no longer be the case.

There was also apparently some usecase in vmwgfx which needed this for dirty tracking, but that also doesn't appear to be the case anymore, as pointed out by Thomas.

Quoted 6 lines

We still need keep the page->mapping for now, since that is still needed for different reasons, but we try to address that in the next patch.

Cc Thomas Hellström <[email protected]>
Cc Christian König <[email protected]>

Fingers crossed that this really works as documented.

Quoted 34 lines
---
  drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 --
  drivers/gpu/drm/ttm/ttm_tt.c    | 4 +---
  2 files changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +0 -2
index f56be5bc0861..906ec8a1bf5a 100644
@@ -346,8 +346,6 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
  			} else if (unlikely(!page)) {
  				break;
  			}
-			page->index = drm_vma_node_start(&bo->base.vma_node) +
-				page_offset;
  			pfn = page_to_pfn(page);
  		}
 
drivers/gpu/drm/ttm/ttm_tt.c +1 -3
index dae52433beeb..1cc04c224988 100644
@@ -367,10 +367,8 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
  	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
  		return;
 
-	for (i = 0; i < ttm->num_pages; ++i) {
+	for (i = 0; i < ttm->num_pages; ++i)
  		(*page)->mapping = NULL;
-		(*page++)->index = 0;
-	}
  }
 
  void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)