Skip to contentSkip to conversation

Two-pass MMU interval notifiers

PATCH Superseded Thomas Hellström 3 participants 19 messages Mar 2 – Mar 3

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Thomas Hellström

author maintainer
#0 lore raw

v2 cover Two-pass MMU interval notifiers

GPU use-cases for mmu_interval_notifiers with hmm often involve starting a gpu operation and then waiting for it to complete. These operations are typically context preemption or TLB flushing.

With single-pass notifiers per GPU this doesn't scale in multi-gpu scenarios. In those scenarios we'd want to first start preemption- or TLB flushing on all GPUs and as a second pass wait for them to complete.

This also applies in non-recoverable page-fault scenarios to starting a preemption requests on GPUs and waiting for the GPUs to preempt so that system pages they access can be reclaimed.

One can do this on per-driver basis multiplexing per-driver notifiers but that would mean sharing the notifier "user" lock across all GPUs and that doesn't scale well either, so adding support for two-pass in the core appears like the right choice.

So this series does that, with pach 1 implementing the core support and also describes the choices made.

The rest of the patches implements a POC with xeKMD userptr invalidation and potential TLB-flushing. A follow-up series will extend to drm_gpusvm.

v2 hightlights:
- Refactor the core mm patch to use the struct mmu_interval_notifier_ops for the invalidate_finish() callback.
- Rebase on xe driver tlb invalidation changes.
- Provide an initial implementation for userptr instead of drm_gpusvm. The intent is to handle drm_gpusvm in a follow-up series.

Cc Matthew Brost <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Alistair Popple <[email protected]>

Thomas Hellström (4):
mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers drm/xe/userptr: Convert invalidation to two-pass MMU notifier drm/xe: Split TLB invalidation into submit and wait steps drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass
if possible

 drivers/gpu/drm/xe/xe_svm.c             |   6 +-
 drivers/gpu/drm/xe/xe_tlb_inval.c       |  82 ++++++++++++++
 drivers/gpu/drm/xe/xe_tlb_inval.h       |   6 ++
 drivers/gpu/drm/xe/xe_tlb_inval_types.h |  14 +++
 drivers/gpu/drm/xe/xe_userptr.c         | 136 ++++++++++++++++++++----
 drivers/gpu/drm/xe/xe_userptr.h         |  32 ++++++
 drivers/gpu/drm/xe/xe_vm.c              |  99 ++++++-----------
 drivers/gpu/drm/xe/xe_vm.h              |   5 +-
 drivers/gpu/drm/xe/xe_vm_madvise.c      |   9 +-
 drivers/gpu/drm/xe/xe_vm_types.h        |   1 +
 include/linux/mmu_notifier.h            |  38 +++++++
 mm/mmu_notifier.c                       |  64 +++++++++--
 12 files changed, 389 insertions(+), 103 deletions(-)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH v2 1/4 mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers

GPU use-cases for mmu_interval_notifiers with hmm often involve starting a gpu operation and then waiting for it to complete. These operations are typically context preemption or TLB flushing.

With single-pass notifiers per GPU this doesn't scale in multi-gpu scenarios. In those scenarios we'd want to first start preemption- or TLB flushing on all GPUs and as a second pass wait for them to complete.

One can do this on per-driver basis multiplexing per-driver notifiers but that would mean sharing the notifier "user" lock across all GPUs and that doesn't scale well either, so adding support for multi-pass in the core appears to be the right choice.

Implement two-pass capability in the mmu_interval_notifier. Use a linked list for the final passes to minimize the impact for use-cases that don't need the multi-pass functionality by avoiding a second interval tree walk, and to be able to easily pass data between the two passes.

v1:
- Restrict to two passes (Jason Gunthorpe)
- Improve on documentation (Jason Gunthorpe)
- Improve on function naming (Alistair Popple) v2:
- Include the invalidate_finish() callback in the struct mmu_interval_notifier_ops.
- Update documentation (GitHub Copilot:claude-sonnet-4.6)
- Use lockless list for list management.

Cc Jason Gunthorpe <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Alistair Popple <[email protected]>
Assisted-by GitHub Copilot:claude-sonnet-4.6 # Documentation only.
---
 include/linux/mmu_notifier.h | 38 +++++++++++++++++++++
 mm/mmu_notifier.c            | 64 +++++++++++++++++++++++++++++++-----
 2 files changed, 93 insertions(+), 9 deletions(-)
include/linux/mmu_notifier.h +38 -0
index 07a2bbaf86e9..de0e742ea808 100644
@@ -233,16 +233,54 @@ struct mmu_notifier {
 	unsigned int users;
 };
 
+/**
+ * struct mmu_interval_notifier_finish - mmu_interval_notifier two-pass abstraction
+ * @link: List link for the notifiers pending pass list
+ * @notifier: The mmu_interval_notifier for which the finish pass is called.
+ *
+ * Allocate, typically using GFP_NOWAIT in the interval notifier's first pass.
+ * If allocation fails (which is not unlikely under memory pressure), fall back
+ * to single-pass operation. Note that with a large number of notifiers
+ * implementing two passes, allocation with GFP_NOWAIT will become increasingly
+ * likely to fail, so consider implementing a small pool instead of using
+ * kmalloc() allocations.
+ *
+ * If the implementation needs to pass data between the two passes,
+ * the recommended way is to embed struct mmu_interval_notifier_finish into a larger
+ * structure that also contains the data needed to be shared. Keep in mind that
+ * a notifier callback can be invoked in parallel, and each invocation needs its
+ * own struct mmu_interval_notifier_finish.
+ */
+struct mmu_interval_notifier_finish {
+	struct llist_node link;
+	struct mmu_interval_notifier *notifier;
+};
+
 /**
  * struct mmu_interval_notifier_ops
  * @invalidate: Upon return the caller must stop using any SPTEs within this
  *              range. This function can sleep. Return false only if sleeping
  *              was required but mmu_notifier_range_blockable(range) is false.
+ * @invalidate_start: Similar to @invalidate, but intended for two-pass notifier
+ *                    callbacks where the call to @invalidate_start is the first
+ *                    pass and any struct mmu_interval_notifier_finish pointer
+ *                    returned in the @finish parameter describes the final pass.
+ *                    If @finish is %NULL on return, then no final pass will be
+ *                    called.
+ * @invalidate_finish: Called as the second pass for any notifier that returned
+ *                     a non-NULL @finish from @invalidate_start. The @finish
+ *                     pointer passed here is the same one returned by
+ *                     @invalidate_start.
  */
 struct mmu_interval_notifier_ops {
 	bool (*invalidate)(struct mmu_interval_notifier *interval_sub,
 			   const struct mmu_notifier_range *range,
 			   unsigned long cur_seq);
+	bool (*invalidate_start)(struct mmu_interval_notifier *interval_sub,
+				 const struct mmu_notifier_range *range,
+				 unsigned long cur_seq,
+				 struct mmu_interval_notifier_finish **finish);
+	void (*invalidate_finish)(struct mmu_interval_notifier_finish *finish);
 };
 
 struct mmu_interval_notifier {
mm/mmu_notifier.c +55 -9

108 lines not on this page · raw message

Signature · 1 line
2.53.0
author maintainer
#4 lore raw

PATCH v2 2/4 drm/xe/userptr: Convert invalidation to two-pass MMU notifier

In reply to Thomas Hellström

In multi-GPU scenarios, asynchronous GPU job latency is a bottleneck if each notifier waits for its own GPU before returning. The two-pass mmu_interval_notifier infrastructure allows deferring the wait to a second pass, so all GPUs can be signalled in the first pass before any of them are waited on.

Convert the userptr invalidation to use the two-pass model:

Use invalidate_start as the first pass to mark the VMA for repin and enable software signalling on the VM reservation fences to start any gpu work needed for signaling. Fall back to completing the work synchronously if all fences are already signalled, or if a concurrent invalidation is already using the embedded finish structure.

Use invalidate_finish as the second pass to wait for the reservation fences to complete, invalidate the GPU TLB in fault mode, and unmap the gpusvm pages.

Embed a struct mmu_interval_notifier_finish in struct xe_userptr to avoid dynamic allocation in the notifier callback. Use a finish_inuse flag to prevent two concurrent invalidations from using it simultaneously; fall back to the synchronous path for the second caller.

Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_userptr.c | 96 +++++++++++++++++++++++++--------
 drivers/gpu/drm/xe/xe_userptr.h | 14 +++++
 2 files changed, 88 insertions(+), 22 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +74 -22
index e120323c43bc..440b0a79d16f 100644
@@ -73,18 +73,42 @@ int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma)
 				    &ctx);
 }
 
-static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,
+				    bool is_deferred)
 {
 	struct xe_userptr *userptr = &uvma->userptr;
 	struct xe_vma *vma = &uvma->vma;
-	struct dma_resv_iter cursor;
-	struct dma_fence *fence;
 	struct drm_gpusvm_ctx ctx = {
 		.in_notifier = true,
 		.read_only = xe_vma_read_only(vma),
 	};
 	long err;
 
+	err = dma_resv_wait_timeout(xe_vm_resv(vm),
+				    DMA_RESV_USAGE_BOOKKEEP,
+				    false, MAX_SCHEDULE_TIMEOUT);
+	XE_WARN_ON(err <= 0);
+
+	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		err = xe_vm_invalidate_vma(vma);
+		XE_WARN_ON(err);
+	}
+
+	if (is_deferred)
+		userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
+			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+}
+
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct dma_resv_iter cursor;
+	struct dma_fence *fence;
+	bool signaled = true;
+
 	/*
 	 * Tell exec and rebind worker they need to repin and rebind this
 	 * userptr.
@@ -105,27 +129,32 @@ static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uv
 	 */
 	dma_resv_iter_begin(&cursor, xe_vm_resv(vm),
 			    DMA_RESV_USAGE_BOOKKEEP);
-	dma_resv_for_each_fence_unlocked(&cursor, fence)
+	dma_resv_for_each_fence_unlocked(&cursor, fence) {
 		dma_fence_enable_sw_signaling(fence);
+		if (signaled && !dma_fence_is_signaled(fence))
+			signaled = false;
+	}
 	dma_resv_iter_end(&cursor);
 
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
-				    false, MAX_SCHEDULE_TIMEOUT);
-	XE_WARN_ON(err <= 0);
-
-	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
-		err = xe_vm_invalidate_vma(vma);
-		XE_WARN_ON(err);
+	/*
+	 * Only one caller at a time can use the multi-pass state.
+	 * If it's already in use, or all fences are already signaled,
+	 * proceed directly to invalidation without deferring.
+	 */
+	if (signaled || userptr->finish_inuse) {
+		xe_vma_userptr_do_inval(vm, uvma, false);
+		return NULL;
 	}
 
-	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
-			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+	userptr->finish_inuse = true;
+
+	return &userptr->finish;
 }
 
-static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
-				   const struct mmu_notifier_range *range,
-				   unsigned long cur_seq)
+static bool xe_vma_userptr_invalidate_start(struct mmu_interval_notifier *mni,
+					    const struct mmu_notifier_range *range,
+					    unsigned long cur_seq,
+					    struct mmu_interval_notifier_finish **p_finish)
 {
 	struct xe_userptr_vma *uvma = container_of(mni, typeof(*uvma), userptr.notifier);
 	struct xe_vma *vma = &uvma->vma;
@@ -138,21 +167,40 @@ static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
 		return false;
 
 	vm_dbg(&xe_vma_vm(vma)->xe->drm,
-	       "NOTIFIER: addr=0x%016llx, range=0x%016llx",
+	       "NOTIFIER PASS1: addr=0x%016llx, range=0x%016llx",
 		xe_vma_start(vma), xe_vma_size(vma));
 
 	down_write(&vm->svm.gpusvm.notifier_lock);
 	mmu_interval_set_seq(mni, cur_seq);
 
-	__vma_userptr_invalidate(vm, uvma);
+	*p_finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+
 	up_write(&vm->svm.gpusvm.notifier_lock);
-	trace_xe_vma_userptr_invalidate_complete(vma);
+	if (!*p_finish)
+		trace_xe_vma_userptr_invalidate_complete(vma);
 
 	return true;
 }
 
+static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish *finish)
+{
+	struct xe_userptr_vma *uvma = container_of(finish, typeof(*uvma), userptr.finish);
+	struct xe_vma *vma = &uvma->vma;
+	struct xe_vm *vm = xe_vma_vm(vma);
+
+	vm_dbg(&xe_vma_vm(vma)->xe->drm,
+	       "NOTIFIER PASS2: addr=0x%016llx, range=0x%016llx",
+		xe_vma_start(vma), xe_vma_size(vma));
+
+	down_write(&vm->svm.gpusvm.notifier_lock);
+	xe_vma_userptr_do_inval(vm, uvma, true);
+	up_write(&vm->svm.gpusvm.notifier_lock);
+	trace_xe_vma_userptr_invalidate_complete(vma);
+}
+
 static const struct mmu_interval_notifier_ops vma_userptr_notifier_ops = {
-	.invalidate = vma_userptr_invalidate,
+	.invalidate_start = xe_vma_userptr_invalidate_start,
+	.invalidate_finish = xe_vma_userptr_invalidate_finish,
 };
 
 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)
@@ -164,6 +212,7 @@ static const struct mmu_interval_notifier_ops vma_userptr_notifier_ops = {
  */
 void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 {
+	static struct mmu_interval_notifier_finish *finish;
 	struct xe_vm *vm = xe_vma_vm(&uvma->vma);
 
 	/* Protect against concurrent userptr pinning */
@@ -179,7 +228,10 @@ void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 	if (!mmu_interval_read_retry(&uvma->userptr.notifier,
 				     uvma->userptr.pages.notifier_seq))
 		uvma->userptr.pages.notifier_seq -= 2;
-	__vma_userptr_invalidate(vm, uvma);
+
+	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+	if (finish)
+		xe_vma_userptr_do_inval(vm, uvma, true);
 }
 #endif
 
drivers/gpu/drm/xe/xe_userptr.h +14 -0
index ef801234991e..4f42db61fd62 100644
@@ -57,12 +57,26 @@ struct xe_userptr {
 	 */
 	struct mmu_interval_notifier notifier;
 
+	/**
+	 * @finish: MMU notifier finish structure for two-pass invalidation.
+	 * Embedded here to avoid allocation in the notifier callback.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	struct mmu_interval_notifier_finish finish;
+	/**
+	 * @finish_inuse: Whether @finish is currently in use by an in-progress
+	 * two-pass invalidation.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	bool finish_inuse;
+
 	/**
 	 * @initial_bind: user pointer has been bound at least once.
 	 * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
 	 * read: vm->svm.gpusvm.notifier_lock in write mode or vm->resv held.
 	 */
 	bool initial_bind;
+
 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)
 	u32 divisor;
 #endif
Signature · 1 line
2.53.0
author maintainer
#8 lore raw

PATCH v2 3/4 drm/xe: Split TLB invalidation into submit and wait steps

In reply to Thomas Hellström

xe_vm_range_tilemask_tlb_inval() submits TLB invalidation requests to all GTs in a tile mask and then immediately waits for them to complete before returning. This is fine for the existing callers, but a subsequent patch will need to defer the wait in order to overlap TLB invalidations across multiple VMAs.

Introduce xe_tlb_inval_range_tilemask_submit() and xe_tlb_inval_batch_wait() in xe_tlb_inval.c as the submit and wait halves respectively. The batch of fences is carried in the new xe_tlb_inval_batch structure. Remove xe_vm_range_tilemask_tlb_inval() and convert all three call sites to the new API.

Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_svm.c             |  6 +-
 drivers/gpu/drm/xe/xe_tlb_inval.c       | 82 +++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_tlb_inval.h       |  6 ++
 drivers/gpu/drm/xe/xe_tlb_inval_types.h | 14 +++++
 drivers/gpu/drm/xe/xe_vm.c              | 69 +++------------------
 drivers/gpu/drm/xe/xe_vm.h              |  3 -
 drivers/gpu/drm/xe/xe_vm_madvise.c      |  9 ++-
 drivers/gpu/drm/xe/xe_vm_types.h        |  1 +
 8 files changed, 123 insertions(+), 67 deletions(-)
drivers/gpu/drm/xe/xe_svm.c +5 -1
index 002b6c22ad3f..6ea4972c2791 100644
@@ -19,6 +19,7 @@
 #include "xe_pt.h"
 #include "xe_svm.h"
 #include "xe_tile.h"
+#include "xe_tlb_inval.h"
 #include "xe_ttm_vram_mgr.h"
 #include "xe_vm.h"
 #include "xe_vm_types.h"
@@ -225,6 +226,7 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 			      const struct mmu_notifier_range *mmu_range)
 {
 	struct xe_vm *vm = gpusvm_to_vm(gpusvm);
+	struct xe_tlb_inval_batch _batch;
 	struct xe_device *xe = vm->xe;
 	struct drm_gpusvm_range *r, *first;
 	struct xe_tile *tile;
@@ -276,7 +278,9 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 
 	xe_device_wmb(xe);
 
-	err = xe_vm_range_tilemask_tlb_inval(vm, adj_start, adj_end, tile_mask);
+	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
+						 tile_mask, &_batch);
+	xe_tlb_inval_batch_wait(&_batch);
 	WARN_ON_ONCE(err);
 
 range_notifier_event_end:
drivers/gpu/drm/xe/xe_tlb_inval.c +82 -0

85 lines not on this page · raw message

drivers/gpu/drm/xe/xe_tlb_inval.h +6 -0
index 62089254fa23..a76b7823a5f2 100644
@@ -45,4 +45,10 @@ void xe_tlb_inval_done_handler(struct xe_tlb_inval *tlb_inval, int seqno);
 
 bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval);
 
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,
+				       u64 start, u64 end, u8 tile_mask,
+				       struct xe_tlb_inval_batch *batch);
+
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch);
+
 #endif	/* _XE_TLB_INVAL_ */
drivers/gpu/drm/xe/xe_tlb_inval_types.h +14 -0
index 3b089f90f002..3d1797d186fd 100644
@@ -9,6 +9,8 @@
 #include <linux/workqueue.h>
 #include <linux/dma-fence.h>
 
+#include "xe_device_types.h"
+
 struct drm_suballoc;
 struct xe_tlb_inval;
 
@@ -132,4 +134,16 @@ struct xe_tlb_inval_fence {
 	ktime_t inval_time;
 };
 
+/**
+ * struct xe_tlb_inval_batch - Batch of TLB invalidation fences
+ *
+ * Holds one fence per GT covered by a TLB invalidation request.
+ */
+struct xe_tlb_inval_batch {
+	/** @fence: per-GT TLB invalidation fences */
+	struct xe_tlb_inval_fence fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE];
+	/** @num_fences: number of valid entries in @fence */
+	unsigned int num_fences;
+};
+
 #endif
drivers/gpu/drm/xe/xe_vm.c +7 -62

91 lines not on this page · raw message

drivers/gpu/drm/xe/xe_vm.h +0 -3
index f849e369432b..62f4b6fec0bc 100644
@@ -240,9 +240,6 @@ struct dma_fence *xe_vm_range_rebind(struct xe_vm *vm,
 struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
 				     struct xe_svm_range *range);
 
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask);
-
 int xe_vm_invalidate_vma(struct xe_vma *vma);
 
 int xe_vm_validate_protected(struct xe_vm *vm);
drivers/gpu/drm/xe/xe_vm_madvise.c +8 -1
index 95bf53cc29e3..39717026e84f 100644
@@ -12,6 +12,7 @@
 #include "xe_pat.h"
 #include "xe_pt.h"
 #include "xe_svm.h"
+#include "xe_tlb_inval.h"
 
 struct xe_vmas_in_madvise_range {
 	u64 addr;
@@ -235,13 +236,19 @@ static u8 xe_zap_ptes_in_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 static int xe_vm_invalidate_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 {
 	u8 tile_mask = xe_zap_ptes_in_madvise_range(vm, start, end);
+	struct xe_tlb_inval_batch batch;
+	int err;
 
 	if (!tile_mask)
 		return 0;
 
 	xe_device_wmb(vm->xe);
 
-	return xe_vm_range_tilemask_tlb_inval(vm, start, end, tile_mask);
+	err = xe_tlb_inval_range_tilemask_submit(vm->xe, vm->usm.asid, start, end,
+						 tile_mask, &batch);
+	xe_tlb_inval_batch_wait(&batch);
+
+	return err;
 }
 
 static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madvise *args)
drivers/gpu/drm/xe/xe_vm_types.h +1 -0
index 1f6f7e30e751..de6544165cfa 100644
@@ -18,6 +18,7 @@
 #include "xe_device_types.h"
 #include "xe_pt_types.h"
 #include "xe_range_fence.h"
+#include "xe_tlb_inval_types.h"
 #include "xe_userptr.h"
 
 struct drm_pagemap;
Signature · 1 line
2.53.0
author maintainer
#12 lore raw

PATCH v2 4/4 drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible

In reply to Thomas Hellström

Now that the two-pass notifier flow uses xe_vma_userptr_do_inval() for the fence-wait + TLB-invalidate work, extend it to support a further deferred TLB wait:

- xe_vma_userptr_do_inval(): when the embedded finish handle is free, submit the TLB invalidation asynchronously (xe_vm_invalidate_vma_submit) and return &userptr->finish so the mmu_notifier core schedules a third pass. When the handle is occupied by a concurrent invalidation, fall back to the synchronous xe_vm_invalidate_vma() path.

- xe_vma_userptr_complete_tlb_inval(): new helper called from invalidate_finish when tlb_inval_submitted is set. Waits for the previously submitted batch and unmaps the gpusvm pages.

xe_vma_userptr_invalidate_finish() dispatches between the two helpers via tlb_inval_submitted, making the three possible flows explicit:

pass1 (fences pending) -> invalidate_finish -> do_inval (sync TLB)
pass1 (fences done) -> do_inval -> invalidate_finish

                          -> complete_tlb_inval (deferred TLB)

pass1 (finish occupied) -> do_inval (sync TLB, inline)

In multi-GPU scenarios this allows TLB flushes to be submitted on all GPUs in one pass before any of them are waited on.

Also adds xe_vm_invalidate_vma_submit() which submits the TLB range invalidation without blocking, populating a xe_tlb_inval_batch that the caller waits on separately.

Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_userptr.c | 60 +++++++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_userptr.h | 18 ++++++++++
 drivers/gpu/drm/xe/xe_vm.c      | 38 ++++++++++++++++-----
 drivers/gpu/drm/xe/xe_vm.h      |  2 ++
 4 files changed, 99 insertions(+), 19 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +49 -11
index 440b0a79d16f..a62b796afb93 100644
@@ -8,6 +8,7 @@
 
 #include <linux/mm.h>
 
+#include "xe_tlb_inval.h"
 #include "xe_trace_bo.h"
 
 /**
@@ -73,8 +74,8 @@ int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma)
 				    &ctx);
 }
 
-static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,
-				    bool is_deferred)
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma, bool is_deferred)
 {
 	struct xe_userptr *userptr = &uvma->userptr;
 	struct xe_vma *vma = &uvma->vma;
@@ -84,12 +85,23 @@ static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm
 	};
 	long err;
 
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
+	err = dma_resv_wait_timeout(xe_vm_resv(vm), DMA_RESV_USAGE_BOOKKEEP,
 				    false, MAX_SCHEDULE_TIMEOUT);
 	XE_WARN_ON(err <= 0);
 
 	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		if (!userptr->finish_inuse) {
+			/*
+			 * Defer the TLB wait to an extra pass so the caller
+			 * can pipeline TLB flushes across GPUs before waiting
+			 * on any of them.
+			 */
+			userptr->finish_inuse = true;
+			userptr->tlb_inval_submitted = true;
+			err = xe_vm_invalidate_vma_submit(vma, &userptr->inval_batch);
+			XE_WARN_ON(err);
+			return &userptr->finish;
+		}
 		err = xe_vm_invalidate_vma(vma);
 		XE_WARN_ON(err);
 	}
@@ -98,6 +110,24 @@ static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm
 		userptr->finish_inuse = false;
 	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
 			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+	return NULL;
+}
+
+static void
+xe_vma_userptr_complete_tlb_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct drm_gpusvm_ctx ctx = {
+		.in_notifier = true,
+		.read_only = xe_vma_read_only(vma),
+	};
+
+	xe_tlb_inval_batch_wait(&userptr->inval_batch);
+	userptr->tlb_inval_submitted = false;
+	userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
+			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
 }
 
 static struct mmu_interval_notifier_finish *
@@ -141,13 +171,11 @@ xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct xe_userptr_vma *uvma)
 	 * If it's already in use, or all fences are already signaled,
 	 * proceed directly to invalidation without deferring.
 	 */
-	if (signaled || userptr->finish_inuse) {
-		xe_vma_userptr_do_inval(vm, uvma, false);
-		return NULL;
-	}
+	if (signaled || userptr->finish_inuse)
+		return xe_vma_userptr_do_inval(vm, uvma, false);
 
+	/* Defer: the notifier core will call invalidate_finish once done. */
 	userptr->finish_inuse = true;
-
 	return &userptr->finish;
 }
 
@@ -193,7 +221,15 @@ static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish
 		xe_vma_start(vma), xe_vma_size(vma));
 
 	down_write(&vm->svm.gpusvm.notifier_lock);
-	xe_vma_userptr_do_inval(vm, uvma, true);
+	/*
+	 * If a TLB invalidation was previously submitted (deferred from the
+	 * synchronous pass1 fallback), wait for it and unmap pages.
+	 * Otherwise, fences have now completed: invalidate the TLB and unmap.
+	 */
+	if (uvma->userptr.tlb_inval_submitted)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);
+	else
+		xe_vma_userptr_do_inval(vm, uvma, true);
 	up_write(&vm->svm.gpusvm.notifier_lock);
 	trace_xe_vma_userptr_invalidate_complete(vma);
 }
@@ -231,7 +267,9 @@ void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 
 	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
 	if (finish)
-		xe_vma_userptr_do_inval(vm, uvma, true);
+		finish = xe_vma_userptr_do_inval(vm, uvma, true);
+	if (finish)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);
 }
 #endif
 
drivers/gpu/drm/xe/xe_userptr.h +18 -0
index 4f42db61fd62..7477009651c2 100644
@@ -14,6 +14,8 @@
 
 #include <drm/drm_gpusvm.h>
 
+#include "xe_tlb_inval_types.h"
+
 struct xe_vm;
 struct xe_vma;
 struct xe_userptr_vma;
@@ -63,6 +65,15 @@ struct xe_userptr {
 	 * Protected by @vm::svm.gpusvm.notifier_lock.
 	 */
 	struct mmu_interval_notifier_finish finish;
+
+	/**
+	 * @inval_batch: TLB invalidation batch for deferred completion.
+	 * Stores an in-flight TLB invalidation submitted during a two-pass
+	 * notifier so the wait can be deferred to a subsequent pass, allowing
+	 * multiple GPUs to be signalled before any of them are waited on.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	struct xe_tlb_inval_batch inval_batch;
 	/**
 	 * @finish_inuse: Whether @finish is currently in use by an in-progress
 	 * two-pass invalidation.
@@ -70,6 +81,13 @@ struct xe_userptr {
 	 */
 	bool finish_inuse;
 
+	/**
+	 * @tlb_inval_submitted: Whether a TLB invalidation has been submitted
+	 * via @inval_batch and is pending completion.  When set, the next pass
+	 * must call xe_tlb_inval_batch_wait() before reusing @inval_batch.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	bool tlb_inval_submitted;
 	/**
 	 * @initial_bind: user pointer has been bound at least once.
 	 * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
drivers/gpu/drm/xe/xe_vm.c +30 -8
index 7f29d2b2972d..fdad9329dfb4 100644
@@ -3967,20 +3967,23 @@ void xe_vm_unlock(struct xe_vm *vm)
 }
 
 /**
- * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
+ * xe_vm_invalidate_vma_submit - Submit a job to invalidate GPU mappings for
+ * VMA.
  * @vma: VMA to invalidate
+ * @batch: TLB invalidation batch to populate; caller must later call
+ *         xe_tlb_inval_batch_wait() on it to wait for completion
  *
  * Walks a list of page tables leaves which it memset the entries owned by this
- * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
- * complete.
+ * VMA to zero, invalidates the TLBs, but doesn't block waiting for TLB flush
+ * to complete, but instead populates @batch which can be waited on using
+ * xe_tlb_inval_batch_wait().
  *
  * Returns 0 for success, negative error code otherwise.
  */
-int xe_vm_invalidate_vma(struct xe_vma *vma)
+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct xe_tlb_inval_batch *batch)
 {
 	struct xe_device *xe = xe_vma_vm(vma)->xe;
 	struct xe_vm *vm = xe_vma_vm(vma);
-	struct xe_tlb_inval_batch _batch;
 	struct xe_tile *tile;
 	u8 tile_mask = 0;
 	int ret = 0;
@@ -4023,14 +4026,33 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
 
 	ret = xe_tlb_inval_range_tilemask_submit(xe, xe_vma_vm(vma)->usm.asid,
 						 xe_vma_start(vma), xe_vma_end(vma),
-						 tile_mask, &_batch);
+						 tile_mask, batch);
 
 	/* WRITE_ONCE pairs with READ_ONCE in xe_vm_has_valid_gpu_mapping() */
 	WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);
+	return ret;
+}
+
+/**
+ * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
+ * @vma: VMA to invalidate
+ *
+ * Walks a list of page tables leaves which it memset the entries owned by this
+ * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
+ * complete.
+ *
+ * Returns 0 for success, negative error code otherwise.
+ */
+int xe_vm_invalidate_vma(struct xe_vma *vma)
+{
+	struct xe_tlb_inval_batch batch;
+	int ret;
 
-	if (!ret)
-		xe_tlb_inval_batch_wait(&_batch);
+	ret = xe_vm_invalidate_vma_submit(vma, &batch);
+	if (ret)
+		return ret;
 
+	xe_tlb_inval_batch_wait(&batch);
 	return ret;
 }
 
drivers/gpu/drm/xe/xe_vm.h +2 -0
index 62f4b6fec0bc..0bc7ed23eeae 100644
@@ -242,6 +242,8 @@ struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
 
 int xe_vm_invalidate_vma(struct xe_vma *vma);
 
+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct xe_tlb_inval_batch *batch);
+
 int xe_vm_validate_protected(struct xe_vm *vm);
 
 static inline void xe_vm_queue_rebind_worker(struct xe_vm *vm)
Signature · 1 line
2.53.0
maintainer
#5 lore raw

Re: [PATCH v2 2/4] drm/xe/userptr: Convert invalidation to two-pass MMU notifier

In reply to Thomas Hellström
Quoted 14 lines · Thomas Hellström

In multi-GPU scenarios, asynchronous GPU job latency is a bottleneck if each notifier waits for its own GPU before returning. The two-pass mmu_interval_notifier infrastructure allows deferring the wait to a second pass, so all GPUs can be signalled in the first pass before any of them are waited on.

Convert the userptr invalidation to use the two-pass model:

Use invalidate_start as the first pass to mark the VMA for repin and enable software signalling on the VM reservation fences to start any gpu work needed for signaling. Fall back to completing the work synchronously if all fences are already signalled, or if a concurrent invalidation is already using the embedded finish structure.

Quoted 9 lines

Use invalidate_finish as the second pass to wait for the reservation fences to complete, invalidate the GPU TLB in fault mode, and unmap the gpusvm pages.

Embed a struct mmu_interval_notifier_finish in struct xe_userptr to avoid dynamic allocation in the notifier callback. Use a finish_inuse flag to prevent two concurrent invalidations from using it simultaneously; fall back to the synchronous path for the second caller.

A couple nits below. Also for clarity, I'd probably rework this series...

- Move patch #3 to 2nd to patch
- Squash patch #2, #4 into a single patch, make thia the last patch

Let me know what you think on the reordering. I'm looking with the series applied and aside from nits below everything in xe_userptr.c looks good to me.

Quoted 19 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_userptr.c | 96 +++++++++++++++++++++++++--------
 drivers/gpu/drm/xe/xe_userptr.h | 14 +++++
 2 files changed, 88 insertions(+), 22 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +2 -1
index e120323c43bc..440b0a79d16f 100644
@@ -73,18 +73,42 @@ int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma)
 				    &ctx);
 }
 
-static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,
+				    bool is_deferred)
 {

drivers/gpu/drm/xe/xe_userptr.c int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma) · line 86

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.c +0 -2
 	struct xe_userptr *userptr = &uvma->userptr;
 	struct xe_vma *vma = &uvma->vma;
-	struct dma_resv_iter cursor;
-	struct dma_fence *fence;
 	struct drm_gpusvm_ctx ctx = {
 		.in_notifier = true,
 		.read_only = xe_vma_read_only(vma),
 	};
 	long err;
 

xe_svm_assert_in_notifier(vm);

Quoted 15 lines
drivers/gpu/drm/xe/xe_userptr.c +15 -0
+	err = dma_resv_wait_timeout(xe_vm_resv(vm),
+				    DMA_RESV_USAGE_BOOKKEEP,
+				    false, MAX_SCHEDULE_TIMEOUT);
+	XE_WARN_ON(err <= 0);
+
+	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		err = xe_vm_invalidate_vma(vma);
+		XE_WARN_ON(err);
+	}
+
+	if (is_deferred)
+		userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
+			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+}

drivers/gpu/drm/xe/xe_userptr.c int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma) · line 111

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.c +10 -0
+
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct dma_resv_iter cursor;
+	struct dma_fence *fence;
+	bool signaled = true;
+

xe_svm_assert_in_notifier(vm);

Quoted 133 lines
drivers/gpu/drm/xe/xe_userptr.c +47 -19
 	/*
 	 * Tell exec and rebind worker they need to repin and rebind this
 	 * userptr.
@@ -105,27 +129,32 @@ static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uv
 	 */
 	dma_resv_iter_begin(&cursor, xe_vm_resv(vm),
 			    DMA_RESV_USAGE_BOOKKEEP);
-	dma_resv_for_each_fence_unlocked(&cursor, fence)
+	dma_resv_for_each_fence_unlocked(&cursor, fence) {
 		dma_fence_enable_sw_signaling(fence);
+		if (signaled && !dma_fence_is_signaled(fence))
+			signaled = false;
+	}
 	dma_resv_iter_end(&cursor);
 
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
-				    false, MAX_SCHEDULE_TIMEOUT);
-	XE_WARN_ON(err <= 0);
-
-	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
-		err = xe_vm_invalidate_vma(vma);
-		XE_WARN_ON(err);
+	/*
+	 * Only one caller at a time can use the multi-pass state.
+	 * If it's already in use, or all fences are already signaled,
+	 * proceed directly to invalidation without deferring.
+	 */
+	if (signaled || userptr->finish_inuse) {
+		xe_vma_userptr_do_inval(vm, uvma, false);
+		return NULL;
 	}
 
-	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
-			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+	userptr->finish_inuse = true;
+
+	return &userptr->finish;
 }
 
-static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
-				   const struct mmu_notifier_range *range,
-				   unsigned long cur_seq)
+static bool xe_vma_userptr_invalidate_start(struct mmu_interval_notifier *mni,
+					    const struct mmu_notifier_range *range,
+					    unsigned long cur_seq,
+					    struct mmu_interval_notifier_finish **p_finish)
 {
 	struct xe_userptr_vma *uvma = container_of(mni, typeof(*uvma), userptr.notifier);
 	struct xe_vma *vma = &uvma->vma;
@@ -138,21 +167,40 @@ static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
 		return false;
 
 	vm_dbg(&xe_vma_vm(vma)->xe->drm,
-	       "NOTIFIER: addr=0x%016llx, range=0x%016llx",
+	       "NOTIFIER PASS1: addr=0x%016llx, range=0x%016llx",
 		xe_vma_start(vma), xe_vma_size(vma));
 
 	down_write(&vm->svm.gpusvm.notifier_lock);
 	mmu_interval_set_seq(mni, cur_seq);
 
-	__vma_userptr_invalidate(vm, uvma);
+	*p_finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+
 	up_write(&vm->svm.gpusvm.notifier_lock);
-	trace_xe_vma_userptr_invalidate_complete(vma);
+	if (!*p_finish)
+		trace_xe_vma_userptr_invalidate_complete(vma);
 
 	return true;
 }
 
+static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish *finish)
+{
+	struct xe_userptr_vma *uvma = container_of(finish, typeof(*uvma), userptr.finish);
+	struct xe_vma *vma = &uvma->vma;
+	struct xe_vm *vm = xe_vma_vm(vma);
+
+	vm_dbg(&xe_vma_vm(vma)->xe->drm,
+	       "NOTIFIER PASS2: addr=0x%016llx, range=0x%016llx",
+		xe_vma_start(vma), xe_vma_size(vma));
+
+	down_write(&vm->svm.gpusvm.notifier_lock);
+	xe_vma_userptr_do_inval(vm, uvma, true);
+	up_write(&vm->svm.gpusvm.notifier_lock);
+	trace_xe_vma_userptr_invalidate_complete(vma);
+}
+
 static const struct mmu_interval_notifier_ops vma_userptr_notifier_ops = {
-	.invalidate = vma_userptr_invalidate,
+	.invalidate_start = xe_vma_userptr_invalidate_start,
+	.invalidate_finish = xe_vma_userptr_invalidate_finish,
 };
 
 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)
@@ -164,6 +212,7 @@ static const struct mmu_interval_notifier_ops vma_userptr_notifier_ops = {
  */
 void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 {
+	static struct mmu_interval_notifier_finish *finish;
 	struct xe_vm *vm = xe_vma_vm(&uvma->vma);
 
 	/* Protect against concurrent userptr pinning */
@@ -179,7 +228,10 @@ void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 	if (!mmu_interval_read_retry(&uvma->userptr.notifier,
 				     uvma->userptr.pages.notifier_seq))
 		uvma->userptr.pages.notifier_seq -= 2;
-	__vma_userptr_invalidate(vm, uvma);
+
+	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+	if (finish)
+		xe_vma_userptr_do_inval(vm, uvma, true);
 }
 #endif
 
drivers/gpu/drm/xe/xe_userptr.h +10 -0
index ef801234991e..4f42db61fd62 100644
@@ -57,12 +57,26 @@ struct xe_userptr {
 	 */
 	struct mmu_interval_notifier notifier;
 
+	/**
+	 * @finish: MMU notifier finish structure for two-pass invalidation.
+	 * Embedded here to avoid allocation in the notifier callback.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	struct mmu_interval_notifier_finish finish;
+	/**
+	 * @finish_inuse: Whether @finish is currently in use by an in-progress
+	 * two-pass invalidation.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.

drivers/gpu/drm/xe/xe_userptr.h struct xe_userptr { · line 79

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.h +4 -0
+	 */
+	bool finish_inuse;
+
 	/**
 	 * @initial_bind: user pointer has been bound at least once.
 	 * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
 	 * read: vm->svm.gpusvm.notifier_lock in write mode or vm->resv held.
 	 */
 	bool initial_bind;
+

Unrelated.

Matt

Quoted 6 lines
drivers/gpu/drm/xe/xe_userptr.h +0 -0
 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)
 	u32 divisor;
 #endif
Signature · 1 line
2.53.0
maintainer
#9 lore raw

Re: [PATCH v2 3/4] drm/xe: Split TLB invalidation into submit and wait steps

In reply to Thomas Hellström
Quoted 6 lines · Thomas Hellström

xe_vm_range_tilemask_tlb_inval() submits TLB invalidation requests to all GTs in a tile mask and then immediately waits for them to complete before returning. This is fine for the existing callers, but a subsequent patch will need to defer the wait in order to overlap TLB invalidations across multiple VMAs.

Quoted 6 lines

Introduce xe_tlb_inval_range_tilemask_submit() and xe_tlb_inval_batch_wait() in xe_tlb_inval.c as the submit and wait halves respectively. The batch of fences is carried in the new xe_tlb_inval_batch structure. Remove xe_vm_range_tilemask_tlb_inval() and convert all three call sites to the new API.

Mostly nits...

Quoted 34 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_svm.c             |  6 +-
 drivers/gpu/drm/xe/xe_tlb_inval.c       | 82 +++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_tlb_inval.h       |  6 ++
 drivers/gpu/drm/xe/xe_tlb_inval_types.h | 14 +++++
 drivers/gpu/drm/xe/xe_vm.c              | 69 +++------------------
 drivers/gpu/drm/xe/xe_vm.h              |  3 -
 drivers/gpu/drm/xe/xe_vm_madvise.c      |  9 ++-
 drivers/gpu/drm/xe/xe_vm_types.h        |  1 +
 8 files changed, 123 insertions(+), 67 deletions(-)
drivers/gpu/drm/xe/xe_svm.c +2 -0
index 002b6c22ad3f..6ea4972c2791 100644
@@ -19,6 +19,7 @@
 #include "xe_pt.h"
 #include "xe_svm.h"
 #include "xe_tile.h"
+#include "xe_tlb_inval.h"
 #include "xe_ttm_vram_mgr.h"
 #include "xe_vm.h"
 #include "xe_vm_types.h"
@@ -225,6 +226,7 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 			      const struct mmu_notifier_range *mmu_range)
 {
 	struct xe_vm *vm = gpusvm_to_vm(gpusvm);
+	struct xe_tlb_inval_batch _batch;
 	struct xe_device *xe = vm->xe;
 	struct drm_gpusvm_range *r, *first;
 	struct xe_tile *tile;

drivers/gpu/drm/xe/xe_svm.c static void xe_svm_invalidate(struct drm_gpusvm *gpusvm, · line 283

Quoted 7 lines
drivers/gpu/drm/xe/xe_svm.c +3 -1
@@ -276,7 +278,9 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 
 	xe_device_wmb(xe);
 
-	err = xe_vm_range_tilemask_tlb_inval(vm, adj_start, adj_end, tile_mask);
+	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
+						 tile_mask, &_batch);
+	xe_tlb_inval_batch_wait(&_batch);

No need to call wait on an error but it is harmless.

So you could write it like this:

if (!WARN_ON_ONCE(err))

	xe_tlb_inval_batch_wait(&_batch);
Quoted 12 lines
drivers/gpu/drm/xe/xe_svm.c +0 -0
 	WARN_ON_ONCE(err);
 
 range_notifier_event_end:
drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
index 933f30fb617d..343e37cfe715 100644
@@ -486,3 +486,85 @@ bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval)
 	guard(spinlock_irq)(&tlb_inval->pending_lock);
 	return list_is_singular(&tlb_inval->pending_fences);
 }
+

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 499

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+/**
+ * xe_tlb_inval_batch_wait() - Wait for all fences in a TLB invalidation batch
+ * @batch: Batch of TLB invalidation fences to wait on
+ *
+ * Waits for every fence in @batch to signal, then resets @batch so it can be
+ * reused for a subsequent invalidation.
+ */
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch)
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];

Would this be better:

s/&batch->fence[0]/batch->fence

Personal preference I guess.

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+	unsigned int i;
+
+	for (i = 0; i < batch->num_fences; ++i)
+		xe_tlb_inval_fence_wait(fence++);
+
+	batch->num_fences = 0;
+}
+
+/**
+ * xe_tlb_inval_range_tilemask_submit() - Submit TLB invalidations for an

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 519

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+ * address range on a tile mask
+ * @xe: The xe device
+ * @asid: Address space ID
+ * @start: start address
+ * @end: end address
+ * @tile_mask: mask for which gt's issue tlb invalidation
+ * @batch: Batch of tlb invalidate fences
+ *
+ * Issue a range based TLB invalidation for gt's in tilemask
+ *

Mention no need to wait on batch if this function returns an error?

Quoted 36 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +36 -0
+ * Returns 0 for success, negative error code otherwise.
+ */
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,
+				       u64 start, u64 end, u8 tile_mask,
+				       struct xe_tlb_inval_batch *batch)
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];
+	struct xe_tile *tile;
+	u32 fence_id = 0;
+	u8 id;
+	int err;
+
+	batch->num_fences = 0;
+	if (!tile_mask)
+		return 0;
+
+	for_each_tile(tile, xe, id) {
+		if (!(tile_mask & BIT(id)))
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->primary_gt->tlb_inval,
+					&fence[fence_id], true);
+
+		err = xe_tlb_inval_range(&tile->primary_gt->tlb_inval,
+					 &fence[fence_id], start, end,
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+
+		if (!tile->media_gt)
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->media_gt->tlb_inval,
+					&fence[fence_id], true);
+

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 565

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+		err = xe_tlb_inval_range(&tile->media_gt->tlb_inval,
+					 &fence[fence_id], start, end,
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+	}
+
+wait:
+	batch->num_fences = fence_id;

Should 'batch->num_fences' only get set on success?

Quoted 122 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +5 -0
+	if (err)
+		xe_tlb_inval_batch_wait(batch);
+
+	return err;
+}
drivers/gpu/drm/xe/xe_tlb_inval.h +6 -0
index 62089254fa23..a76b7823a5f2 100644
@@ -45,4 +45,10 @@ void xe_tlb_inval_done_handler(struct xe_tlb_inval *tlb_inval, int seqno);
 
 bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval);
 
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,
+				       u64 start, u64 end, u8 tile_mask,
+				       struct xe_tlb_inval_batch *batch);
+
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch);
+
 #endif	/* _XE_TLB_INVAL_ */
drivers/gpu/drm/xe/xe_tlb_inval_types.h +14 -0
index 3b089f90f002..3d1797d186fd 100644
@@ -9,6 +9,8 @@
 #include <linux/workqueue.h>
 #include <linux/dma-fence.h>
 
+#include "xe_device_types.h"
+
 struct drm_suballoc;
 struct xe_tlb_inval;
 
@@ -132,4 +134,16 @@ struct xe_tlb_inval_fence {
 	ktime_t inval_time;
 };
 
+/**
+ * struct xe_tlb_inval_batch - Batch of TLB invalidation fences
+ *
+ * Holds one fence per GT covered by a TLB invalidation request.
+ */
+struct xe_tlb_inval_batch {
+	/** @fence: per-GT TLB invalidation fences */
+	struct xe_tlb_inval_fence fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE];
+	/** @num_fences: number of valid entries in @fence */
+	unsigned int num_fences;
+};
+
 #endif
drivers/gpu/drm/xe/xe_vm.c +0 -60
index 548b0769b3ef..7f29d2b2972d 100644
@@ -3966,66 +3966,6 @@ void xe_vm_unlock(struct xe_vm *vm)
 	dma_resv_unlock(xe_vm_resv(vm));
 }
 
-/**
- * xe_vm_range_tilemask_tlb_inval - Issue a TLB invalidation on this tilemask for an
- * address range
- * @vm: The VM
- * @start: start address
- * @end: end address
- * @tile_mask: mask for which gt's issue tlb invalidation
- *
- * Issue a range based TLB invalidation for gt's in tilemask
- *
- * Returns 0 for success, negative error code otherwise.
- */
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask)
-{
-	struct xe_tlb_inval_fence
-		fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE];
-	struct xe_tile *tile;
-	u32 fence_id = 0;
-	u8 id;
-	int err;
-
-	if (!tile_mask)
-		return 0;
-
-	for_each_tile(tile, vm->xe, id) {
-		if (!(tile_mask & BIT(id)))
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->primary_gt->tlb_inval,
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->primary_gt->tlb_inval,
-					 &fence[fence_id], start, end,
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-
-		if (!tile->media_gt)
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->media_gt->tlb_inval,
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->media_gt->tlb_inval,
-					 &fence[fence_id], start, end,
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-	}
-
-wait:
-	for (id = 0; id < fence_id; ++id)
-		xe_tlb_inval_fence_wait(&fence[id]);
-
-	return err;
-}
-
 /**
  * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
  * @vma: VMA to invalidate

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 3983

Quoted 4 lines
drivers/gpu/drm/xe/xe_vm.c +1 -0
@@ -4040,6 +3980,7 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
 {
 	struct xe_device *xe = xe_vma_vm(vma)->xe;
 	struct xe_vm *vm = xe_vma_vm(vma);
+	struct xe_tlb_inval_batch _batch;

Why not just 'batch'?

Quoted 9 lines
drivers/gpu/drm/xe/xe_vm.c +0 -2
 	struct xe_tile *tile;
 	u8 tile_mask = 0;
 	int ret = 0;
@@ -4080,12 +4021,16 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
 
 	xe_device_wmb(xe);
 
-	ret = xe_vm_range_tilemask_tlb_inval(xe_vma_vm(vma), xe_vma_start(vma),
-					     xe_vma_end(vma), tile_mask);

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 4033

Quoted 10 lines
drivers/gpu/drm/xe/xe_vm.c +6 -0
+	ret = xe_tlb_inval_range_tilemask_submit(xe, xe_vma_vm(vma)->usm.asid,
+						 xe_vma_start(vma), xe_vma_end(vma),
+						 tile_mask, &_batch);
 
 	/* WRITE_ONCE pairs with READ_ONCE in xe_vm_has_valid_gpu_mapping() */
 	WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);
 
+	if (!ret)
+		xe_tlb_inval_batch_wait(&_batch);
+

Here we skip the wait on error, hence my suggestion to skip waits in other code paths or at a minimum make call sematics consistent.

Quoted 35 lines
drivers/gpu/drm/xe/xe_vm.c +0 -0
 	return ret;
 }
 
drivers/gpu/drm/xe/xe_vm.h +0 -3
index f849e369432b..62f4b6fec0bc 100644
@@ -240,9 +240,6 @@ struct dma_fence *xe_vm_range_rebind(struct xe_vm *vm,
 struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
 				     struct xe_svm_range *range);
 
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask);
-
 int xe_vm_invalidate_vma(struct xe_vma *vma);
 
 int xe_vm_validate_protected(struct xe_vm *vm);
drivers/gpu/drm/xe/xe_vm_madvise.c +3 -0
index 95bf53cc29e3..39717026e84f 100644
@@ -12,6 +12,7 @@
 #include "xe_pat.h"
 #include "xe_pt.h"
 #include "xe_svm.h"
+#include "xe_tlb_inval.h"
 
 struct xe_vmas_in_madvise_range {
 	u64 addr;
@@ -235,13 +236,19 @@ static u8 xe_zap_ptes_in_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 static int xe_vm_invalidate_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 {
 	u8 tile_mask = xe_zap_ptes_in_madvise_range(vm, start, end);
+	struct xe_tlb_inval_batch batch;
+	int err;

drivers/gpu/drm/xe/xe_vm_madvise.c static u8 xe_zap_ptes_in_madvise_range(struct xe_vm *vm, u64 start, u64 end) · line 249

Quoted 10 lines
drivers/gpu/drm/xe/xe_vm_madvise.c +3 -1
 
 	if (!tile_mask)
 		return 0;
 
 	xe_device_wmb(vm->xe);
 
-	return xe_vm_range_tilemask_tlb_inval(vm, start, end, tile_mask);
+	err = xe_tlb_inval_range_tilemask_submit(vm->xe, vm->usm.asid, start, end,
+						 tile_mask, &batch);
+	xe_tlb_inval_batch_wait(&batch);

No need to wait on error.

Quoted 20 lines
drivers/gpu/drm/xe/xe_vm_madvise.c +2 -0
+
+	return err;
 }
 
 static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madvise *args)
drivers/gpu/drm/xe/xe_vm_types.h +1 -0
index 1f6f7e30e751..de6544165cfa 100644
@@ -18,6 +18,7 @@
 #include "xe_device_types.h"
 #include "xe_pt_types.h"
 #include "xe_range_fence.h"
+#include "xe_tlb_inval_types.h"
 #include "xe_userptr.h"
 
 struct drm_pagemap;
Signature · 1 line
2.53.0
maintainer
#13 lore raw

Re: [PATCH v2 4/4] drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible

In reply to Thomas Hellström
Quoted 20 lines · Thomas Hellström

Now that the two-pass notifier flow uses xe_vma_userptr_do_inval() for the fence-wait + TLB-invalidate work, extend it to support a further deferred TLB wait:

- xe_vma_userptr_do_inval(): when the embedded finish handle is free, submit the TLB invalidation asynchronously (xe_vm_invalidate_vma_submit) and return &userptr->finish so the mmu_notifier core schedules a third pass. When the handle is occupied by a concurrent invalidation, fall back to the synchronous xe_vm_invalidate_vma() path.

- xe_vma_userptr_complete_tlb_inval(): new helper called from invalidate_finish when tlb_inval_submitted is set. Waits for the previously submitted batch and unmaps the gpusvm pages.

xe_vma_userptr_invalidate_finish() dispatches between the two helpers via tlb_inval_submitted, making the three possible flows explicit:

pass1 (fences pending) -> invalidate_finish -> do_inval (sync TLB)
pass1 (fences done) -> do_inval -> invalidate_finish

                          -> complete_tlb_inval (deferred TLB)
Quoted 9 lines

pass1 (finish occupied) -> do_inval (sync TLB, inline)

In multi-GPU scenarios this allows TLB flushes to be submitted on all GPUs in one pass before any of them are waited on.

Also adds xe_vm_invalidate_vma_submit() which submits the TLB range invalidation without blocking, populating a xe_tlb_inval_batch that the caller waits on separately.

As suggested in patch #2, maybe squash this into patch #2 as some of patch #2 is immediately tweaked / rewritten here.

A couple nits.

Quoted 33 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6
---
 drivers/gpu/drm/xe/xe_userptr.c | 60 +++++++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_userptr.h | 18 ++++++++++
 drivers/gpu/drm/xe/xe_vm.c      | 38 ++++++++++++++++-----
 drivers/gpu/drm/xe/xe_vm.h      |  2 ++
 4 files changed, 99 insertions(+), 19 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +3 -2
index 440b0a79d16f..a62b796afb93 100644
@@ -8,6 +8,7 @@
 
 #include <linux/mm.h>
 
+#include "xe_tlb_inval.h"
 #include "xe_trace_bo.h"
 
 /**
@@ -73,8 +74,8 @@ int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma)
 				    &ctx);
 }
 
-static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,
-				    bool is_deferred)
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma, bool is_deferred)
 {
 	struct xe_userptr *userptr = &uvma->userptr;
 	struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm · line 89

Quoted 7 lines
drivers/gpu/drm/xe/xe_userptr.c +1 -2
@@ -84,12 +85,23 @@ static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm
 	};
 	long err;
 
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
+	err = dma_resv_wait_timeout(xe_vm_resv(vm), DMA_RESV_USAGE_BOOKKEEP,
 				    false, MAX_SCHEDULE_TIMEOUT);

Unrelated.

drivers/gpu/drm/xe/xe_userptr.c static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm · line 93

Quoted 4 lines
drivers/gpu/drm/xe/xe_userptr.c +1 -0
 	XE_WARN_ON(err <= 0);
 
 	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		if (!userptr->finish_inuse) {

Since this is state machiney - should we have asserts on state? That typically the approach I take when I write stae machiney code. Self documenting plus immediatelt catches misuse.

So here an example would be:

xe_assert(.., !userptr->tlb_inval_submitted);

Quoted 21 lines
drivers/gpu/drm/xe/xe_userptr.c +14 -0
+			/*
+			 * Defer the TLB wait to an extra pass so the caller
+			 * can pipeline TLB flushes across GPUs before waiting
+			 * on any of them.
+			 */
+			userptr->finish_inuse = true;
+			userptr->tlb_inval_submitted = true;
+			err = xe_vm_invalidate_vma_submit(vma, &userptr->inval_batch);
+			XE_WARN_ON(err);
+			return &userptr->finish;
+		}
 		err = xe_vm_invalidate_vma(vma);
 		XE_WARN_ON(err);
 	}
@@ -98,6 +110,24 @@ static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm
 		userptr->finish_inuse = false;
 	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
 			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
+	return NULL;
+}
+

drivers/gpu/drm/xe/xe_userptr.c static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm · line 125

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.c +10 -0
+static void
+xe_vma_userptr_complete_tlb_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct drm_gpusvm_ctx ctx = {
+		.in_notifier = true,
+		.read_only = xe_vma_read_only(vma),
+	};
+

xe_svm_assert_in_notifier();

State machine asserts could be:

xe_assert(..., userptr->tlb_inval_submitted);
xe_assert(..., userptr->finish_inuse);

Quoted 12 lines
drivers/gpu/drm/xe/xe_userptr.c +5 -0
+	xe_tlb_inval_batch_wait(&userptr->inval_batch);
+	userptr->tlb_inval_submitted = false;
+	userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma->userptr.pages,
+			       xe_vma_size(vma) >> PAGE_SHIFT, &ctx);
 }
 
 static struct mmu_interval_notifier_finish *
@@ -141,13 +171,11 @@ xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct xe_userptr_vma *uvma)
 	 * If it's already in use, or all fences are already signaled,
 	 * proceed directly to invalidation without deferring.
 	 */

drivers/gpu/drm/xe/xe_userptr.c xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct xe_userptr_vma *uvma) · line 150

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.c +3 -5
-	if (signaled || userptr->finish_inuse) {
-		xe_vma_userptr_do_inval(vm, uvma, false);
-		return NULL;
-	}
+	if (signaled || userptr->finish_inuse)
+		return xe_vma_userptr_do_inval(vm, uvma, false);
 
+	/* Defer: the notifier core will call invalidate_finish once done. */
 	userptr->finish_inuse = true;
-

Unrelated.

Quoted 45 lines
drivers/gpu/drm/xe/xe_userptr.c +12 -2
 	return &userptr->finish;
 }
 
@@ -193,7 +221,15 @@ static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish
 		xe_vma_start(vma), xe_vma_size(vma));
 
 	down_write(&vm->svm.gpusvm.notifier_lock);
-	xe_vma_userptr_do_inval(vm, uvma, true);
+	/*
+	 * If a TLB invalidation was previously submitted (deferred from the
+	 * synchronous pass1 fallback), wait for it and unmap pages.
+	 * Otherwise, fences have now completed: invalidate the TLB and unmap.
+	 */
+	if (uvma->userptr.tlb_inval_submitted)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);
+	else
+		xe_vma_userptr_do_inval(vm, uvma, true);
 	up_write(&vm->svm.gpusvm.notifier_lock);
 	trace_xe_vma_userptr_invalidate_complete(vma);
 }
@@ -231,7 +267,9 @@ void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
 
 	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
 	if (finish)
-		xe_vma_userptr_do_inval(vm, uvma, true);
+		finish = xe_vma_userptr_do_inval(vm, uvma, true);
+	if (finish)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);
 }
 #endif
 
drivers/gpu/drm/xe/xe_userptr.h +2 -0
index 4f42db61fd62..7477009651c2 100644
@@ -14,6 +14,8 @@
 
 #include <drm/drm_gpusvm.h>
 
+#include "xe_tlb_inval_types.h"
+
 struct xe_vm;
 struct xe_vma;
 struct xe_userptr_vma;

drivers/gpu/drm/xe/xe_userptr.h struct xe_userptr { · line 74

Quoted 10 lines
drivers/gpu/drm/xe/xe_userptr.h +7 -0
@@ -63,6 +65,15 @@ struct xe_userptr {
 	 * Protected by @vm::svm.gpusvm.notifier_lock.
 	 */
 	struct mmu_interval_notifier_finish finish;
+
+	/**
+	 * @inval_batch: TLB invalidation batch for deferred completion.
+	 * Stores an in-flight TLB invalidation submitted during a two-pass
+	 * notifier so the wait can be deferred to a subsequent pass, allowing
+	 * multiple GPUs to be signalled before any of them are waited on.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.

In write mode?

Quoted 6 lines
drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	 */
+	struct xe_tlb_inval_batch inval_batch;
 	/**
 	 * @finish_inuse: Whether @finish is currently in use by an in-progress
 	 * two-pass invalidation.

drivers/gpu/drm/xe/xe_userptr.h struct xe_userptr { · line 88

Quoted 8 lines
drivers/gpu/drm/xe/xe_userptr.h +5 -0
@@ -70,6 +81,13 @@ struct xe_userptr {
 	 */
 	bool finish_inuse;
 
+	/**
+	 * @tlb_inval_submitted: Whether a TLB invalidation has been submitted
+	 * via @inval_batch and is pending completion.  When set, the next pass
+	 * must call xe_tlb_inval_batch_wait() before reusing @inval_batch.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.

In write mode?

Matt

Quoted 91 lines
drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	 */
+	bool tlb_inval_submitted;
 	/**
 	 * @initial_bind: user pointer has been bound at least once.
 	 * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
drivers/gpu/drm/xe/xe_vm.c +30 -8
index 7f29d2b2972d..fdad9329dfb4 100644
@@ -3967,20 +3967,23 @@ void xe_vm_unlock(struct xe_vm *vm)
 }
 
 /**
- * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
+ * xe_vm_invalidate_vma_submit - Submit a job to invalidate GPU mappings for
+ * VMA.
  * @vma: VMA to invalidate
+ * @batch: TLB invalidation batch to populate; caller must later call
+ *         xe_tlb_inval_batch_wait() on it to wait for completion
  *
  * Walks a list of page tables leaves which it memset the entries owned by this
- * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
- * complete.
+ * VMA to zero, invalidates the TLBs, but doesn't block waiting for TLB flush
+ * to complete, but instead populates @batch which can be waited on using
+ * xe_tlb_inval_batch_wait().
  *
  * Returns 0 for success, negative error code otherwise.
  */
-int xe_vm_invalidate_vma(struct xe_vma *vma)
+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct xe_tlb_inval_batch *batch)
 {
 	struct xe_device *xe = xe_vma_vm(vma)->xe;
 	struct xe_vm *vm = xe_vma_vm(vma);
-	struct xe_tlb_inval_batch _batch;
 	struct xe_tile *tile;
 	u8 tile_mask = 0;
 	int ret = 0;
@@ -4023,14 +4026,33 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
 
 	ret = xe_tlb_inval_range_tilemask_submit(xe, xe_vma_vm(vma)->usm.asid,
 						 xe_vma_start(vma), xe_vma_end(vma),
-						 tile_mask, &_batch);
+						 tile_mask, batch);
 
 	/* WRITE_ONCE pairs with READ_ONCE in xe_vm_has_valid_gpu_mapping() */
 	WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);
+	return ret;
+}
+
+/**
+ * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
+ * @vma: VMA to invalidate
+ *
+ * Walks a list of page tables leaves which it memset the entries owned by this
+ * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
+ * complete.
+ *
+ * Returns 0 for success, negative error code otherwise.
+ */
+int xe_vm_invalidate_vma(struct xe_vma *vma)
+{
+	struct xe_tlb_inval_batch batch;
+	int ret;
 
-	if (!ret)
-		xe_tlb_inval_batch_wait(&_batch);
+	ret = xe_vm_invalidate_vma_submit(vma, &batch);
+	if (ret)
+		return ret;
 
+	xe_tlb_inval_batch_wait(&batch);
 	return ret;
 }
 
drivers/gpu/drm/xe/xe_vm.h +2 -0
index 62f4b6fec0bc..0bc7ed23eeae 100644
@@ -242,6 +242,8 @@ struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
 
 int xe_vm_invalidate_vma(struct xe_vma *vma);
 
+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct xe_tlb_inval_batch *batch);
+
 int xe_vm_validate_protected(struct xe_vm *vm);
 
 static inline void xe_vm_queue_rebind_worker(struct xe_vm *vm)
Signature · 1 line
2.53.0
maintainer
#2 lore raw

Re: [PATCH v2 1/4] mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers

In reply to Thomas Hellström
Quoted 30 lines · Thomas Hellström

GPU use-cases for mmu_interval_notifiers with hmm often involve starting a gpu operation and then waiting for it to complete. These operations are typically context preemption or TLB flushing.

With single-pass notifiers per GPU this doesn't scale in multi-gpu scenarios. In those scenarios we'd want to first start preemption- or TLB flushing on all GPUs and as a second pass wait for them to complete.

One can do this on per-driver basis multiplexing per-driver notifiers but that would mean sharing the notifier "user" lock across all GPUs and that doesn't scale well either, so adding support for multi-pass in the core appears to be the right choice.

Implement two-pass capability in the mmu_interval_notifier. Use a linked list for the final passes to minimize the impact for use-cases that don't need the multi-pass functionality by avoiding a second interval tree walk, and to be able to easily pass data between the two passes.

v1:
- Restrict to two passes (Jason Gunthorpe)
- Improve on documentation (Jason Gunthorpe)
- Improve on function naming (Alistair Popple) v2:
- Include the invalidate_finish() callback in the struct mmu_interval_notifier_ops.
- Update documentation (GitHub Copilot:claude-sonnet-4.6)
- Use lockless list for list management.

Quoted 1 line
Cc Jason Gunthorpe <[email protected]>

I thought Jason had given a RB on previous revs - did you drop because enough has changed?

Quoted 20 lines
Cc Andrew Morton <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Alistair Popple <[email protected]>
Assisted-by GitHub Copilot:claude-sonnet-4.6 # Documentation only.
---
 include/linux/mmu_notifier.h | 38 +++++++++++++++++++++
 mm/mmu_notifier.c            | 64 +++++++++++++++++++++++++++++++-----
 2 files changed, 93 insertions(+), 9 deletions(-)
include/linux/mmu_notifier.h +0 -0
index 07a2bbaf86e9..de0e742ea808 100644

include/linux/mmu_notifier.h struct mmu_notifier { · line 238

Quoted 6 lines
include/linux/mmu_notifier.h +3 -0
@@ -233,16 +233,54 @@ struct mmu_notifier {
 	unsigned int users;
 };
 
+/**
+ * struct mmu_interval_notifier_finish - mmu_interval_notifier two-pass abstraction
+ * @link: List link for the notifiers pending pass list

Lockless list?

Quoted 35 lines
include/linux/mmu_notifier.h +30 -0
+ * @notifier: The mmu_interval_notifier for which the finish pass is called.
+ *
+ * Allocate, typically using GFP_NOWAIT in the interval notifier's first pass.
+ * If allocation fails (which is not unlikely under memory pressure), fall back
+ * to single-pass operation. Note that with a large number of notifiers
+ * implementing two passes, allocation with GFP_NOWAIT will become increasingly
+ * likely to fail, so consider implementing a small pool instead of using
+ * kmalloc() allocations.
+ *
+ * If the implementation needs to pass data between the two passes,
+ * the recommended way is to embed struct mmu_interval_notifier_finish into a larger
+ * structure that also contains the data needed to be shared. Keep in mind that
+ * a notifier callback can be invoked in parallel, and each invocation needs its
+ * own struct mmu_interval_notifier_finish.
+ */
+struct mmu_interval_notifier_finish {
+	struct llist_node link;
+	struct mmu_interval_notifier *notifier;
+};
+
 /**
  * struct mmu_interval_notifier_ops
  * @invalidate: Upon return the caller must stop using any SPTEs within this
  *              range. This function can sleep. Return false only if sleeping
  *              was required but mmu_notifier_range_blockable(range) is false.
+ * @invalidate_start: Similar to @invalidate, but intended for two-pass notifier
+ *                    callbacks where the call to @invalidate_start is the first
+ *                    pass and any struct mmu_interval_notifier_finish pointer
+ *                    returned in the @finish parameter describes the final pass.
+ *                    If @finish is %NULL on return, then no final pass will be
+ *                    called.
+ * @invalidate_finish: Called as the second pass for any notifier that returned
+ *                     a non-NULL @finish from @invalidate_start. The @finish
+ *                     pointer passed here is the same one returned by
+ *                     @invalidate_start.

include/linux/mmu_notifier.h struct mmu_notifier { · line 283

Quoted 10 lines
include/linux/mmu_notifier.h +5 -0
  */
 struct mmu_interval_notifier_ops {
 	bool (*invalidate)(struct mmu_interval_notifier *interval_sub,
 			   const struct mmu_notifier_range *range,
 			   unsigned long cur_seq);
+	bool (*invalidate_start)(struct mmu_interval_notifier *interval_sub,
+				 const struct mmu_notifier_range *range,
+				 unsigned long cur_seq,
+				 struct mmu_interval_notifier_finish **finish);
+	void (*invalidate_finish)(struct mmu_interval_notifier_finish *finish);

Should we complain somewhere if a caller registers a notifier with invalidate_start set but not invalidate_finish?

Matt

Quoted 123 lines
include/linux/mmu_notifier.h +0 -0
 };
 
 struct mmu_interval_notifier {
mm/mmu_notifier.c +55 -9
index a6cdf3674bdc..38acd5ef8eb0 100644
@@ -260,6 +260,15 @@ mmu_interval_read_begin(struct mmu_interval_notifier *interval_sub)
 }
 EXPORT_SYMBOL_GPL(mmu_interval_read_begin);
 
+static void mn_itree_finish_pass(struct llist_head *finish_passes)
+{
+	struct llist_node *first = llist_reverse_order(__llist_del_all(finish_passes));
+	struct mmu_interval_notifier_finish *f, *next;
+
+	llist_for_each_entry_safe(f, next, first, link)
+		f->notifier->ops->invalidate_finish(f);
+}
+
 static void mn_itree_release(struct mmu_notifier_subscriptions *subscriptions,
 			     struct mm_struct *mm)
 {
@@ -271,6 +280,7 @@ static void mn_itree_release(struct mmu_notifier_subscriptions *subscriptions,
 		.end = ULONG_MAX,
 	};
 	struct mmu_interval_notifier *interval_sub;
+	LLIST_HEAD(finish_passes);
 	unsigned long cur_seq;
 	bool ret;
 
@@ -278,11 +288,27 @@ static void mn_itree_release(struct mmu_notifier_subscriptions *subscriptions,
 		     mn_itree_inv_start_range(subscriptions, &range, &cur_seq);
 	     interval_sub;
 	     interval_sub = mn_itree_inv_next(interval_sub, &range)) {
-		ret = interval_sub->ops->invalidate(interval_sub, &range,
-						    cur_seq);
+		if (interval_sub->ops->invalidate_start) {
+			struct mmu_interval_notifier_finish *finish = NULL;
+
+			ret = interval_sub->ops->invalidate_start(interval_sub,
+								  &range,
+								  cur_seq,
+								  &finish);
+			if (ret && finish) {
+				finish->notifier = interval_sub;
+				__llist_add(&finish->link, &finish_passes);
+			}
+
+		} else {
+			ret = interval_sub->ops->invalidate(interval_sub,
+							    &range,
+							    cur_seq);
+		}
 		WARN_ON(!ret);
 	}
 
+	mn_itree_finish_pass(&finish_passes);
 	mn_itree_inv_end(subscriptions);
 }
 
@@ -430,7 +456,9 @@ static int mn_itree_invalidate(struct mmu_notifier_subscriptions *subscriptions,
 			       const struct mmu_notifier_range *range)
 {
 	struct mmu_interval_notifier *interval_sub;
+	LLIST_HEAD(finish_passes);
 	unsigned long cur_seq;
+	int err = 0;
 
 	for (interval_sub =
 		     mn_itree_inv_start_range(subscriptions, range, &cur_seq);
@@ -438,23 +466,41 @@ static int mn_itree_invalidate(struct mmu_notifier_subscriptions *subscriptions,
 	     interval_sub = mn_itree_inv_next(interval_sub, range)) {
 		bool ret;
 
-		ret = interval_sub->ops->invalidate(interval_sub, range,
-						    cur_seq);
+		if (interval_sub->ops->invalidate_start) {
+			struct mmu_interval_notifier_finish *finish = NULL;
+
+			ret = interval_sub->ops->invalidate_start(interval_sub,
+								  range,
+								  cur_seq,
+								  &finish);
+			if (ret && finish) {
+				finish->notifier = interval_sub;
+				__llist_add(&finish->link, &finish_passes);
+			}
+
+		} else {
+			ret = interval_sub->ops->invalidate(interval_sub,
+							    range,
+							    cur_seq);
+		}
 		if (!ret) {
 			if (WARN_ON(mmu_notifier_range_blockable(range)))
 				continue;
-			goto out_would_block;
+			err = -EAGAIN;
+			break;
 		}
 	}
-	return 0;
 
-out_would_block:
+	mn_itree_finish_pass(&finish_passes);
+
 	/*
 	 * On -EAGAIN the non-blocking caller is not allowed to call
 	 * invalidate_range_end()
 	 */
-	mn_itree_inv_end(subscriptions);
-	return -EAGAIN;
+	if (err)
+		mn_itree_inv_end(subscriptions);
+
+	return err;
 }
 
 static int mn_hlist_invalidate_range_start(
Signature · 1 line
2.53.0
author maintainer
#3 lore raw

Re: [PATCH v2 1/4] mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers

Hi, Matt,

On Mon, 2026-03-02 at 11:48 -0800, Matthew Brost wrote:

Thanks for reviewing.

Quoted 32 lines · Thomas Hellström
Quoted 31 lines

GPU use-cases for mmu_interval_notifiers with hmm often involve starting a gpu operation and then waiting for it to complete. These operations are typically context preemption or TLB flushing.

With single-pass notifiers per GPU this doesn't scale in multi-gpu scenarios. In those scenarios we'd want to first start preemption- or TLB flushing on all GPUs and as a second pass wait for them to complete.

One can do this on per-driver basis multiplexing per-driver notifiers but that would mean sharing the notifier "user" lock across all GPUs and that doesn't scale well either, so adding support
for multi-pass in the core appears to be the right choice.

Implement two-pass capability in the mmu_interval_notifier. Use a linked list for the final passes to minimize the impact for use-cases that don't need the multi-pass functionality by avoiding a second interval tree walk, and to be able to easily pass data between the two passes.

v1:
- Restrict to two passes (Jason Gunthorpe)
- Improve on documentation (Jason Gunthorpe)
- Improve on function naming (Alistair Popple) v2:
- Include the invalidate_finish() callback in the struct mmu_interval_notifier_ops.
- Update documentation (GitHub Copilot:claude-sonnet-4.6)
- Use lockless list for list management.

Quoted 5 lines
Quoted 1 line
Cc Jason Gunthorpe <[email protected]>

I thought Jason had given a RB on previous revs - did you drop because
enough has changed?

Yes. In particular the inclusion of invalidate_finish() in the ops, although IIRC that was actually suggested by Jason.

Quoted 17 lines

Quoted 16 lines
Cc Andrew Morton <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Alistair Popple <[email protected]>
Assisted-by GitHub Copilot:claude-sonnet-4.6 # Documentation only.

---
 include/linux/mmu_notifier.h | 38 +++++++++++++++++++++ mm/mmu_notifier.c            | 64 +++++++++++++++++++++++++++++++-
----

 2 files changed, 93 insertions(+), 9 deletions(-)
Quoted 15 lines
Quoted 8 lines
include/linux/mmu_notifier.h +0 -0
index 07a2bbaf86e9..de0e742ea808 100644
@@ -233,16 +233,54 @@ struct mmu_notifier {
  	unsigned int users;
  };
Quoted 5 lines


+/**
+ * struct mmu_interval_notifier_finish - mmu_interval_notifier two-pass abstraction
+ * @link: List link for the notifiers pending pass list

Lockless list?

Sure, Can add that.

Quoted 67 lines
Quoted 67 lines

+ * @notifier: The mmu_interval_notifier for which the finish pass is called.
+ *
+ * Allocate, typically using GFP_NOWAIT in the interval notifier's first pass.
+ * If allocation fails (which is not unlikely under memory pressure), fall back
+ * to single-pass operation. Note that with a large number of notifiers
+ * implementing two passes, allocation with GFP_NOWAIT will become increasingly
+ * likely to fail, so consider implementing a small pool instead of using
+ * kmalloc() allocations.
+ *
+ * If the implementation needs to pass data between the two passes,
+ * the recommended way is to embed struct mmu_interval_notifier_finish into a larger
+ * structure that also contains the data needed to be shared. Keep in mind that
+ * a notifier callback can be invoked in parallel, and each invocation needs its
+ * own struct mmu_interval_notifier_finish.
+ */

include/linux/mmu_notifier.h +5 -0
+struct mmu_interval_notifier_finish {
+	struct llist_node link;
+	struct mmu_interval_notifier *notifier;
+};
+

 /**
  * struct mmu_interval_notifier_ops
  * @invalidate: Upon return the caller must stop using any SPTEs within this
  *              range. This function can sleep. Return false only if sleeping
  *              was required but mmu_notifier_range_blockable(range) is false.
+ * @invalidate_start: Similar to @invalidate, but intended for two-pass notifier
+ *                    callbacks where the call to @invalidate_start is the first
+ *                    pass and any struct mmu_interval_notifier_finish pointer
+ *                    returned in the @finish parameter describes the final pass.
+ *                    If @finish is %NULL on return, then no final pass will be
+ *                    called.
+ * @invalidate_finish: Called as the second pass for any notifier that returned
+ *                     a non-NULL @finish from @invalidate_start. The @finish
+ *                     pointer passed here is the same one returned by
+ *                     @invalidate_start.
  */
 struct mmu_interval_notifier_ops {
  bool (*invalidate)(struct mmu_interval_notifier *interval_sub,
     const struct mmu_notifier_range *range, unsigned long cur_seq);

include/linux/mmu_notifier.h +1 -0
+	bool (*invalidate_start)(struct mmu_interval_notifier

*interval_sub,

include/linux/mmu_notifier.h +1 -0
+				 const struct mmu_notifier_range

*range,

Quoted 8 lines
Quoted 5 lines
include/linux/mmu_notifier.h +2 -0
+				 unsigned long cur_seq,
+				 struct

mmu_interval_notifier_finish **finish);

include/linux/mmu_notifier.h +1 -0
+	void (*invalidate_finish)(struct

mmu_interval_notifier_finish *finish);

Should we complain somewhere if a caller registers a notifier with invalidate_start set but not invalidate_finish?

Good idea. I'll update.

Thanks,
Thomas

Quoted 159 lines

Matt

Quoted 156 lines

 };

 struct mmu_interval_notifier {

mm/mmu_notifier.c +0 -0
index a6cdf3674bdc..38acd5ef8eb0 100644
@@ -260,6 +260,15 @@ mmu_interval_read_begin(struct
 mmu_interval_notifier *interval_sub)
  }
  EXPORT_SYMBOL_GPL(mmu_interval_read_begin);

mm/mmu_notifier.c +3 -0
+static void mn_itree_finish_pass(struct llist_head *finish_passes)
+{
+	struct llist_node *first =

llist_reverse_order(__llist_del_all(finish_passes));

mm/mmu_notifier.c +6 -0
+	struct mmu_interval_notifier_finish *f, *next;
+
+	llist_for_each_entry_safe(f, next, first, link)
+		f->notifier->ops->invalidate_finish(f);
+}
+

 static void mn_itree_release(struct mmu_notifier_subscriptions *subscriptions,
       struct mm_struct *mm)
 {

mm/mmu_notifier.c +1 -0
@@ -271,6 +280,7 @@ static void mn_itree_release(struct
 mmu_notifier_subscriptions *subscriptions,
  		.end = ULONG_MAX,
  	};
  	struct mmu_interval_notifier *interval_sub;
+	LLIST_HEAD(finish_passes);
  	unsigned long cur_seq;
  	bool ret;

mm/mmu_notifier.c +5 -2
@@ -278,11 +288,27 @@ static void mn_itree_release(struct
 mmu_notifier_subscriptions *subscriptions,
  		     mn_itree_inv_start_range(subscriptions,
 &range, &cur_seq);
  	     interval_sub;
  	     interval_sub = mn_itree_inv_next(interval_sub,
 &range)) {
-		ret = interval_sub->ops->invalidate(interval_sub,
 &range,
-						    cur_seq);
+		if (interval_sub->ops->invalidate_start) {
+			struct mmu_interval_notifier_finish
 *finish = NULL;
+
+			ret = interval_sub->ops-
 >invalidate_start(interval_sub,
+								 

&range,

mm/mmu_notifier.c +1 -0
+								 

cur_seq,

mm/mmu_notifier.c +1 -0
+								 

&finish);

mm/mmu_notifier.c +3 -0
+			if (ret && finish) {
+				finish->notifier = interval_sub;
+				__llist_add(&finish->link,

&finish_passes);

mm/mmu_notifier.c +4 -0
+			}
+
+		} else {
+			ret = interval_sub->ops-
Quoted 1 line

invalidate(interval_sub,

mm/mmu_notifier.c +1 -0
+							   

&range,

mm/mmu_notifier.c +1 -0
+							   

cur_seq);

mm/mmu_notifier.c +1 -0
+		}

  WARN_ON(!ret);
  }

mm/mmu_notifier.c +1 -0
+	mn_itree_finish_pass(&finish_passes);

  mn_itree_inv_end(subscriptions);
 }

mm/mmu_notifier.c +0 -0
@@ -430,7 +456,9 @@ static int mn_itree_invalidate(struct
 mmu_notifier_subscriptions *subscriptions,

         const struct mmu_notifier_range *range)
 {
  struct mmu_interval_notifier *interval_sub;

mm/mmu_notifier.c +1 -0
+	LLIST_HEAD(finish_passes);

  unsigned long cur_seq;

mm/mmu_notifier.c +1 -0
+	int err = 0;


  for (interval_sub = mn_itree_inv_start_range(subscriptions, range, &cur_seq);

mm/mmu_notifier.c +0 -0
@@ -438,23 +466,41 @@ static int mn_itree_invalidate(struct
 mmu_notifier_subscriptions *subscriptions,
  	     interval_sub = mn_itree_inv_next(interval_sub,
 range)) {
  		bool ret;

mm/mmu_notifier.c +0 -1
-		ret = interval_sub->ops->invalidate(interval_sub,

range,

mm/mmu_notifier.c +2 -1
-						    cur_seq);
+		if (interval_sub->ops->invalidate_start) {
+			struct mmu_interval_notifier_finish

*finish = NULL;

mm/mmu_notifier.c +2 -0
+
+			ret = interval_sub->ops-
Quoted 1 line

invalidate_start(interval_sub,

mm/mmu_notifier.c +1 -0
+								 

range,

mm/mmu_notifier.c +1 -0
+								 

cur_seq,

mm/mmu_notifier.c +1 -0
+								 

&finish);

mm/mmu_notifier.c +3 -0
+			if (ret && finish) {
+				finish->notifier = interval_sub;
+				__llist_add(&finish->link,

&finish_passes);

mm/mmu_notifier.c +4 -0
+			}
+
+		} else {
+			ret = interval_sub->ops-
Quoted 1 line

invalidate(interval_sub,

mm/mmu_notifier.c +2 -0
+							    range,
+							   

cur_seq);

mm/mmu_notifier.c +1 -0
+		}

  if (!ret) {
  if
(WARN_ON(mmu_notifier_range_blockable(range)))
  continue;

mm/mmu_notifier.c +2 -1
-			goto out_would_block;
+			err = -EAGAIN;
+			break;

  }
  }

mm/mmu_notifier.c +0 -1
-	return 0;

mm/mmu_notifier.c +2 -1
-out_would_block:
+	mn_itree_finish_pass(&finish_passes);
+

  /*
  * On -EAGAIN the non-blocking caller is not allowed to call
  * invalidate_range_end()
  */

mm/mmu_notifier.c +4 -2
-	mn_itree_inv_end(subscriptions);
-	return -EAGAIN;
+	if (err)
+		mn_itree_inv_end(subscriptions);
+
+	return err;

 }

 static int mn_hlist_invalidate_range_start(

Signature · 1 line
2.53.0
author maintainer
#6 lore raw

Re: [PATCH v2 2/4] drm/xe/userptr: Convert invalidation to two-pass MMU notifier

In reply to Matthew Brost

Hi,

On Mon, 2026-03-02 at 10:57 -0800, Matthew Brost wrote:

Thanks for reviewing,

Quoted 35 lines · Thomas Hellström
Quoted 23 lines

In multi-GPU scenarios, asynchronous GPU job latency is a bottleneck if
each notifier waits for its own GPU before returning. The two-pass mmu_interval_notifier infrastructure allows deferring the wait to a second pass, so all GPUs can be signalled in the first pass before any of them are waited on.

Convert the userptr invalidation to use the two-pass model:

Use invalidate_start as the first pass to mark the VMA for repin and
enable software signalling on the VM reservation fences to start any
gpu work needed for signaling. Fall back to completing the work synchronously if all fences are already signalled, or if a concurrent
invalidation is already using the embedded finish structure.

Use invalidate_finish as the second pass to wait for the reservation
fences to complete, invalidate the GPU TLB in fault mode, and unmap the gpusvm pages.

Quoted 7 lines

Embed a struct mmu_interval_notifier_finish in struct xe_userptr to avoid dynamic allocation in the notifier callback. Use a finish_inuse
flag to prevent two concurrent invalidations from using it simultaneously; fall back to the synchronous path for the second caller.

A couple nits below. Also for clarity, I'd probably rework this series...

Quoted 6 lines

 - Move patch #3 to 2nd to patch
 - Squash patch #2, #4 into a single patch, make thia the last patch

Let me know what you think on the reordering. I'm looking with the series applied and aside from nits below everything in xe_userptr.c looks good to me.

We could do that, but unless you insist, I'd like to keep the current ordering since patch #2 is a very simple example on how to convert and also since #4 makes the notifier rather complex so it'd be good to be able to bisect in between those two.

Quoted 29 lines

Quoted 28 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6

---
 drivers/gpu/drm/xe/xe_userptr.c | 96 +++++++++++++++++++++++++----
----
 drivers/gpu/drm/xe/xe_userptr.h | 14 +++++

 2 files changed, 88 insertions(+), 22 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +0 -0
index e120323c43bc..440b0a79d16f 100644
@@ -73,18 +73,42 @@ int xe_vma_userptr_pin_pages(struct
 xe_userptr_vma *uvma)
  				    &ctx);
  }


-static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+				    bool is_deferred)

 {
  struct xe_userptr *userptr = &uvma->userptr; struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c +0 -2
-	struct dma_resv_iter cursor;
-	struct dma_fence *fence;
Quoted 8 lines
Quoted 6 lines

  struct drm_gpusvm_ctx ctx = { .in_notifier = true, .read_only = xe_vma_read_only(vma), };
  long err;

xe_svm_assert_in_notifier(vm);

This actually reveals a pre-existing bug. Since this code is called with the notifier lock held in read mode, and the vm resv held in the userptr invalidation injection. That assert would hit.

Also drm_gpusvm_unmap_pages() below will assert the same thing, (also affected by the bug)
but for clarity I agree we might want to have an assert here, but then it would need to include the other mode as well, and I'd need to update the locking docs for the two-pass state.

Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/xe/xe_userptr.c +13 -0
+	err = dma_resv_wait_timeout(xe_vm_resv(vm),
+				    DMA_RESV_USAGE_BOOKKEEP,
+				    false, MAX_SCHEDULE_TIMEOUT);
+	XE_WARN_ON(err <= 0);
+
+	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		err = xe_vm_invalidate_vma(vma);
+		XE_WARN_ON(err);
+	}
+
+	if (is_deferred)
+		userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-
Quoted 1 line

userptr.pages,

Quoted 16 lines
Quoted 7 lines
drivers/gpu/drm/xe/xe_userptr.c +1 -0
+			       xe_vma_size(vma) >> PAGE_SHIFT,

&ctx);

drivers/gpu/drm/xe/xe_userptr.c +4 -0
+}
+
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct

xe_userptr_vma *uvma)

drivers/gpu/drm/xe/xe_userptr.c int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma) · line 111

Quoted 7 lines
drivers/gpu/drm/xe/xe_userptr.c +7 -0
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct dma_resv_iter cursor;
+	struct dma_fence *fence;
+	bool signaled = true;
+

xe_svm_assert_in_notifier(vm);

Same here.

Quoted 165 lines
Quoted 165 lines

  /*
  * Tell exec and rebind worker they need to repin and rebind this
  * userptr.

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -105,27 +129,32 @@ static void __vma_userptr_invalidate(struct

xe_vm *vm, struct xe_userptr_vma *uv
  */
  dma_resv_iter_begin(&cursor, xe_vm_resv(vm), DMA_RESV_USAGE_BOOKKEEP);

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-	dma_resv_for_each_fence_unlocked(&cursor, fence)
+	dma_resv_for_each_fence_unlocked(&cursor, fence) {

  dma_fence_enable_sw_signaling(fence);

drivers/gpu/drm/xe/xe_userptr.c +3 -0
+		if (signaled && !dma_fence_is_signaled(fence))
+			signaled = false;
+	}

  dma_resv_iter_end(&cursor);

drivers/gpu/drm/xe/xe_userptr.c +3 -8
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
-				    false, MAX_SCHEDULE_TIMEOUT);
-	XE_WARN_ON(err <= 0);
-
-	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
-		err = xe_vm_invalidate_vma(vma);
-		XE_WARN_ON(err);
+	/*
+	 * Only one caller at a time can use the multi-pass state.
+	 * If it's already in use, or all fences are already

signaled,

drivers/gpu/drm/xe/xe_userptr.c +5 -0
+	 * proceed directly to invalidation without deferring.
+	 */
+	if (signaled || userptr->finish_inuse) {
+		xe_vma_userptr_do_inval(vm, uvma, false);
+		return NULL;

  }

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-
Quoted 1 line

userptr.pages,

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-			       xe_vma_size(vma) >> PAGE_SHIFT,

&ctx);

drivers/gpu/drm/xe/xe_userptr.c +3 -0
+	userptr->finish_inuse = true;
+
+	return &userptr->finish;

 }

-static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-				   const struct mmu_notifier_range

*range,

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-				   unsigned long cur_seq)
+static bool xe_vma_userptr_invalidate_start(struct

mmu_interval_notifier *mni,

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+					    const struct

mmu_notifier_range *range,

drivers/gpu/drm/xe/xe_userptr.c +2 -0
+					    unsigned long cur_seq,
+					    struct

mmu_interval_notifier_finish **p_finish)
 {
  struct xe_userptr_vma *uvma = container_of(mni, typeof(*uvma), userptr.notifier);
  struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -138,21 +167,40 @@ static bool vma_userptr_invalidate(struct
 mmu_interval_notifier *mni,
  		return false;


  vm_dbg(&xe_vma_vm(vma)->xe->drm,

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-	       "NOTIFIER: addr=0x%016llx, range=0x%016llx",
+	       "NOTIFIER PASS1: addr=0x%016llx, range=0x%016llx",

  xe_vma_start(vma), xe_vma_size(vma));
  down_write(&vm->svm.gpusvm.notifier_lock); mmu_interval_set_seq(mni, cur_seq);

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	__vma_userptr_invalidate(vm, uvma);
+	*p_finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+

  up_write(&vm->svm.gpusvm.notifier_lock);

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	trace_xe_vma_userptr_invalidate_complete(vma);
+	if (!*p_finish)
+		trace_xe_vma_userptr_invalidate_complete(vma);


  return true;
 }

+static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish *finish)

drivers/gpu/drm/xe/xe_userptr.c +2 -0
+{
+	struct xe_userptr_vma *uvma = container_of(finish,

typeof(*uvma), userptr.finish);

drivers/gpu/drm/xe/xe_userptr.c +13 -0
+	struct xe_vma *vma = &uvma->vma;
+	struct xe_vm *vm = xe_vma_vm(vma);
+
+	vm_dbg(&xe_vma_vm(vma)->xe->drm,
+	       "NOTIFIER PASS2: addr=0x%016llx, range=0x%016llx",
+		xe_vma_start(vma), xe_vma_size(vma));
+
+	down_write(&vm->svm.gpusvm.notifier_lock);
+	xe_vma_userptr_do_inval(vm, uvma, true);
+	up_write(&vm->svm.gpusvm.notifier_lock);
+	trace_xe_vma_userptr_invalidate_complete(vma);
+}
+

 static const struct mmu_interval_notifier_ops
vma_userptr_notifier_ops = {

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	.invalidate = vma_userptr_invalidate,
+	.invalidate_start = xe_vma_userptr_invalidate_start,
+	.invalidate_finish = xe_vma_userptr_invalidate_finish,

 };

 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)

drivers/gpu/drm/xe/xe_userptr.c +1 -0
@@ -164,6 +212,7 @@ static const struct mmu_interval_notifier_ops
 vma_userptr_notifier_ops = {
   */
  void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
  {
+	static struct mmu_interval_notifier_finish *finish;
  	struct xe_vm *vm = xe_vma_vm(&uvma->vma);


  /* Protect against concurrent userptr pinning */

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -179,7 +228,10 @@ void xe_vma_userptr_force_invalidate(struct
 xe_userptr_vma *uvma)
  	if (!mmu_interval_read_retry(&uvma->userptr.notifier,

       uvma-

Quoted 1 line

userptr.pages.notifier_seq))

  uvma->userptr.pages.notifier_seq -= 2;

drivers/gpu/drm/xe/xe_userptr.c +4 -1
-	__vma_userptr_invalidate(vm, uvma);
+
+	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+	if (finish)
+		xe_vma_userptr_do_inval(vm, uvma, true);

 }
 #endif

drivers/gpu/drm/xe/xe_userptr.h +0 -0
index ef801234991e..4f42db61fd62 100644
@@ -57,12 +57,26 @@ struct xe_userptr {
  	 */
  	struct mmu_interval_notifier notifier;

drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	/**
+	 * @finish: MMU notifier finish structure for two-pass

invalidation.

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * Embedded here to avoid allocation in the notifier

callback.

drivers/gpu/drm/xe/xe_userptr.h +5 -0
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	struct mmu_interval_notifier_finish finish;
+	/**
+	 * @finish_inuse: Whether @finish is currently in use by

an in-progress

drivers/gpu/drm/xe/xe_userptr.h +5 -0
+	 * two-pass invalidation.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	bool finish_inuse;
+

  /**
  * @initial_bind: user pointer has been bound at least once.
  * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
  * read: vm->svm.gpusvm.notifier_lock in write mode or vm-

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

resv held.

  */
  bool initial_bind;
+

Unrelated.

Sure. Will fix.

Thanks,
Thomas

Quoted 9 lines

Matt

Quoted 6 lines

 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT) u32 divisor;
 #endif

Signature · 1 line
2.53.0
author maintainer
#10 lore raw

Re: [PATCH v2 3/4] drm/xe: Split TLB invalidation into submit and wait steps

In reply to Matthew Brost
Quoted 72 lines · Matthew Brost
Quoted 9 lines · Thomas Hellström

xe_vm_range_tilemask_tlb_inval() submits TLB invalidation requests to
all GTs in a tile mask and then immediately waits for them to complete
before returning. This is fine for the existing callers, but a subsequent patch will need to defer the wait in order to overlap TLB
invalidations across multiple VMAs.

Quoted 7 lines

Introduce xe_tlb_inval_range_tilemask_submit() and xe_tlb_inval_batch_wait() in xe_tlb_inval.c as the submit and wait halves respectively. The batch of fences is carried in the new xe_tlb_inval_batch structure. Remove xe_vm_range_tilemask_tlb_inval()
and convert all three call sites to the new API.

Mostly nits...

Quoted 48 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6

---
 drivers/gpu/drm/xe/xe_svm.c             |  6 +- drivers/gpu/drm/xe/xe_tlb_inval.c       | 82
+++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_tlb_inval.h       |  6 ++ drivers/gpu/drm/xe/xe_tlb_inval_types.h | 14 +++++ drivers/gpu/drm/xe/xe_vm.c              | 69 +++------------------ drivers/gpu/drm/xe/xe_vm.h              |  3 - drivers/gpu/drm/xe/xe_vm_madvise.c      |  9 ++- drivers/gpu/drm/xe/xe_vm_types.h        |  1 +

 8 files changed, 123 insertions(+), 67 deletions(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 002b6c22ad3f..6ea4972c2791 100644
@@ -19,6 +19,7 @@
  #include "xe_pt.h"
  #include "xe_svm.h"
  #include "xe_tile.h"
+#include "xe_tlb_inval.h"
  #include "xe_ttm_vram_mgr.h"
  #include "xe_vm.h"
  #include "xe_vm_types.h"
@@ -225,6 +226,7 @@ static void xe_svm_invalidate(struct drm_gpusvm
 *gpusvm,

        const struct mmu_notifier_range *mmu_range)
 {
  struct xe_vm *vm = gpusvm_to_vm(gpusvm);

drivers/gpu/drm/xe/xe_svm.c +1 -0
+	struct xe_tlb_inval_batch _batch;

  struct xe_device *xe = vm->xe;
  struct drm_gpusvm_range *r, *first;
  struct xe_tile *tile;

drivers/gpu/drm/xe/xe_svm.c +0 -0
@@ -276,7 +278,9 @@ static void xe_svm_invalidate(struct drm_gpusvm
 *gpusvm,


  xe_device_wmb(xe);

drivers/gpu/drm/xe/xe_svm.c +0 -1
-	err = xe_vm_range_tilemask_tlb_inval(vm, adj_start,

adj_end, tile_mask);

drivers/gpu/drm/xe/xe_svm.c +1 -0
+	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid,

adj_start, adj_end,

drivers/gpu/drm/xe/xe_svm.c +1 -0
+						 tile_mask,

&_batch);

drivers/gpu/drm/xe/xe_svm.c

Quoted 1 line
drivers/gpu/drm/xe/xe_svm.c +1 -0
+	xe_tlb_inval_batch_wait(&_batch);

No need to call wait on an error but it is harmless.

Quoted 4 lines

So you could write it like this:

if (!WARN_ON_ONCE(err))

	xe_tlb_inval_batch_wait(&_batch);

Sure.

Quoted 30 lines
Quoted 24 lines

  WARN_ON_ONCE(err);

 range_notifier_event_end:

drivers/gpu/drm/xe/xe_tlb_inval.c +0 -0
index 933f30fb617d..343e37cfe715 100644
@@ -486,3 +486,85 @@ bool xe_tlb_inval_idle(struct xe_tlb_inval
 *tlb_inval)
  	guard(spinlock_irq)(&tlb_inval->pending_lock);
  	return list_is_singular(&tlb_inval->pending_fences);

 }

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+
+/**
+ * xe_tlb_inval_batch_wait() - Wait for all fences in a TLB

invalidation batch
+ * @batch: Batch of TLB invalidation fences to wait on
+ *
+ * Waits for every fence in @batch to signal, then resets @batch so it can be
+ * reused for a subsequent invalidation.
+ */

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 499

Quoted 3 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch)
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];

Would this be better:

Quoted 3 lines

s/&batch->fence[0]/batch->fence

Personal preference I guess.

Yeah, I typically use the former to make it easier for
the reader to remember we're pointing to the first element of an array.

Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+	unsigned int i;
+
+	for (i = 0; i < batch->num_fences; ++i)
+		xe_tlb_inval_fence_wait(fence++);
+
+	batch->num_fences = 0;
+}
+
+/**
+ * xe_tlb_inval_range_tilemask_submit() - Submit TLB invalidations

for an
+ * address range on a tile mask
+ * @xe: The xe device
+ * @asid: Address space ID
+ * @start: start address

Quoted 8 lines
Quoted 6 lines

+ * @end: end address
+ * @tile_mask: mask for which gt's issue tlb invalidation
+ * @batch: Batch of tlb invalidate fences
+ *
+ * Issue a range based TLB invalidation for gt's in tilemask
+ *

Mention no need to wait on batch if this function returns an error?

Sure.

Quoted 46 lines
Quoted 46 lines

+ * Returns 0 for success, negative error code otherwise.
+ */
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+				       u64 start, u64 end, u8

tile_mask,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+				       struct xe_tlb_inval_batch

*batch)

drivers/gpu/drm/xe/xe_tlb_inval.c +16 -0
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];
+	struct xe_tile *tile;
+	u32 fence_id = 0;
+	u8 id;
+	int err;
+
+	batch->num_fences = 0;
+	if (!tile_mask)
+		return 0;
+
+	for_each_tile(tile, xe, id) {
+		if (!(tile_mask & BIT(id)))
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+					&fence[fence_id], true);
+
+		err = xe_tlb_inval_range(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_tlb_inval.c +9 -0
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+
+		if (!tile->media_gt)
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+					&fence[fence_id], true);
+
+		err = xe_tlb_inval_range(&tile->media_gt-
Quoted 1 line

tlb_inval,

Quoted 12 lines

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 565

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_tlb_inval.c +8 -0
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+	}
+
+wait:
+	batch->num_fences = fence_id;

Should 'batch->num_fences' only get set on success?

We need it for the error wait below, after which it gets cleared.

Quoted 168 lines
Quoted 140 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +5 -0
+	if (err)
+		xe_tlb_inval_batch_wait(batch);
+
+	return err;
+}
drivers/gpu/drm/xe/xe_tlb_inval.h +0 -0
index 62089254fa23..a76b7823a5f2 100644
@@ -45,4 +45,10 @@ void xe_tlb_inval_done_handler(struct
 xe_tlb_inval *tlb_inval, int seqno);


 bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval);
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,

drivers/gpu/drm/xe/xe_tlb_inval.h +1 -0
+				       u64 start, u64 end, u8

tile_mask,

drivers/gpu/drm/xe/xe_tlb_inval.h +1 -0
+				       struct xe_tlb_inval_batch

*batch);

drivers/gpu/drm/xe/xe_tlb_inval.h +3 -0
+
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch);
+

 #endif /* _XE_TLB_INVAL_ */

drivers/gpu/drm/xe/xe_tlb_inval_types.h +0 -0
index 3b089f90f002..3d1797d186fd 100644
@@ -9,6 +9,8 @@
  #include <linux/workqueue.h>
  #include <linux/dma-fence.h>

drivers/gpu/drm/xe/xe_tlb_inval_types.h +2 -0
+#include "xe_device_types.h"
+

 struct drm_suballoc;
 struct xe_tlb_inval;

drivers/gpu/drm/xe/xe_tlb_inval_types.h +0 -0
@@ -132,4 +134,16 @@ struct xe_tlb_inval_fence {
  	ktime_t inval_time;
  };

drivers/gpu/drm/xe/xe_tlb_inval_types.h +8 -0
+/**
+ * struct xe_tlb_inval_batch - Batch of TLB invalidation fences
+ *
+ * Holds one fence per GT covered by a TLB invalidation request.
+ */
+struct xe_tlb_inval_batch {
+	/** @fence: per-GT TLB invalidation fences */
+	struct xe_tlb_inval_fence fence[XE_MAX_TILES_PER_DEVICE *

XE_MAX_GT_PER_TILE];

drivers/gpu/drm/xe/xe_tlb_inval_types.h +4 -0
+	/** @num_fences: number of valid entries in @fence */
+	unsigned int num_fences;
+};
+

 #endif

drivers/gpu/drm/xe/xe_vm.c +0 -0
index 548b0769b3ef..7f29d2b2972d 100644
@@ -3966,66 +3966,6 @@ void xe_vm_unlock(struct xe_vm *vm)
  	dma_resv_unlock(xe_vm_resv(vm));
  }


-/**
- * xe_vm_range_tilemask_tlb_inval - Issue a TLB invalidation on this tilemask for an
- * address range
- * @vm: The VM
- * @start: start address
- * @end: end address
- * @tile_mask: mask for which gt's issue tlb invalidation
- *
- * Issue a range based TLB invalidation for gt's in tilemask
- *
- * Returns 0 for success, negative error code otherwise.
- */

drivers/gpu/drm/xe/xe_vm.c +0 -5
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask)
-{
-	struct xe_tlb_inval_fence
-		fence[XE_MAX_TILES_PER_DEVICE *

XE_MAX_GT_PER_TILE];

drivers/gpu/drm/xe/xe_vm.c +0 -13
-	struct xe_tile *tile;
-	u32 fence_id = 0;
-	u8 id;
-	int err;
-
-	if (!tile_mask)
-		return 0;
-
-	for_each_tile(tile, vm->xe, id) {
-		if (!(tile_mask & BIT(id)))
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -3
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_vm.c +0 -9
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-
-		if (!tile->media_gt)
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -3
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_vm.c +0 -13
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-	}
-
-wait:
-	for (id = 0; id < fence_id; ++id)
-		xe_tlb_inval_fence_wait(&fence[id]);
-
-	return err;
-}
-

 /**
  * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
  * @vma: VMA to invalidate

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 3983

Quoted 4 lines
drivers/gpu/drm/xe/xe_vm.c +1 -0
@@ -4040,6 +3980,7 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
  {
  	struct xe_device *xe = xe_vma_vm(vma)->xe;
  	struct xe_vm *vm = xe_vma_vm(vma);
+	struct xe_tlb_inval_batch _batch;

Why not just 'batch'?

Quoted 21 lines
drivers/gpu/drm/xe/xe_vm.c +0 -0
  	struct xe_tile *tile;
  	u8 tile_mask = 0;
  	int ret = 0;
@@ -4080,12 +4021,16 @@ int xe_vm_invalidate_vma(struct xe_vma
 *vma)


  xe_device_wmb(xe);

drivers/gpu/drm/xe/xe_vm.c +0 -1
-	ret = xe_vm_range_tilemask_tlb_inval(xe_vma_vm(vma),

xe_vma_start(vma),

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					     xe_vma_end(vma),

tile_mask);

drivers/gpu/drm/xe/xe_vm.c +1 -0
+	ret = xe_tlb_inval_range_tilemask_submit(xe,

xe_vma_vm(vma)->usm.asid,

drivers/gpu/drm/xe/xe_vm.c +1 -0
+						

xe_vma_start(vma), xe_vma_end(vma),

drivers/gpu/drm/xe/xe_vm.c +1 -0
+						 tile_mask,

&_batch);

  /* WRITE_ONCE pairs with READ_ONCE in
xe_vm_has_valid_gpu_mapping() */

Quoted 8 lines

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 4033

Quoted 5 lines

  WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);

drivers/gpu/drm/xe/xe_vm.c +3 -0
+	if (!ret)
+		xe_tlb_inval_batch_wait(&_batch);
+

Here we skip the wait on error, hence my suggestion to skip waits in other code paths or at a minimum make call sematics consistent.

Makes sense.

Quoted 51 lines
Quoted 51 lines

  return ret;
 }

drivers/gpu/drm/xe/xe_vm.h +0 -0
index f849e369432b..62f4b6fec0bc 100644
@@ -240,9 +240,6 @@ struct dma_fence *xe_vm_range_rebind(struct
 xe_vm *vm,
  struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
  				     struct xe_svm_range *range);

drivers/gpu/drm/xe/xe_vm.h +0 -3
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask);
-

 int xe_vm_invalidate_vma(struct xe_vma *vma);

 int xe_vm_validate_protected(struct xe_vm *vm);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
index 95bf53cc29e3..39717026e84f 100644
@@ -12,6 +12,7 @@
  #include "xe_pat.h"
  #include "xe_pt.h"
  #include "xe_svm.h"
+#include "xe_tlb_inval.h"


 struct xe_vmas_in_madvise_range {
  u64 addr;

drivers/gpu/drm/xe/xe_vm_madvise.c +0 -0
@@ -235,13 +236,19 @@ static u8 xe_zap_ptes_in_madvise_range(struct
 xe_vm *vm, u64 start, u64 end)

 static int xe_vm_invalidate_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 {
  u8 tile_mask = xe_zap_ptes_in_madvise_range(vm, start, end);

drivers/gpu/drm/xe/xe_vm_madvise.c +2 -0
+	struct xe_tlb_inval_batch batch;
+	int err;


  if (!tile_mask)
  return 0;

  xe_device_wmb(vm->xe);

drivers/gpu/drm/xe/xe_vm_madvise.c +0 -1
-	return xe_vm_range_tilemask_tlb_inval(vm, start, end,

tile_mask);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+	err = xe_tlb_inval_range_tilemask_submit(vm->xe, vm-
Quoted 6 lines

drivers/gpu/drm/xe/xe_vm_madvise.c static u8 xe_zap_ptes_in_madvise_range(struct xe_vm *vm, u64 start, u64 end) · line 249

Quoted 4 lines
Quoted 1 line

usm.asid, start, end,

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+						 tile_mask,

&batch);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+	xe_tlb_inval_batch_wait(&batch);

No need to wait on error.

Will fix

Thanks,
Thomas

Quoted 23 lines
Quoted 23 lines
drivers/gpu/drm/xe/xe_vm_madvise.c +2 -0
+
+	return err;

 }

 static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madvise *args)

drivers/gpu/drm/xe/xe_vm_types.h +1 -0
index 1f6f7e30e751..de6544165cfa 100644
@@ -18,6 +18,7 @@
  #include "xe_device_types.h"
  #include "xe_pt_types.h"
  #include "xe_range_fence.h"
+#include "xe_tlb_inval_types.h"
  #include "xe_userptr.h"


 struct drm_pagemap;

Signature · 1 line
2.53.0
maintainer
#7 lore raw

Re: [PATCH v2 2/4] drm/xe/userptr: Convert invalidation to two-pass MMU notifier

In reply to Thomas Hellström
Quoted 44 lines · Thomas Hellström

Hi,

On Mon, 2026-03-02 at 10:57 -0800, Matthew Brost wrote:

Thanks for reviewing,

Quoted 38 lines · Thomas Hellström
Quoted 23 lines

In multi-GPU scenarios, asynchronous GPU job latency is a bottleneck if
each notifier waits for its own GPU before returning. The two-pass mmu_interval_notifier infrastructure allows deferring the wait to a second pass, so all GPUs can be signalled in the first pass before any of them are waited on.

Convert the userptr invalidation to use the two-pass model:

Use invalidate_start as the first pass to mark the VMA for repin and
enable software signalling on the VM reservation fences to start any
gpu work needed for signaling. Fall back to completing the work synchronously if all fences are already signalled, or if a concurrent
invalidation is already using the embedded finish structure.

Use invalidate_finish as the second pass to wait for the reservation
fences to complete, invalidate the GPU TLB in fault mode, and unmap the gpusvm pages.

Quoted 7 lines

Embed a struct mmu_interval_notifier_finish in struct xe_userptr to avoid dynamic allocation in the notifier callback. Use a finish_inuse
flag to prevent two concurrent invalidations from using it simultaneously; fall back to the synchronous path for the second caller.

A couple nits below. Also for clarity, I'd probably rework this series...

 - Move patch #3 to 2nd to patch
 - Squash patch #2, #4 into a single patch, make thia the last patch

Quoted 9 lines
Quoted 3 lines

Let me know what you think on the reordering. I'm looking with the series applied and aside from nits below everything in xe_userptr.c looks good to me.

We could do that, but unless you insist, I'd like to keep the current ordering since patch #2 is a very simple example on how to convert and also since #4 makes the notifier rather complex so it'd be good to be able to bisect in between those two.

I think it is fine the way you have it - I never have strong opinions of stuff like this. For me to review, I just had to apply the series to a branch to get a full picture / verify all flows were correct.

Quoted 44 lines
Quoted 29 lines

Quoted 28 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6

---
 drivers/gpu/drm/xe/xe_userptr.c | 96 +++++++++++++++++++++++++----
----
 drivers/gpu/drm/xe/xe_userptr.h | 14 +++++

 2 files changed, 88 insertions(+), 22 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +0 -0
index e120323c43bc..440b0a79d16f 100644
@@ -73,18 +73,42 @@ int xe_vma_userptr_pin_pages(struct
 xe_userptr_vma *uvma)
  				    &ctx);
  }


-static void __vma_userptr_invalidate(struct xe_vm *vm, struct xe_userptr_vma *uvma)
+static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+				    bool is_deferred)

 {
  struct xe_userptr *userptr = &uvma->userptr; struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c +0 -2
-	struct dma_resv_iter cursor;
-	struct dma_fence *fence;
Quoted 8 lines
Quoted 6 lines

  struct drm_gpusvm_ctx ctx = { .in_notifier = true, .read_only = xe_vma_read_only(vma), };
  long err;

xe_svm_assert_in_notifier(vm);

This actually reveals a pre-existing bug. Since this code is called with the notifier lock held in read mode, and the vm resv held in the userptr invalidation injection. That assert would hit.

Quoted 6 lines

Also drm_gpusvm_unmap_pages() below will assert the same thing, (also affected by the bug)
but for clarity I agree we might want to have an assert here, but then it would need to include the other mode as well, and I'd need to update the locking docs for the two-pass state.

Right! I have pointed this out Auld as this popped in my testing implementing the CPU bind / ULLS series as I enabled DRM_XE_USERPTR_INVAL_INJECT in my testing. We should fixup drm_gpusvm_unmap_pages soonish too + enable DRM_XE_USERPTR_INVAL_INJECT in some CI runs too.

I think some lockdep assert would be good - even if it just the non-write mode version with maybe a brief explaination the error injection path can do this in read mode while the notifier path does this in write mode.

Matt

Quoted 222 lines
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/xe/xe_userptr.c +13 -0
+	err = dma_resv_wait_timeout(xe_vm_resv(vm),
+				    DMA_RESV_USAGE_BOOKKEEP,
+				    false, MAX_SCHEDULE_TIMEOUT);
+	XE_WARN_ON(err <= 0);
+
+	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
+		err = xe_vm_invalidate_vma(vma);
+		XE_WARN_ON(err);
+	}
+
+	if (is_deferred)
+		userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-
Quoted 1 line

userptr.pages,

Quoted 16 lines
Quoted 7 lines
drivers/gpu/drm/xe/xe_userptr.c +1 -0
+			       xe_vma_size(vma) >> PAGE_SHIFT,

&ctx);

drivers/gpu/drm/xe/xe_userptr.c +4 -0
+}
+
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_invalidate_pass1(struct xe_vm *vm, struct

xe_userptr_vma *uvma)

drivers/gpu/drm/xe/xe_userptr.c int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma) · line 111

Quoted 7 lines
drivers/gpu/drm/xe/xe_userptr.c +7 -0
+{
+	struct xe_userptr *userptr = &uvma->userptr;
+	struct xe_vma *vma = &uvma->vma;
+	struct dma_resv_iter cursor;
+	struct dma_fence *fence;
+	bool signaled = true;
+

xe_svm_assert_in_notifier(vm);

Same here.

Quoted 165 lines
Quoted 165 lines

  /*
  * Tell exec and rebind worker they need to repin and rebind this
  * userptr.

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -105,27 +129,32 @@ static void __vma_userptr_invalidate(struct

xe_vm *vm, struct xe_userptr_vma *uv
  */
  dma_resv_iter_begin(&cursor, xe_vm_resv(vm), DMA_RESV_USAGE_BOOKKEEP);

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-	dma_resv_for_each_fence_unlocked(&cursor, fence)
+	dma_resv_for_each_fence_unlocked(&cursor, fence) {

  dma_fence_enable_sw_signaling(fence);

drivers/gpu/drm/xe/xe_userptr.c +3 -0
+		if (signaled && !dma_fence_is_signaled(fence))
+			signaled = false;
+	}

  dma_resv_iter_end(&cursor);

drivers/gpu/drm/xe/xe_userptr.c +3 -8
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
-				    false, MAX_SCHEDULE_TIMEOUT);
-	XE_WARN_ON(err <= 0);
-
-	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
-		err = xe_vm_invalidate_vma(vma);
-		XE_WARN_ON(err);
+	/*
+	 * Only one caller at a time can use the multi-pass state.
+	 * If it's already in use, or all fences are already

signaled,

drivers/gpu/drm/xe/xe_userptr.c +5 -0
+	 * proceed directly to invalidation without deferring.
+	 */
+	if (signaled || userptr->finish_inuse) {
+		xe_vma_userptr_do_inval(vm, uvma, false);
+		return NULL;

  }

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-
Quoted 1 line

userptr.pages,

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-			       xe_vma_size(vma) >> PAGE_SHIFT,

&ctx);

drivers/gpu/drm/xe/xe_userptr.c +3 -0
+	userptr->finish_inuse = true;
+
+	return &userptr->finish;

 }

-static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,

drivers/gpu/drm/xe/xe_userptr.c +0 -1
-				   const struct mmu_notifier_range

*range,

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-				   unsigned long cur_seq)
+static bool xe_vma_userptr_invalidate_start(struct

mmu_interval_notifier *mni,

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+					    const struct

mmu_notifier_range *range,

drivers/gpu/drm/xe/xe_userptr.c +2 -0
+					    unsigned long cur_seq,
+					    struct

mmu_interval_notifier_finish **p_finish)
 {
  struct xe_userptr_vma *uvma = container_of(mni, typeof(*uvma), userptr.notifier);
  struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -138,21 +167,40 @@ static bool vma_userptr_invalidate(struct
 mmu_interval_notifier *mni,
  		return false;


  vm_dbg(&xe_vma_vm(vma)->xe->drm,

drivers/gpu/drm/xe/xe_userptr.c +1 -1
-	       "NOTIFIER: addr=0x%016llx, range=0x%016llx",
+	       "NOTIFIER PASS1: addr=0x%016llx, range=0x%016llx",

  xe_vma_start(vma), xe_vma_size(vma));
  down_write(&vm->svm.gpusvm.notifier_lock); mmu_interval_set_seq(mni, cur_seq);

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	__vma_userptr_invalidate(vm, uvma);
+	*p_finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+

  up_write(&vm->svm.gpusvm.notifier_lock);

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	trace_xe_vma_userptr_invalidate_complete(vma);
+	if (!*p_finish)
+		trace_xe_vma_userptr_invalidate_complete(vma);


  return true;
 }

+static void xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish *finish)

drivers/gpu/drm/xe/xe_userptr.c +2 -0
+{
+	struct xe_userptr_vma *uvma = container_of(finish,

typeof(*uvma), userptr.finish);

drivers/gpu/drm/xe/xe_userptr.c +13 -0
+	struct xe_vma *vma = &uvma->vma;
+	struct xe_vm *vm = xe_vma_vm(vma);
+
+	vm_dbg(&xe_vma_vm(vma)->xe->drm,
+	       "NOTIFIER PASS2: addr=0x%016llx, range=0x%016llx",
+		xe_vma_start(vma), xe_vma_size(vma));
+
+	down_write(&vm->svm.gpusvm.notifier_lock);
+	xe_vma_userptr_do_inval(vm, uvma, true);
+	up_write(&vm->svm.gpusvm.notifier_lock);
+	trace_xe_vma_userptr_invalidate_complete(vma);
+}
+

 static const struct mmu_interval_notifier_ops
vma_userptr_notifier_ops = {

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	.invalidate = vma_userptr_invalidate,
+	.invalidate_start = xe_vma_userptr_invalidate_start,
+	.invalidate_finish = xe_vma_userptr_invalidate_finish,

 };

 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT)

drivers/gpu/drm/xe/xe_userptr.c +1 -0
@@ -164,6 +212,7 @@ static const struct mmu_interval_notifier_ops
 vma_userptr_notifier_ops = {
   */
  void xe_vma_userptr_force_invalidate(struct xe_userptr_vma *uvma)
  {
+	static struct mmu_interval_notifier_finish *finish;
  	struct xe_vm *vm = xe_vma_vm(&uvma->vma);


  /* Protect against concurrent userptr pinning */

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -179,7 +228,10 @@ void xe_vma_userptr_force_invalidate(struct
 xe_userptr_vma *uvma)
  	if (!mmu_interval_read_retry(&uvma->userptr.notifier,

       uvma-

Quoted 1 line

userptr.pages.notifier_seq))

  uvma->userptr.pages.notifier_seq -= 2;

drivers/gpu/drm/xe/xe_userptr.c +4 -1
-	__vma_userptr_invalidate(vm, uvma);
+
+	finish = xe_vma_userptr_invalidate_pass1(vm, uvma);
+	if (finish)
+		xe_vma_userptr_do_inval(vm, uvma, true);

 }
 #endif

drivers/gpu/drm/xe/xe_userptr.h +0 -0
index ef801234991e..4f42db61fd62 100644
@@ -57,12 +57,26 @@ struct xe_userptr {
  	 */
  	struct mmu_interval_notifier notifier;

drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	/**
+	 * @finish: MMU notifier finish structure for two-pass

invalidation.

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * Embedded here to avoid allocation in the notifier

callback.

drivers/gpu/drm/xe/xe_userptr.h +5 -0
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	struct mmu_interval_notifier_finish finish;
+	/**
+	 * @finish_inuse: Whether @finish is currently in use by

an in-progress

drivers/gpu/drm/xe/xe_userptr.h +5 -0
+	 * two-pass invalidation.
+	 * Protected by @vm::svm.gpusvm.notifier_lock.
+	 */
+	bool finish_inuse;
+

  /**
  * @initial_bind: user pointer has been bound at least once.
  * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.
  * read: vm->svm.gpusvm.notifier_lock in write mode or vm-

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

resv held.

  */
  bool initial_bind;
+

Unrelated.

Sure. Will fix.

Thanks,
Thomas

Quoted 9 lines

Matt

Quoted 6 lines

 #if IS_ENABLED(CONFIG_DRM_XE_USERPTR_INVAL_INJECT) u32 divisor;
 #endif

Signature · 1 line
2.53.0
maintainer
#11 lore raw

Re: [PATCH v2 3/4] drm/xe: Split TLB invalidation into submit and wait steps

In reply to Thomas Hellström
Quoted 110 lines · Thomas Hellström
Quoted 72 lines · Matthew Brost
Quoted 9 lines · Thomas Hellström

xe_vm_range_tilemask_tlb_inval() submits TLB invalidation requests to
all GTs in a tile mask and then immediately waits for them to complete
before returning. This is fine for the existing callers, but a subsequent patch will need to defer the wait in order to overlap TLB
invalidations across multiple VMAs.

Quoted 7 lines

Introduce xe_tlb_inval_range_tilemask_submit() and xe_tlb_inval_batch_wait() in xe_tlb_inval.c as the submit and wait halves respectively. The batch of fences is carried in the new xe_tlb_inval_batch structure. Remove xe_vm_range_tilemask_tlb_inval()
and convert all three call sites to the new API.

Mostly nits...

Quoted 48 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6

---
 drivers/gpu/drm/xe/xe_svm.c             |  6 +- drivers/gpu/drm/xe/xe_tlb_inval.c       | 82
+++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_tlb_inval.h       |  6 ++ drivers/gpu/drm/xe/xe_tlb_inval_types.h | 14 +++++ drivers/gpu/drm/xe/xe_vm.c              | 69 +++------------------ drivers/gpu/drm/xe/xe_vm.h              |  3 - drivers/gpu/drm/xe/xe_vm_madvise.c      |  9 ++- drivers/gpu/drm/xe/xe_vm_types.h        |  1 +

 8 files changed, 123 insertions(+), 67 deletions(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 002b6c22ad3f..6ea4972c2791 100644
@@ -19,6 +19,7 @@
  #include "xe_pt.h"
  #include "xe_svm.h"
  #include "xe_tile.h"
+#include "xe_tlb_inval.h"
  #include "xe_ttm_vram_mgr.h"
  #include "xe_vm.h"
  #include "xe_vm_types.h"
@@ -225,6 +226,7 @@ static void xe_svm_invalidate(struct drm_gpusvm
 *gpusvm,

        const struct mmu_notifier_range *mmu_range)
 {
  struct xe_vm *vm = gpusvm_to_vm(gpusvm);

drivers/gpu/drm/xe/xe_svm.c +1 -0
+	struct xe_tlb_inval_batch _batch;

  struct xe_device *xe = vm->xe;
  struct drm_gpusvm_range *r, *first;
  struct xe_tile *tile;

drivers/gpu/drm/xe/xe_svm.c +0 -0
@@ -276,7 +278,9 @@ static void xe_svm_invalidate(struct drm_gpusvm
 *gpusvm,


  xe_device_wmb(xe);

drivers/gpu/drm/xe/xe_svm.c +0 -1
-	err = xe_vm_range_tilemask_tlb_inval(vm, adj_start,

adj_end, tile_mask);

drivers/gpu/drm/xe/xe_svm.c +1 -0
+	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid,

adj_start, adj_end,

drivers/gpu/drm/xe/xe_svm.c +1 -0
+						 tile_mask,

&_batch);

drivers/gpu/drm/xe/xe_svm.c

Quoted 1 line
drivers/gpu/drm/xe/xe_svm.c +1 -0
+	xe_tlb_inval_batch_wait(&_batch);

No need to call wait on an error but it is harmless.

Quoted 4 lines

So you could write it like this:

if (!WARN_ON_ONCE(err))

	xe_tlb_inval_batch_wait(&_batch);

Sure.

Quoted 30 lines
Quoted 24 lines

  WARN_ON_ONCE(err);

 range_notifier_event_end:

drivers/gpu/drm/xe/xe_tlb_inval.c +0 -0
index 933f30fb617d..343e37cfe715 100644
@@ -486,3 +486,85 @@ bool xe_tlb_inval_idle(struct xe_tlb_inval
 *tlb_inval)
  	guard(spinlock_irq)(&tlb_inval->pending_lock);
  	return list_is_singular(&tlb_inval->pending_fences);

 }

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+
+/**
+ * xe_tlb_inval_batch_wait() - Wait for all fences in a TLB

invalidation batch
+ * @batch: Batch of TLB invalidation fences to wait on
+ *
+ * Waits for every fence in @batch to signal, then resets @batch so it can be
+ * reused for a subsequent invalidation.
+ */

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 499

Quoted 3 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch)
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];

Would this be better:

Quoted 7 lines
Quoted 3 lines

s/&batch->fence[0]/batch->fence

Personal preference I guess.

Yeah, I typically use the former to make it easier for
the reader to remember we're pointing to the first element of an array.

Ok, fine with this. I know I have done it both ways more than once.

Quoted 86 lines
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +10 -0
+	unsigned int i;
+
+	for (i = 0; i < batch->num_fences; ++i)
+		xe_tlb_inval_fence_wait(fence++);
+
+	batch->num_fences = 0;
+}
+
+/**
+ * xe_tlb_inval_range_tilemask_submit() - Submit TLB invalidations

for an
+ * address range on a tile mask
+ * @xe: The xe device
+ * @asid: Address space ID
+ * @start: start address

Quoted 8 lines
Quoted 6 lines

+ * @end: end address
+ * @tile_mask: mask for which gt's issue tlb invalidation
+ * @batch: Batch of tlb invalidate fences
+ *
+ * Issue a range based TLB invalidation for gt's in tilemask
+ *

Mention no need to wait on batch if this function returns an error?

Sure.

Quoted 46 lines
Quoted 46 lines

+ * Returns 0 for success, negative error code otherwise.
+ */
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+				       u64 start, u64 end, u8

tile_mask,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+				       struct xe_tlb_inval_batch

*batch)

drivers/gpu/drm/xe/xe_tlb_inval.c +16 -0
+{
+	struct xe_tlb_inval_fence *fence = &batch->fence[0];
+	struct xe_tile *tile;
+	u32 fence_id = 0;
+	u8 id;
+	int err;
+
+	batch->num_fences = 0;
+	if (!tile_mask)
+		return 0;
+
+	for_each_tile(tile, xe, id) {
+		if (!(tile_mask & BIT(id)))
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+					&fence[fence_id], true);
+
+		err = xe_tlb_inval_range(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_tlb_inval.c +9 -0
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+
+		if (!tile->media_gt)
+			continue;
+
+		xe_tlb_inval_fence_init(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_tlb_inval.c +3 -0
+					&fence[fence_id], true);
+
+		err = xe_tlb_inval_range(&tile->media_gt-
Quoted 1 line

tlb_inval,

Quoted 12 lines

drivers/gpu/drm/xe/xe_tlb_inval.c bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval) · line 565

Quoted 10 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +1 -0
+					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_tlb_inval.c +8 -0
+					 asid, NULL);
+		if (err)
+			goto wait;
+		++fence_id;
+	}
+
+wait:
+	batch->num_fences = fence_id;

Should 'batch->num_fences' only get set on success?

Quoted 2 lines

We need it for the error wait below, after which it gets cleared.

Right, bad suggestion.

Matt

Quoted 267 lines
Quoted 168 lines
Quoted 140 lines
drivers/gpu/drm/xe/xe_tlb_inval.c +5 -0
+	if (err)
+		xe_tlb_inval_batch_wait(batch);
+
+	return err;
+}
drivers/gpu/drm/xe/xe_tlb_inval.h +0 -0
index 62089254fa23..a76b7823a5f2 100644
@@ -45,4 +45,10 @@ void xe_tlb_inval_done_handler(struct
 xe_tlb_inval *tlb_inval, int seqno);


 bool xe_tlb_inval_idle(struct xe_tlb_inval *tlb_inval);
+int xe_tlb_inval_range_tilemask_submit(struct xe_device *xe, u32 asid,

drivers/gpu/drm/xe/xe_tlb_inval.h +1 -0
+				       u64 start, u64 end, u8

tile_mask,

drivers/gpu/drm/xe/xe_tlb_inval.h +1 -0
+				       struct xe_tlb_inval_batch

*batch);

drivers/gpu/drm/xe/xe_tlb_inval.h +3 -0
+
+void xe_tlb_inval_batch_wait(struct xe_tlb_inval_batch *batch);
+

 #endif /* _XE_TLB_INVAL_ */

drivers/gpu/drm/xe/xe_tlb_inval_types.h +0 -0
index 3b089f90f002..3d1797d186fd 100644
@@ -9,6 +9,8 @@
  #include <linux/workqueue.h>
  #include <linux/dma-fence.h>

drivers/gpu/drm/xe/xe_tlb_inval_types.h +2 -0
+#include "xe_device_types.h"
+

 struct drm_suballoc;
 struct xe_tlb_inval;

drivers/gpu/drm/xe/xe_tlb_inval_types.h +0 -0
@@ -132,4 +134,16 @@ struct xe_tlb_inval_fence {
  	ktime_t inval_time;
  };

drivers/gpu/drm/xe/xe_tlb_inval_types.h +8 -0
+/**
+ * struct xe_tlb_inval_batch - Batch of TLB invalidation fences
+ *
+ * Holds one fence per GT covered by a TLB invalidation request.
+ */
+struct xe_tlb_inval_batch {
+	/** @fence: per-GT TLB invalidation fences */
+	struct xe_tlb_inval_fence fence[XE_MAX_TILES_PER_DEVICE *

XE_MAX_GT_PER_TILE];

drivers/gpu/drm/xe/xe_tlb_inval_types.h +4 -0
+	/** @num_fences: number of valid entries in @fence */
+	unsigned int num_fences;
+};
+

 #endif

drivers/gpu/drm/xe/xe_vm.c +0 -0
index 548b0769b3ef..7f29d2b2972d 100644
@@ -3966,66 +3966,6 @@ void xe_vm_unlock(struct xe_vm *vm)
  	dma_resv_unlock(xe_vm_resv(vm));
  }


-/**
- * xe_vm_range_tilemask_tlb_inval - Issue a TLB invalidation on this tilemask for an
- * address range
- * @vm: The VM
- * @start: start address
- * @end: end address
- * @tile_mask: mask for which gt's issue tlb invalidation
- *
- * Issue a range based TLB invalidation for gt's in tilemask
- *
- * Returns 0 for success, negative error code otherwise.
- */

drivers/gpu/drm/xe/xe_vm.c +0 -5
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask)
-{
-	struct xe_tlb_inval_fence
-		fence[XE_MAX_TILES_PER_DEVICE *

XE_MAX_GT_PER_TILE];

drivers/gpu/drm/xe/xe_vm.c +0 -13
-	struct xe_tile *tile;
-	u32 fence_id = 0;
-	u8 id;
-	int err;
-
-	if (!tile_mask)
-		return 0;
-
-	for_each_tile(tile, vm->xe, id) {
-		if (!(tile_mask & BIT(id)))
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -3
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->primary_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_vm.c +0 -9
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-
-		if (!tile->media_gt)
-			continue;
-
-		xe_tlb_inval_fence_init(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -3
-					&fence[fence_id], true);
-
-		err = xe_tlb_inval_range(&tile->media_gt-
Quoted 1 line

tlb_inval,

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					 &fence[fence_id], start,

end,

drivers/gpu/drm/xe/xe_vm.c +0 -13
-					 vm->usm.asid, NULL);
-		if (err)
-			goto wait;
-		++fence_id;
-	}
-
-wait:
-	for (id = 0; id < fence_id; ++id)
-		xe_tlb_inval_fence_wait(&fence[id]);
-
-	return err;
-}
-

 /**
  * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
  * @vma: VMA to invalidate

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 3983

Quoted 4 lines
drivers/gpu/drm/xe/xe_vm.c +1 -0
@@ -4040,6 +3980,7 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
  {
  	struct xe_device *xe = xe_vma_vm(vma)->xe;
  	struct xe_vm *vm = xe_vma_vm(vma);
+	struct xe_tlb_inval_batch _batch;

Why not just 'batch'?

Quoted 21 lines
drivers/gpu/drm/xe/xe_vm.c +0 -0
  	struct xe_tile *tile;
  	u8 tile_mask = 0;
  	int ret = 0;
@@ -4080,12 +4021,16 @@ int xe_vm_invalidate_vma(struct xe_vma
 *vma)


  xe_device_wmb(xe);

drivers/gpu/drm/xe/xe_vm.c +0 -1
-	ret = xe_vm_range_tilemask_tlb_inval(xe_vma_vm(vma),

xe_vma_start(vma),

drivers/gpu/drm/xe/xe_vm.c +0 -1
-					     xe_vma_end(vma),

tile_mask);

drivers/gpu/drm/xe/xe_vm.c +1 -0
+	ret = xe_tlb_inval_range_tilemask_submit(xe,

xe_vma_vm(vma)->usm.asid,

drivers/gpu/drm/xe/xe_vm.c +1 -0
+						

xe_vma_start(vma), xe_vma_end(vma),

drivers/gpu/drm/xe/xe_vm.c +1 -0
+						 tile_mask,

&_batch);

  /* WRITE_ONCE pairs with READ_ONCE in
xe_vm_has_valid_gpu_mapping() */

Quoted 8 lines

drivers/gpu/drm/xe/xe_vm.c int xe_vm_invalidate_vma(struct xe_vma *vma) · line 4033

Quoted 5 lines

  WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);

drivers/gpu/drm/xe/xe_vm.c +3 -0
+	if (!ret)
+		xe_tlb_inval_batch_wait(&_batch);
+

Here we skip the wait on error, hence my suggestion to skip waits in other code paths or at a minimum make call sematics consistent.

Makes sense.

Quoted 51 lines
Quoted 51 lines

  return ret;
 }

drivers/gpu/drm/xe/xe_vm.h +0 -0
index f849e369432b..62f4b6fec0bc 100644
@@ -240,9 +240,6 @@ struct dma_fence *xe_vm_range_rebind(struct
 xe_vm *vm,
  struct dma_fence *xe_vm_range_unbind(struct xe_vm *vm,
  				     struct xe_svm_range *range);

drivers/gpu/drm/xe/xe_vm.h +0 -3
-int xe_vm_range_tilemask_tlb_inval(struct xe_vm *vm, u64 start,
-				   u64 end, u8 tile_mask);
-

 int xe_vm_invalidate_vma(struct xe_vma *vma);

 int xe_vm_validate_protected(struct xe_vm *vm);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
index 95bf53cc29e3..39717026e84f 100644
@@ -12,6 +12,7 @@
  #include "xe_pat.h"
  #include "xe_pt.h"
  #include "xe_svm.h"
+#include "xe_tlb_inval.h"


 struct xe_vmas_in_madvise_range {
  u64 addr;

drivers/gpu/drm/xe/xe_vm_madvise.c +0 -0
@@ -235,13 +236,19 @@ static u8 xe_zap_ptes_in_madvise_range(struct
 xe_vm *vm, u64 start, u64 end)

 static int xe_vm_invalidate_madvise_range(struct xe_vm *vm, u64 start, u64 end)
 {
  u8 tile_mask = xe_zap_ptes_in_madvise_range(vm, start, end);

drivers/gpu/drm/xe/xe_vm_madvise.c +2 -0
+	struct xe_tlb_inval_batch batch;
+	int err;


  if (!tile_mask)
  return 0;

  xe_device_wmb(vm->xe);

drivers/gpu/drm/xe/xe_vm_madvise.c +0 -1
-	return xe_vm_range_tilemask_tlb_inval(vm, start, end,

tile_mask);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+	err = xe_tlb_inval_range_tilemask_submit(vm->xe, vm-
Quoted 6 lines

drivers/gpu/drm/xe/xe_vm_madvise.c static u8 xe_zap_ptes_in_madvise_range(struct xe_vm *vm, u64 start, u64 end) · line 249

Quoted 4 lines
Quoted 1 line

usm.asid, start, end,

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+						 tile_mask,

&batch);

drivers/gpu/drm/xe/xe_vm_madvise.c +1 -0
+	xe_tlb_inval_batch_wait(&batch);

No need to wait on error.

Will fix

Thanks,
Thomas

Quoted 23 lines
Quoted 23 lines
drivers/gpu/drm/xe/xe_vm_madvise.c +2 -0
+
+	return err;

 }

 static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madvise *args)

drivers/gpu/drm/xe/xe_vm_types.h +1 -0
index 1f6f7e30e751..de6544165cfa 100644
@@ -18,6 +18,7 @@
  #include "xe_device_types.h"
  #include "xe_pt_types.h"
  #include "xe_range_fence.h"
+#include "xe_tlb_inval_types.h"
  #include "xe_userptr.h"


 struct drm_pagemap;

Signature · 1 line
2.53.0
author maintainer
#14 lore raw

Re: [PATCH v2 4/4] drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible

In reply to Matthew Brost
Quoted 86 lines · Matthew Brost
Quoted 30 lines · Thomas Hellström

Now that the two-pass notifier flow uses xe_vma_userptr_do_inval() for
the fence-wait + TLB-invalidate work, extend it to support a further
deferred TLB wait:

- xe_vma_userptr_do_inval(): when the embedded finish handle is free,
  submit the TLB invalidation asynchronously (xe_vm_invalidate_vma_submit)
  and return &userptr->finish so the mmu_notifier core schedules a third
  pass.  When the handle is occupied by a concurrent invalidation, fall
  back to the synchronous xe_vm_invalidate_vma() path.

- xe_vma_userptr_complete_tlb_inval(): new helper called from invalidate_finish when tlb_inval_submitted is set.  Waits for the previously submitted batch and unmaps the gpusvm pages.

xe_vma_userptr_invalidate_finish() dispatches between the two helpers
via tlb_inval_submitted, making the three possible flows explicit:

  pass1 (fences pending)  -> invalidate_finish -> do_inval (sync TLB)
  pass1 (fences done)     -> do_inval -> invalidate_finish -> complete_tlb_inval (deferred TLB) pass1 (finish occupied) -> do_inval (sync TLB, inline)

Quoted 8 lines

In multi-GPU scenarios this allows TLB flushes to be submitted on all
GPUs in one pass before any of them are waited on.

Also adds xe_vm_invalidate_vma_submit() which submits the TLB range invalidation without blocking, populating a xe_tlb_inval_batch that the caller waits on separately.

As suggested in patch #2, maybe squash this into patch #2 as some of patch #2 is immediately tweaked / rewritten here.

A couple nits.

Quoted 41 lines
Assisted-by GitHub Copilot:claude-sonnet-4.6

---
 drivers/gpu/drm/xe/xe_userptr.c | 60 +++++++++++++++++++++++++++--
----
 drivers/gpu/drm/xe/xe_userptr.h | 18 ++++++++++ drivers/gpu/drm/xe/xe_vm.c      | 38 ++++++++++++++++----- drivers/gpu/drm/xe/xe_vm.h      |  2 ++

 4 files changed, 99 insertions(+), 19 deletions(-)
drivers/gpu/drm/xe/xe_userptr.c +0 -0
index 440b0a79d16f..a62b796afb93 100644
@@ -8,6 +8,7 @@


 #include <linux/mm.h>

+#include "xe_tlb_inval.h"
 #include "xe_trace_bo.h"

 /**

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -73,8 +74,8 @@ int xe_vma_userptr_pin_pages(struct
 xe_userptr_vma *uvma)
  				    &ctx);
  }


-static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma,

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-				    bool is_deferred)
+static struct mmu_interval_notifier_finish *
+xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma

*uvma, bool is_deferred)
 {
  struct xe_userptr *userptr = &uvma->userptr; struct xe_vma *vma = &uvma->vma;

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -84,12 +85,23 @@ static void xe_vma_userptr_do_inval(struct

xe_vm *vm, struct xe_userptr_vma *uvm
  };
  long err;

Quoted 8 lines
Quoted 6 lines

drivers/gpu/drm/xe/xe_userptr.c +1 -2
-	err = dma_resv_wait_timeout(xe_vm_resv(vm),
-				    DMA_RESV_USAGE_BOOKKEEP,
+	err = dma_resv_wait_timeout(xe_vm_resv(vm),

DMA_RESV_USAGE_BOOKKEEP,
      false, MAX_SCHEDULE_TIMEOUT);

Unrelated.

Right, will fix.

Quoted 10 lines

drivers/gpu/drm/xe/xe_userptr.c static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm · line 93

Quoted 5 lines

  XE_WARN_ON(err <= 0);

  if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+		if (!userptr->finish_inuse) {

Since this is state machiney - should we have asserts on state? That typically the approach I take when I write stae machiney code. Self documenting plus immediatelt catches misuse.

Quoted 3 lines

So here an example would be:

xe_assert(.., !userptr->tlb_inval_submitted);

Sure. Can take a look at that to see how it turns out.

Quoted 33 lines

Quoted 32 lines
drivers/gpu/drm/xe/xe_userptr.c +2 -0
+			/*
+			 * Defer the TLB wait to an extra pass so

the caller

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+			 * can pipeline TLB flushes across GPUs

before waiting

drivers/gpu/drm/xe/xe_userptr.c +5 -0
+			 * on any of them.
+			 */
+			userptr->finish_inuse = true;
+			userptr->tlb_inval_submitted = true;
+			err = xe_vm_invalidate_vma_submit(vma,

&userptr->inval_batch);

drivers/gpu/drm/xe/xe_userptr.c +3 -0
+			XE_WARN_ON(err);
+			return &userptr->finish;
+		}

  err = xe_vm_invalidate_vma(vma);
  XE_WARN_ON(err);
  }

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -98,6 +110,24 @@ static void xe_vma_userptr_do_inval(struct

xe_vm *vm, struct xe_userptr_vma *uvm userptr->finish_inuse = false; drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-

Quoted 1 line

userptr.pages,

         xe_vma_size(vma) >> PAGE_SHIFT, &ctx);

drivers/gpu/drm/xe/xe_userptr.c +5 -0
+	return NULL;
+}
+
+static void
+xe_vma_userptr_complete_tlb_inval(struct xe_vm *vm, struct

xe_userptr_vma *uvma)

drivers/gpu/drm/xe/xe_userptr.c +2 -0
+{
+	struct xe_userptr *userptr = &uvma->userptr;
Quoted 8 lines

drivers/gpu/drm/xe/xe_userptr.c static void xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvm · line 125

Quoted 6 lines
drivers/gpu/drm/xe/xe_userptr.c +6 -0
+	struct xe_vma *vma = &uvma->vma;
+	struct drm_gpusvm_ctx ctx = {
+		.in_notifier = true,
+		.read_only = xe_vma_read_only(vma),
+	};
+

xe_svm_assert_in_notifier();

See previous comment on this.

Quoted 5 lines

State machine asserts could be:

xe_assert(..., userptr->tlb_inval_submitted);
xe_assert(..., userptr->finish_inuse);

Will take a look at this as well.

Quoted 22 lines
Quoted 22 lines
drivers/gpu/drm/xe/xe_userptr.c +4 -0
+	xe_tlb_inval_batch_wait(&userptr->inval_batch);
+	userptr->tlb_inval_submitted = false;
+	userptr->finish_inuse = false;
+	drm_gpusvm_unmap_pages(&vm->svm.gpusvm, &uvma-
Quoted 1 line

userptr.pages,

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+			       xe_vma_size(vma) >> PAGE_SHIFT,

&ctx);
 }

 static struct mmu_interval_notifier_finish *

drivers/gpu/drm/xe/xe_userptr.c +1 -4
@@ -141,13 +171,11 @@ xe_vma_userptr_invalidate_pass1(struct xe_vm
 *vm, struct xe_userptr_vma *uvma)
  	 * If it's already in use, or all fences are already
 signaled,
  	 * proceed directly to invalidation without deferring.
  	 */
-	if (signaled || userptr->finish_inuse) {
-		xe_vma_userptr_do_inval(vm, uvma, false);
-		return NULL;
-	}
+	if (signaled || userptr->finish_inuse)
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/xe/xe_userptr.c +1 -0
+		return xe_vma_userptr_do_inval(vm, uvma, false);

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+	/* Defer: the notifier core will call invalidate_finish

once done. */
  userptr->finish_inuse = true;
-

Unrelated.

Will fix.

Quoted 61 lines
Quoted 61 lines

  return &userptr->finish;
 }

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -193,7 +221,15 @@ static void

xe_vma_userptr_invalidate_finish(struct mmu_interval_notifier_finish xe_vma_start(vma), xe_vma_size(vma));
  down_write(&vm->svm.gpusvm.notifier_lock);

drivers/gpu/drm/xe/xe_userptr.c +2 -1
-	xe_vma_userptr_do_inval(vm, uvma, true);
+	/*
+	 * If a TLB invalidation was previously submitted

(deferred from the

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+	 * synchronous pass1 fallback), wait for it and unmap

pages.

drivers/gpu/drm/xe/xe_userptr.c +1 -0
+	 * Otherwise, fences have now completed: invalidate the

TLB and unmap.

drivers/gpu/drm/xe/xe_userptr.c +5 -0
+	 */
+	if (uvma->userptr.tlb_inval_submitted)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);
+	else
+		xe_vma_userptr_do_inval(vm, uvma, true);

  up_write(&vm->svm.gpusvm.notifier_lock); trace_xe_vma_userptr_invalidate_complete(vma); }

drivers/gpu/drm/xe/xe_userptr.c +0 -0
@@ -231,7 +267,9 @@ void xe_vma_userptr_force_invalidate(struct
 xe_userptr_vma *uvma)


  finish = xe_vma_userptr_invalidate_pass1(vm, uvma); if (finish)

drivers/gpu/drm/xe/xe_userptr.c +3 -1
-		xe_vma_userptr_do_inval(vm, uvma, true);
+		finish = xe_vma_userptr_do_inval(vm, uvma, true);
+	if (finish)
+		xe_vma_userptr_complete_tlb_inval(vm, uvma);

 }
 #endif

drivers/gpu/drm/xe/xe_userptr.h +0 -0
index 4f42db61fd62..7477009651c2 100644
@@ -14,6 +14,8 @@


 #include <drm/drm_gpusvm.h>

drivers/gpu/drm/xe/xe_userptr.h +2 -0
+#include "xe_tlb_inval_types.h"
+

 struct xe_vm;
 struct xe_vma;
 struct xe_userptr_vma;

drivers/gpu/drm/xe/xe_userptr.h +3 -0
@@ -63,6 +65,15 @@ struct xe_userptr {
  	 * Protected by @vm::svm.gpusvm.notifier_lock.
  	 */
  	struct mmu_interval_notifier_finish finish;
+
+	/**
+	 * @inval_batch: TLB invalidation batch for deferred

completion.

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * Stores an in-flight TLB invalidation submitted during a
Quoted 8 lines

drivers/gpu/drm/xe/xe_userptr.h

Quoted 6 lines

two-pass

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * notifier so the wait can be deferred to a subsequent

pass, allowing

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * multiple GPUs to be signalled before any of them are

waited on.

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * Protected by @vm::svm.gpusvm.notifier_lock.

In write mode?

Yeah, This one and the one below will look a bit more complicated if we want to keep the invalidation injection. Will update.

Quoted 22 lines
Quoted 18 lines
drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	 */
+	struct xe_tlb_inval_batch inval_batch;

  /**
  * @finish_inuse: Whether @finish is currently in use by an in-progress
  * two-pass invalidation.

drivers/gpu/drm/xe/xe_userptr.h +0 -0
@@ -70,6 +81,13 @@ struct xe_userptr {
  	 */
  	bool finish_inuse;

drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	/**
+	 * @tlb_inval_submitted: Whether a TLB invalidation has

been submitted

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * via @inval_batch and is pending completion.  When set,

the next pass

drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * must call xe_tlb_inval_batch_wait() before reusing

@inval_batch.

drivers/gpu/drm/xe/xe_userptr.h

Quoted 1 line
drivers/gpu/drm/xe/xe_userptr.h +1 -0
+	 * Protected by @vm::svm.gpusvm.notifier_lock.

In write mode?

Quoted 1 line

Matt

Thanks,
Thomas

Quoted 115 lines
Quoted 115 lines
drivers/gpu/drm/xe/xe_userptr.h +2 -0
+	 */
+	bool tlb_inval_submitted;

  /**
  * @initial_bind: user pointer has been bound at least once.
  * write: vm->svm.gpusvm.notifier_lock in read mode and vm->resv held.

drivers/gpu/drm/xe/xe_vm.c +0 -0
index 7f29d2b2972d..fdad9329dfb4 100644
@@ -3967,20 +3967,23 @@ void xe_vm_unlock(struct xe_vm *vm)
  }


 /**
- * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without a lock
+ * xe_vm_invalidate_vma_submit - Submit a job to invalidate GPU mappings for
+ * VMA.
  * @vma: VMA to invalidate
+ * @batch: TLB invalidation batch to populate; caller must later call
+ *         xe_tlb_inval_batch_wait() on it to wait for completion *
  * Walks a list of page tables leaves which it memset the entries owned by this
- * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
- * complete.
+ * VMA to zero, invalidates the TLBs, but doesn't block waiting for TLB flush
+ * to complete, but instead populates @batch which can be waited on using
+ * xe_tlb_inval_batch_wait().
  *
  * Returns 0 for success, negative error code otherwise. */

drivers/gpu/drm/xe/xe_vm.c +1 -1
-int xe_vm_invalidate_vma(struct xe_vma *vma)
+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct

xe_tlb_inval_batch *batch)
 {
  struct xe_device *xe = xe_vma_vm(vma)->xe; struct xe_vm *vm = xe_vma_vm(vma);

drivers/gpu/drm/xe/xe_vm.c +0 -1
-	struct xe_tlb_inval_batch _batch;

  struct xe_tile *tile;
  u8 tile_mask = 0;
  int ret = 0;

drivers/gpu/drm/xe/xe_vm.c +0 -0
@@ -4023,14 +4026,33 @@ int xe_vm_invalidate_vma(struct xe_vma
 *vma)


  ret = xe_tlb_inval_range_tilemask_submit(xe, xe_vma_vm(vma)->usm.asid,

xe_vma_start(vma), xe_vma_end(vma),

drivers/gpu/drm/xe/xe_vm.c +0 -1
-						 tile_mask,

&_batch);

drivers/gpu/drm/xe/xe_vm.c +1 -0
+						 tile_mask,

batch);

  /* WRITE_ONCE pairs with READ_ONCE in xe_vm_has_valid_gpu_mapping() */ WRITE_ONCE(vma->tile_invalidated, vma->tile_mask);

drivers/gpu/drm/xe/xe_vm.c +5 -0
+	return ret;
+}
+
+/**
+ * xe_vm_invalidate_vma - invalidate GPU mappings for VMA without

a lock
+ * @vma: VMA to invalidate
+ *
+ * Walks a list of page tables leaves which it memset the entries owned by this
+ * VMA to zero, invalidates the TLBs, and block until TLBs invalidation is
+ * complete.
+ *
+ * Returns 0 for success, negative error code otherwise.
+ */

drivers/gpu/drm/xe/xe_vm.c +4 -0
+int xe_vm_invalidate_vma(struct xe_vma *vma)
+{
+	struct xe_tlb_inval_batch batch;
+	int ret;

drivers/gpu/drm/xe/xe_vm.c +3 -2
-	if (!ret)
-		xe_tlb_inval_batch_wait(&_batch);
+	ret = xe_vm_invalidate_vma_submit(vma, &batch);
+	if (ret)
+		return ret;

drivers/gpu/drm/xe/xe_vm.c +1 -0
+	xe_tlb_inval_batch_wait(&batch);

  return ret;
 }

drivers/gpu/drm/xe/xe_vm.h +0 -0
index 62f4b6fec0bc..0bc7ed23eeae 100644
@@ -242,6 +242,8 @@ struct dma_fence *xe_vm_range_unbind(struct
 xe_vm *vm,


 int xe_vm_invalidate_vma(struct xe_vma *vma);

+int xe_vm_invalidate_vma_submit(struct xe_vma *vma, struct xe_tlb_inval_batch *batch);
+
 int xe_vm_validate_protected(struct xe_vm *vm);

 static inline void xe_vm_queue_rebind_worker(struct xe_vm *vm)

Signature · 1 line
2.53.0
#15 lore raw

✗ CI.checkpatch: warning for Two-pass MMU interval notifiers (rev2)

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: Two-pass MMU interval notifiers (rev2)
URL : https://patchwork.freedesktop.org/series/153280/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master 1f57ba1afceae32108bd24770069f764d940a0e4
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit c2e8c69404a2a73e66de3c340f9fdcb3dfcc1350

Author: Thomas Hellström <[email protected]>
Date:   Mon Mar 2 17:32:48 2026 +0100

drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible

Now that the two-pass notifier flow uses xe_vma_userptr_do_inval() for the fence-wait + TLB-invalidate work, extend it to support a further deferred TLB wait:

- xe_vma_userptr_do_inval(): when the embedded finish handle is free, submit the TLB invalidation asynchronously (xe_vm_invalidate_vma_submit) and return &userptr->finish so the mmu_notifier core schedules a third pass. When the handle is occupied by a concurrent invalidation, fall back to the synchronous xe_vm_invalidate_vma() path.

- xe_vma_userptr_complete_tlb_inval(): new helper called from invalidate_finish when tlb_inval_submitted is set. Waits for the previously submitted batch and unmaps the gpusvm pages.

xe_vma_userptr_invalidate_finish() dispatches between the two helpers via tlb_inval_submitted, making the three possible flows explicit:

pass1 (fences pending) -> invalidate_finish -> do_inval (sync TLB)
pass1 (fences done) -> do_inval -> invalidate_finish
-> complete_tlb_inval (deferred TLB)
pass1 (finish occupied) -> do_inval (sync TLB, inline)

In multi-GPU scenarios this allows TLB flushes to be submitted on all GPUs in one pass before any of them are waited on.

Also adds xe_vm_invalidate_vma_submit() which submits the TLB range invalidation without blocking, populating a xe_tlb_inval_batch that the caller waits on separately.

Assisted-by GitHub Copilot:claude-sonnet-4.6

+ /mt/dim checkpatch 658ee8457333fe9f26f88f812f6cd423f800720b drm-intel cf2abf1e0058 mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers -:48: WARNING:BAD_SIGN_OFF: Non-standard signature: Assisted-by:
#48:

Assisted-by GitHub Copilot:claude-sonnet-4.6 # Documentation only.

-:48: ERROR:BAD_SIGN_OFF: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6 # Documentation only.' #48:

Assisted-by GitHub Copilot:claude-sonnet-4.6 # Documentation only.

total: 1 errors, 1 warnings, 0 checks, 162 lines checked 90515c84cb85 drm/xe/userptr: Convert invalidation to two-pass MMU notifier -:32: WARNING:BAD_SIGN_OFF: Non-standard signature: Assisted-by:
#32:

Assisted-by GitHub Copilot:claude-sonnet-4.6

-:32: ERROR:BAD_SIGN_OFF: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6' #32:

Assisted-by GitHub Copilot:claude-sonnet-4.6

total: 1 errors, 1 warnings, 0 checks, 179 lines checked aba93520ca36 drm/xe: Split TLB invalidation into submit and wait steps -:21: WARNING:BAD_SIGN_OFF: Non-standard signature: Assisted-by:
#21:

Assisted-by GitHub Copilot:claude-sonnet-4.6

-:21: ERROR:BAD_SIGN_OFF: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6' #21:

Assisted-by GitHub Copilot:claude-sonnet-4.6

total: 1 errors, 1 warnings, 0 checks, 277 lines checked
c2e8c69404a2 drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible -:39: WARNING:BAD_SIGN_OFF: Non-standard signature: Assisted-by:
#39:

Assisted-by GitHub Copilot:claude-sonnet-4.6

-:39: ERROR:BAD_SIGN_OFF: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6' #39:

Assisted-by GitHub Copilot:claude-sonnet-4.6

total: 1 errors, 1 warnings, 0 checks, 216 lines checked

#16 lore raw

✓ CI.KUnit: success for Two-pass MMU interval notifiers (rev2)

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: Two-pass MMU interval notifiers (rev2)
URL : https://patchwork.freedesktop.org/series/153280/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [22:04:36] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

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

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [22:05:11] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

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

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [22:05:37] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

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

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

#17 lore raw

✓ Xe.CI.BAT: success for Two-pass MMU interval notifiers (rev2)

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: Two-pass MMU interval notifiers (rev2)
URL : https://patchwork.freedesktop.org/series/153280/
State : success

== Summary ==

CI Bug Log - changes from xe-4642-8527899064372c5c8f4d8db80024412ff3c02128_BAT -> xe-pw-153280v2_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Additional (2): bat-atsm-2 bat-bmg-3
Missing (2): bat-wcl-1 bat-dg2-oem2

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

Here are the changes found in xe-pw-153280v2_BAT that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@fbdev@info:
- bat-atsm-2: NOTRUN -> [SKIP][1] ([Intel XE#2134]) +4 other tests skip
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_addfb_basic@invalid-set-prop-any:
- bat-atsm-2: NOTRUN -> [SKIP][2] ([i915#6077]) +30 other tests skip
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
- bat-atsm-2: NOTRUN -> [SKIP][3] ([Intel XE#1024] / [Intel XE#782] / [Intel XE#947]) +5 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_dsc@dsc-basic:
- bat-atsm-2: NOTRUN -> [SKIP][4] ([Intel XE#1024] / [Intel XE#784] / [Intel XE#947])
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- bat-atsm-2: NOTRUN -> [SKIP][5] ([Intel XE#1024] / [Intel XE#783] / [Intel XE#947])
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_hdmi_inject@inject-audio:
- bat-atsm-2: NOTRUN -> [SKIP][6] ([Intel XE#540]) +3 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc:
- bat-atsm-2: NOTRUN -> [SKIP][7] ([Intel XE#829] / [i915#1836]) +6 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_prop_blob@basic:
- bat-atsm-2: NOTRUN -> [SKIP][8] ([Intel XE#780])
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@kms_psr@psr-primary-page-flip:
- bat-atsm-2: NOTRUN -> [SKIP][9] ([Intel XE#1024] / [Intel XE#947]) +6 other tests skip
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@xe_exec_fault_mode@twice-userptr-invalidate-imm:
- bat-atsm-2: NOTRUN -> [SKIP][10] ([Intel XE#288]) +32 other tests skip
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@xe_huc_copy@huc_copy:
- bat-atsm-2: NOTRUN -> [SKIP][11] ([Intel XE#255])
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@xe_huc_copy@huc_copy.html

* igt@xe_live_ktest@xe_migrate@xe_validate_ccs_kunit:
- bat-atsm-2: NOTRUN -> [SKIP][12] ([Intel XE#2229])
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@xe_live_ktest@xe_migrate@xe_validate_ccs_kunit.html

* igt@xe_pat@pat-index-xe2:
- bat-atsm-2: NOTRUN -> [SKIP][13] ([Intel XE#977])
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@xe_pat@pat-index-xehpc:
- bat-atsm-2: NOTRUN -> [SKIP][14] ([Intel XE#2838] / [Intel XE#979])
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@xe_pat@pat-index-xelpg:
- bat-atsm-2: NOTRUN -> [SKIP][15] ([Intel XE#979])
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-atsm-2/igt@[email protected]

* igt@xe_peer2peer@read@read-gpua-vram01-gpub-vram01-p2p:
- bat-bmg-3: NOTRUN -> [SKIP][16] ([Intel XE#6566]) +3 other tests skip
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/bat-bmg-3/igt@xe_peer2peer@[email protected]

[Intel XE#1024]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1024
[Intel XE#2134]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2134
[Intel XE#2229]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2229
[Intel XE#255]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/255
[Intel XE#2838]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2838
[Intel XE#288]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/288
[Intel XE#540]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/540
[Intel XE#6566]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6566
[Intel XE#780]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/780
[Intel XE#782]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/782
[Intel XE#783]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/783
[Intel XE#784]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/784
[Intel XE#829]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/829
[Intel XE#947]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/947
[Intel XE#977]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/977
[Intel XE#979]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/979
[i915#1836]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/1836
[i915#6077]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/6077

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

* Linux: xe-4642-8527899064372c5c8f4d8db80024412ff3c02128 -> xe-pw-153280v2

IGT_8776: 8776
xe-4642-8527899064372c5c8f4d8db80024412ff3c02128: 8527899064372c5c8f4d8db80024412ff3c02128
xe-pw-153280v2: 153280v2

== Logs ==

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

#18 lore raw

✗ Xe.CI.FULL: failure for Two-pass MMU interval notifiers (rev2)

In reply to Thomas Hellström
== Series Details ==

== Series Details ==

Series: Two-pass MMU interval notifiers (rev2)
URL : https://patchwork.freedesktop.org/series/153280/
State : failure

== Summary ==

CI Bug Log - changes from xe-4642-8527899064372c5c8f4d8db80024412ff3c02128_FULL -> xe-pw-153280v2_FULL
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with xe-pw-153280v2_FULL absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in xe-pw-153280v2_FULL, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

Participating hosts (2 -> 2)
------------------------------

No changes in participating hosts

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

Here are the unknown changes that may have been introduced in xe-pw-153280v2_FULL:

### IGT changes ###

#### Possible regressions ####

* igt@kms_flip@2x-flip-vs-expired-vblank@ab-dp2-hdmi-a3:
- shard-bmg: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-3/igt@kms_flip@[email protected]

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

Here are the changes found in xe-pw-153280v2_FULL that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_ccs@bad-pixel-format-4-tiled-mtl-rc-ccs:
- shard-bmg: NOTRUN -> [SKIP][2] ([Intel XE#2887])
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-5/igt@[email protected]

* igt@kms_ccs@random-ccs-data-4-tiled-lnl-ccs@pipe-c-dp-1:
- shard-bmg: NOTRUN -> [SKIP][3] ([Intel XE#2652]) +11 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-5/igt@kms_ccs@[email protected]

* igt@kms_content_protection@legacy-hdcp14@pipe-a-dp-2:
- shard-bmg: NOTRUN -> [FAIL][4] ([Intel XE#1178] / [Intel XE#3304])
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-9/igt@kms_content_protection@[email protected]

* igt@kms_content_protection@uevent-hdcp14@pipe-a-dp-1:
- shard-bmg: NOTRUN -> [FAIL][5] ([Intel XE#6707])
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-5/igt@kms_content_protection@[email protected]

* igt@kms_cursor_crc@cursor-sliding-max-size:
- shard-bmg: NOTRUN -> [SKIP][6] ([Intel XE#2320])
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-5/igt@[email protected]

* igt@kms_cursor_legacy@cursora-vs-flipa-atomic-transitions-varying-size:
- shard-bmg: [PASS][7] -> [DMESG-WARN][8] ([Intel XE#5354])
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-bmg-4/igt@kms_cursor_legacy@cursora-vs-flipa-atomic-transitions-varying-size.html
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-1/igt@kms_cursor_legacy@cursora-vs-flipa-atomic-transitions-varying-size.html

* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-bmg: [PASS][9] -> [FAIL][10] ([Intel XE#3321])
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-bmg-5/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-3/igt@[email protected]

* igt@kms_flip@dpms-vs-vblank-race-interruptible@a-edp1:
- shard-lnl: [PASS][11] -> [FAIL][12] ([Intel XE#3098]) +1 other test fail
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-lnl-7/igt@kms_flip@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-lnl-8/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-lnl: [PASS][13] -> [FAIL][14] ([Intel XE#301] / [Intel XE#3149]) +1 other test fail
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-lnl-8/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-lnl-4/igt@[email protected]

* igt@kms_frontbuffer_tracking@drrs-2p-scndscrn-pri-indfb-draw-blt:
- shard-bmg: NOTRUN -> [SKIP][15] ([Intel XE#2311])
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-5/igt@kms_frontbuffer_tracking@drrs-2p-scndscrn-pri-indfb-draw-blt.html

* igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma:
- shard-lnl: [PASS][16] -> [FAIL][17] ([Intel XE#5625])
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-lnl-3/igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma.html
[17]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-lnl-4/igt@xe_exec_system_allocator@pat-index-madvise-pat-idx-uc-single-vma.html

#### Possible fixes ####

* igt@kms_flip@flip-vs-expired-vblank:
- shard-bmg: [FAIL][18] ([Intel XE#3321]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-bmg-8/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-3/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@a-hdmi-a3:
- shard-bmg: [FAIL][20] -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-bmg-8/igt@kms_flip@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-3/igt@kms_flip@[email protected]

* igt@kms_psr_stress_test@invalidate-primary-flip-overlay:
- shard-lnl: [SKIP][22] ([Intel XE#4692]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-lnl-7/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-lnl-8/igt@[email protected]

#### Warnings ####

* igt@kms_tiled_display@basic-test-pattern-with-chamelium:
- shard-bmg: [SKIP][24] ([Intel XE#2509]) -> [SKIP][25] ([Intel XE#2426])
[24]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-4642-8527899064372c5c8f4d8db80024412ff3c02128/shard-bmg-6/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-153280v2/shard-bmg-7/igt@[email protected]

[Intel XE#1178]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1178
[Intel XE#2311]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2311
[Intel XE#2320]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2320
[Intel XE#2426]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2426
[Intel XE#2509]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2509
[Intel XE#2652]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2652
[Intel XE#2887]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2887
[Intel XE#301]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/301
[Intel XE#3098]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3098
[Intel XE#3149]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3149
[Intel XE#3304]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3304
[Intel XE#3321]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3321
[Intel XE#4692]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4692
[Intel XE#5354]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5354
[Intel XE#5625]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5625
[Intel XE#6707]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6707

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

* Linux: xe-4642-8527899064372c5c8f4d8db80024412ff3c02128 -> xe-pw-153280v2

IGT_8776: 8776
xe-4642-8527899064372c5c8f4d8db80024412ff3c02128: 8527899064372c5c8f4d8db80024412ff3c02128
xe-pw-153280v2: 153280v2

== Logs ==

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