Some (drm_sched_|dma_)fence lifetime issues
Subsystems (8)
v3 cover Some (drm_sched_|dma_)fence lifetime issues
Hi all,
tl;dr;
Xe and probably some other drivers can tear down the internal state referenced by an exported sync_file fence which then causes a null pointer derefences on accessing said fence.
IGT that exploits the problem:
https://patchwork.freedesktop.org/patch/642709/?series=146211&rev=2
It seems there is a consensus this is a known problem with the dma-fence design, where internal state shouldn't really be accessed after the fence has been signaled. However currently the code is mostly unaware of that hence the use- after-free potential.
To fix it, between the option of adding more reference counting and trying to "revoke" the fence, suggestion is to focus on the later.
Reference to the recent discussion:
https://lore.kernel.org/dri-devel/[email protected]/
This series therefore attempts to implement a solution along those lines.
Most of the description what and how can be found in:
"dma-fence: Add safe access helpers and document the rules"
Other than that, the series starts with some cleanups, with the general goal of hiding more of the dma-fence implementation details behind explicit API. This means adding helpers for access to driver and timeline name, and also moving as much as it is easily possible of driver allocated state into the fence object itself. Because dma-fence is already reference counted, any state we can embed automatically becomes safe.
Having said that, the series only addreses the runtime use-after-free scenarios, such as the above explained situation with the xe driver. For now the module unload problem is deliberately left for later. (Although again, some of the early patches do make it safer, and will make future improvements easier due fewer accesses to fence->ops.)
Final patch in the series is the one which makes xe compliant with the rules and API proposed earlier in the series. It does so by ensuring there is at least one RCU grace period between fences being signaled and driver allocated memory accessible from xe fences getting freed. Which couples with the earlier (from the series) refactors which added dma_fence_access_begin/end() protection to the relevant call sites.
If this approach is acceptable the next steps will be to see if any other drivers will need similar changes. And also to discuss whether we want to go a step futher and later move to SRCU, so code would be protected against module unload as well.
v2:
* Dropped module unload handling.
* Proposing real API instead of hacks.
v3:
* Dropped the dma_fence_is_array|chain ops to flags conversion.
* Dropped the i915 cleanup patch which is now independent.
* Squashed dma-fence helpers with internal usage patches.
* Restored missing hunk in "dma-fence: Use a flag for 64-bit seqnos".
* Removed the AMDGPU_JOB_GET_TIMELINE_NAME macro.
* Applied some r-b tags.
Tvrtko Ursulin (10):
dma-fence: Change signature of __dma_fence_is_later
dma-fence: Use a flag for 64-bit seqnos
dma-fence: Add helpers for accessing driver and timeline name
sync_file: Use dma-fence driver and timeline name helpers drm/amdgpu: Use dma-fence driver and timeline name helpers drm/i915: Use dma-fence driver and timeline name helpers
dma-fence: Add safe access helpers and document the rules
sync_file: Protect access to driver and timeline name drm/i915: Protect access to driver and timeline name drm/xe: Make dma-fences compliant with the safe access rules
drivers/dma-buf/dma-fence-chain.c | 7 +- drivers/dma-buf/dma-fence.c | 87 ++++++++++++++++++- drivers/dma-buf/sw_sync.c | 2 +- drivers/dma-buf/sync_file.c | 14 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 9 +- .../gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c | 5 +- drivers/gpu/drm/i915/gt/intel_gt_requests.c | 6 +- drivers/gpu/drm/i915/i915_request.c | 5 +- drivers/gpu/drm/i915/i915_sw_fence.c | 6 +- drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 2 + drivers/gpu/drm/xe/xe_guc_submit.c | 7 +- drivers/gpu/drm/xe/xe_hw_fence.c | 5 +- drivers/gpu/drm/xe/xe_sched_job.c | 14 +-- include/linux/dma-fence.h | 47 +++++++--- include/trace/events/dma_fence.h | 4 +- 15 files changed, 168 insertions(+), 52 deletions(-)
Signature · 1 line
2.48.0
RFC v3 1/10 dma-fence: Change signature of __dma_fence_is_later
With the goal of reducing the need for drivers to touch (and dereference) fence->ops, we change the prototype of __dma_fence_is_later() to take fence instead of fence->ops.
--- drivers/dma-buf/dma-fence-chain.c | 2 +- drivers/dma-buf/sw_sync.c | 2 +- drivers/gpu/drm/xe/xe_hw_fence.c | 2 +- drivers/gpu/drm/xe/xe_sched_job.c | 14 ++++++++------ include/linux/dma-fence.h | 9 ++++----- 5 files changed, 15 insertions(+), 14 deletions(-)
drivers/dma-buf/dma-fence-chain.c +1 -1
@@ -252,7 +252,7 @@ void dma_fence_chain_init(struct dma_fence_chain *chain, chain->prev_seqno =0 ;/* Try to reuse the context of the previous chain node. */ -if (prev_chain &&__dma_fence_is_later (seqno, prev->seqno, prev->ops)) { +if (prev_chain &&__dma_fence_is_later (prev, seqno, prev->seqno)) { context = prev->context; chain->prev_seqno = prev->seqno; }else {
drivers/dma-buf/sw_sync.c +1 -1
@@ -170,7 +170,7 @@ static bool timeline_fence_signaled(struct dma_fence *fence) {struct sync_timeline *parent =dma_fence_parent (fence); -return !__dma_fence_is_later (fence->seqno, parent->value, fence->ops); +return !__dma_fence_is_later (fence, fence->seqno, parent->value); }static void timeline_fence_set_deadline (struct dma_fence *fence,ktime_t deadline)
drivers/gpu/drm/xe/xe_hw_fence.c +1 -1
@@ -165,7 +165,7 @@ static bool xe_hw_fence_signaled(struct dma_fence *dma_fence)u32 seqno =xe_map_rd (xe, &fence->seqno_map,0 , u32);return dma_fence->error || - !__dma_fence_is_later (dma_fence->seqno, seqno, dma_fence->ops); + !__dma_fence_is_later (dma_fence, dma_fence->seqno, seqno); }static bool xe_hw_fence_enable_signaling (struct dma_fence *dma_fence)
drivers/gpu/drm/xe/xe_sched_job.c +8 -6
@@ -216,15 +216,17 @@ void xe_sched_job_set_error(struct xe_sched_job *job, int error)bool xe_sched_job_started (struct xe_sched_job *job) { +struct dma_fence *fence =dma_fence_chain_contained (job->fence);struct xe_lrc *lrc = job->q->lrc[0 ]; -return !__dma_fence_is_later (xe_sched_job_lrc_seqno (job), -xe_lrc_start_seqno (lrc), -dma_fence_chain_contained (job->fence)->ops); +return !__dma_fence_is_later (fence, +xe_sched_job_lrc_seqno (job), +xe_lrc_start_seqno (lrc)); }bool xe_sched_job_completed (struct xe_sched_job *job) { +struct dma_fence *fence =dma_fence_chain_contained (job->fence);struct xe_lrc *lrc = job->q->lrc[0 ];/*
@@ -232,9 +234,9 @@ bool xe_sched_job_completed(struct xe_sched_job *job)* parallel handshake is done. */ -return !__dma_fence_is_later (xe_sched_job_lrc_seqno (job), -xe_lrc_seqno (lrc), -dma_fence_chain_contained (job->fence)->ops); +return !__dma_fence_is_later (fence, +xe_sched_job_lrc_seqno (job), +xe_lrc_seqno (lrc)); }void xe_sched_job_arm (struct xe_sched_job *job)
include/linux/dma-fence.h +4 -5
@@ -441,21 +441,20 @@ dma_fence_is_signaled(struct dma_fence *fence)/** * __dma_fence_is_later - return if f1 is chronologically later than f2 +* @fence: fence in whose context to do the comparison * @f1: the first fence's seqno * @f2: the second fence's seqno from the same context -* @ops: dma_fence_ops associated with the seqno * * Returns true if f1 is chronologically later than f2. Both fences must be * from the same context, since a seqno is not common across contexts. */ -static inline bool __dma_fence_is_later (u64 f1,u64 f2, -const struct dma_fence_ops *ops) +static inline bool __dma_fence_is_later (struct dma_fence *fence,u64 f1,u64 f2) {/* This is for backward compatibility with drivers which can only handle * 32bit sequence numbers. Use a 64bit compare when the driver says to * do so. */ -if (ops->use_64bit_seqno) +if (fence->ops->use_64bit_seqno)return f1 > f2;return (int )(lower_32_bits (f1) -lower_32_bits (f2)) >0 ;
@@ -475,7 +474,7 @@ static inline bool dma_fence_is_later(struct dma_fence *f1,if (WARN_ON (f1->context != f2->context))return false; -return __dma_fence_is_later (f1->seqno, f2->seqno, f1->ops); +return __dma_fence_is_later (f1, f1->seqno, f2->seqno); }/**
Signature · 1 line
2.48.0
RFC v3 2/10 dma-fence: Use a flag for 64-bit seqnos
In reply to Tvrtko UrsulinWith the goal of reducing the need for drivers to touch (and dereference) fence->ops, we move the 64-bit seqnos flag from struct dma_fence_ops to the fence->flags.
Drivers which were setting this flag are changed to use new dma_fence_init64() instead of dma_fence_init().
--- drivers/dma-buf/dma-fence-chain.c | 5 ++--- drivers/dma-buf/dma-fence.c | 9 +++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c | 5 ++--- include/linux/dma-fence.h | 14 +++++--------- 4 files changed, 18 insertions(+), 15 deletions(-)
drivers/dma-buf/dma-fence-chain.c +2 -3
@@ -218,7 +218,6 @@ static void dma_fence_chain_set_deadline(struct dma_fence *fence, }const struct dma_fence_ops dma_fence_chain_ops = { - .use_64bit_seqno = true, .get_driver_name = dma_fence_chain_get_driver_name, .get_timeline_name = dma_fence_chain_get_timeline_name, .enable_signaling = dma_fence_chain_enable_signaling,
@@ -262,8 +261,8 @@ void dma_fence_chain_init(struct dma_fence_chain *chain, seqno =max (prev->seqno, seqno); } -dma_fence_init (&chain->base, &dma_fence_chain_ops, - &chain->lock, context, seqno); +dma_fence_init64 (&chain->base, &dma_fence_chain_ops, &chain->lock, + context, seqno);/* * Chaining dma_fence_chain container together is only allowed through
drivers/dma-buf/dma-fence.c +9 -0
@@ -1023,3 +1023,12 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,trace_dma_fence_init (fence); }EXPORT_SYMBOL (dma_fence_init); + +void +dma_fence_init64 (struct dma_fence *fence,const struct dma_fence_ops *ops, +spinlock_t *lock,u64 context,u64 seqno) +{ +dma_fence_init (fence, ops, lock, context, seqno); +__set_bit (DMA_FENCE_FLAG_SEQNO64_BIT , &fence->flags); +} +EXPORT_SYMBOL (dma_fence_init64);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_tlb_fence.c +2 -3
@@ -71,7 +71,6 @@ static void amdgpu_tlb_fence_work(struct work_struct *work) }static const struct dma_fence_ops amdgpu_tlb_fence_ops = { - .use_64bit_seqno = true, .get_driver_name = amdgpu_tlb_fence_get_driver_name, .get_timeline_name = amdgpu_tlb_fence_get_timeline_name };
@@ -101,8 +100,8 @@ void amdgpu_vm_tlb_fence_create(struct amdgpu_device *adev, struct amdgpu_vm *vmINIT_WORK (&f->work, amdgpu_tlb_fence_work);spin_lock_init (&f->lock); -dma_fence_init (&f->base, &amdgpu_tlb_fence_ops, &f->lock, - vm->tlb_fence_context,atomic64_read (&vm->tlb_seq)); +dma_fence_init64 (&f->base, &amdgpu_tlb_fence_ops, &f->lock, + vm->tlb_fence_context,atomic64_read (&vm->tlb_seq));/* TODO: We probably need a separate wq here */ dma_fence_get (&f->base);
include/linux/dma-fence.h +5 -9
@@ -97,6 +97,7 @@ struct dma_fence { };enum dma_fence_flag_bits { +DMA_FENCE_FLAG_SEQNO64_BIT ,DMA_FENCE_FLAG_SIGNALED_BIT ,DMA_FENCE_FLAG_TIMESTAMP_BIT ,DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT ,
@@ -124,14 +125,6 @@ struct dma_fence_cb {* */ struct dma_fence_ops { -/** -* @use_64bit_seqno: -* -* True if this dma_fence implementation uses 64bit seqno, false -* otherwise. -*/ -bool use_64bit_seqno; -/** * @get_driver_name: *
@@ -262,6 +255,9 @@ struct dma_fence_ops {void dma_fence_init (struct dma_fence *fence,const struct dma_fence_ops *ops,spinlock_t *lock,u64 context,u64 seqno); +void dma_fence_init64 (struct dma_fence *fence,const struct dma_fence_ops *ops, +spinlock_t *lock,u64 context,u64 seqno); +void dma_fence_release (struct kref *kref);void dma_fence_free (struct dma_fence *fence);void dma_fence_describe (struct dma_fence *fence,struct seq_file *seq);
@@ -454,7 +450,7 @@ static inline bool __dma_fence_is_later(struct dma_fence *fence, u64 f1, u64 f2)* 32bit sequence numbers. Use a 64bit compare when the driver says to * do so. */ -if (fence->ops->use_64bit_seqno) +if (test_bit (DMA_FENCE_FLAG_SEQNO64_BIT , &fence->flags))return f1 > f2;return (int )(lower_32_bits (f1) -lower_32_bits (f2)) >0 ;
Signature · 1 line
2.48.0
RFC v3 3/10 dma-fence: Add helpers for accessing driver and timeline name
In reply to Tvrtko UrsulinAdd some helpers in order to enable preventing dma-fence users accessing the implementation details directly and make the implementation itself use them.
This will also enable later adding some asserts to a consolidated location.
--- drivers/dma-buf/dma-fence.c | 9 +++++---- include/linux/dma-fence.h | 10 ++++++++++ include/trace/events/dma_fence.h | 4 ++-- 3 files changed, 17 insertions(+), 6 deletions(-)
drivers/dma-buf/dma-fence.c +5 -4
@@ -538,8 +538,8 @@ void dma_fence_release(struct kref *kref)if (WARN (!list_empty (&fence->cb_list) && !test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags),"Fence %s:%s:%llx:%llx released with pending signals!\n" , - fence->ops->get_driver_name (fence), - fence->ops->get_timeline_name (fence), +dma_fence_driver_name (fence), +dma_fence_timeline_name (fence), fence->context, fence->seqno)) {unsigned long flags;
@@ -983,8 +983,9 @@ EXPORT_SYMBOL(dma_fence_set_deadline);void dma_fence_describe (struct dma_fence *fence,struct seq_file *seq) {seq_printf (seq,"%s %s seq %llu %ssignalled\n" , - fence->ops->get_driver_name (fence), - fence->ops->get_timeline_name (fence), fence->seqno, +dma_fence_driver_name (fence), +dma_fence_timeline_name (fence), + fence->seqno,dma_fence_is_signaled (fence) ?"" :"un" ); }EXPORT_SYMBOL (dma_fence_describe);
include/linux/dma-fence.h +10 -0
@@ -377,6 +377,16 @@ bool dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb);void dma_fence_enable_sw_signaling (struct dma_fence *fence); +static inline const char *dma_fence_driver_name (struct dma_fence *fence) +{ +return fence->ops->get_driver_name (fence); +} + +static inline const char *dma_fence_timeline_name (struct dma_fence *fence) +{ +return fence->ops->get_timeline_name (fence); +} +/** * dma_fence_is_signaled_locked - Return an indication if the fence * is signaled yet.
include/trace/events/dma_fence.h +2 -2
@@ -16,8 +16,8 @@ DECLARE_EVENT_CLASS(dma_fence,TP_ARGS (fence),TP_STRUCT__entry ( - __string(driver, fence->ops->get_driver_name(fence)) - __string(timeline, fence->ops->get_timeline_name(fence)) + __string(driver, dma_fence_driver_name(fence)) + __string(timeline, dma_fence_timeline_name(fence)) __field(unsigned int, context) __field(unsigned int, seqno) ),
Signature · 1 line
2.48.0
RFC v3 4/10 sync_file: Use dma-fence driver and timeline name helpers
In reply to Tvrtko UrsulinAccess the dma-fence internals via the previously added helpers.
--- drivers/dma-buf/sync_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/dma-buf/sync_file.c +4 -4
@@ -137,8 +137,8 @@ char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len)struct dma_fence *fence = sync_file->fence;snprintf (buf, len,"%s-%s%llu-%lld" , - fence->ops->get_driver_name (fence), - fence->ops->get_timeline_name (fence), +dma_fence_driver_name (fence), +dma_fence_timeline_name (fence), fence->context, fence->seqno); }
@@ -262,9 +262,9 @@ static long sync_file_ioctl_merge(struct sync_file *sync_file,static int sync_fill_fence_info (struct dma_fence *fence,struct sync_fence_info *info) { -strscpy (info->obj_name, fence->ops->get_timeline_name (fence), +strscpy (info->obj_name,dma_fence_timeline_name (fence),sizeof (info->obj_name)); -strscpy (info->driver_name, fence->ops->get_driver_name (fence), +strscpy (info->driver_name,dma_fence_driver_name (fence),sizeof (info->driver_name)); info->status =dma_fence_get_status (fence);
Signature · 1 line
2.48.0
RFC v3 5/10 drm/amdgpu: Use dma-fence driver and timeline name helpers
In reply to Tvrtko UrsulinAccess the dma-fence internals via the previously added helpers.
Drop the macro while at it, since the length is now more manageable.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +2 -7
@@ -32,9 +32,6 @@#define TRACE_SYSTEM amdgpu#define TRACE_INCLUDE_FILE amdgpu_trace -#define AMDGPU_JOB_GET_TIMELINE_NAME (job) \ - job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished) - TRACE_EVENT(amdgpu_device_rreg, TP_PROTO(unsigned did, uint32_t reg, uint32_t value), TP_ARGS(did, reg, value),
@@ -168,7 +165,7 @@ TRACE_EVENT(amdgpu_cs_ioctl,TP_ARGS (job),TP_STRUCT__entry ( __field(uint64_t, sched_job_id) - __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) + __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __field(struct dma_fence *, fence)
@@ -194,7 +191,7 @@ TRACE_EVENT(amdgpu_sched_run_job,TP_ARGS (job),TP_STRUCT__entry ( __field(uint64_t, sched_job_id) - __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) + __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __string(ring, to_amdgpu_ring(job->base.sched)->name)
@@ -585,8 +582,6 @@ TRACE_EVENT(amdgpu_reset_reg_dumps, __entry->address, __entry->value) ); - -#undef AMDGPU_JOB_GET_TIMELINE_NAME#endif /* This part must be outside protection */
Signature · 1 line
2.48.0
Re: [RFC v3 05/10] drm/amdgpu: Use dma-fence driver and timeline name helpers
Quoted 5 lines · Tvrtko Ursulin
Access the dma-fence internals via the previously added helpers.
Drop the macro while at it, since the length is now more manageable.
Signed-off-by Tvrtko Ursulin <[email protected]>
Quoted 45 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +2
-7@@ -32,9 +32,6 @@#define TRACE_SYSTEM amdgpu#define TRACE_INCLUDE_FILE amdgpu_trace -#define AMDGPU_JOB_GET_TIMELINE_NAME (job) \ - job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished) - TRACE_EVENT(amdgpu_device_rreg, TP_PROTO(unsigned did, uint32_t reg, uint32_t value), TP_ARGS(did, reg, value),@@ -168,7 +165,7 @@ TRACE_EVENT(amdgpu_cs_ioctl,TP_ARGS (job),TP_STRUCT__entry ( __field(uint64_t, sched_job_id) - __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) + __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __field(struct dma_fence *, fence)@@ -194,7 +191,7 @@ TRACE_EVENT(amdgpu_sched_run_job,TP_ARGS (job),TP_STRUCT__entry ( __field(uint64_t, sched_job_id) - __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) + __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished)) __field(unsigned int, context) __field(unsigned int, seqno) __string(ring, to_amdgpu_ring(job->base.sched)->name)@@ -585,8 +582,6 @@ TRACE_EVENT(amdgpu_reset_reg_dumps, __entry->address, __entry->value) ); - -#undef AMDGPU_JOB_GET_TIMELINE_NAME#endif /* This part must be outside protection */
RFC v3 6/10 drm/i915: Use dma-fence driver and timeline name helpers
In reply to Tvrtko UrsulinAccess the dma-fence internals via the previously added helpers.
--- drivers/gpu/drm/i915/gt/intel_gt_requests.c | 4 ++-- drivers/gpu/drm/i915/i915_request.c | 2 +- drivers/gpu/drm/i915/i915_sw_fence.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt_requests.c +2 -2
@@ -252,8 +252,8 @@ void intel_gt_watchdog_work(struct work_struct *work)struct dma_fence *f = &rq->fence;pr_notice ("Fence expiration time out i915-%s:%s:%llx!\n" , - f->ops->get_driver_name (f), - f->ops->get_timeline_name (f), +dma_fence_driver_name (f), +dma_fence_timeline_name (f), f->seqno);i915_request_cancel (rq, -EINTR ); }
drivers/gpu/drm/i915/i915_request.c +1 -1
@@ -2184,7 +2184,7 @@ void i915_request_show(struct drm_printer *m,const char *prefix, int indent) { - const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence); + const char *name = dma_fence_timeline_name((struct dma_fence *)&rq->fence);char buf[80 ] ="" ;int x =0 ;
drivers/gpu/drm/i915/i915_sw_fence.c +2 -2
@@ -435,8 +435,8 @@ static void timer_i915_sw_fence_wake(struct timer_list *t)return ;pr_notice ("Asynchronous wait on fence %s:%s:%llx timed out (hint:%ps)\n" , - cb->dma->ops->get_driver_name (cb->dma), - cb->dma->ops->get_timeline_name (cb->dma), +dma_fence_driver_name (cb->dma), +dma_fence_timeline_name (cb->dma), cb->dma->seqno,i915_sw_fence_debug_hint (fence));
Signature · 1 line
2.48.0
RFC v3 7/10 dma-fence: Add safe access helpers and document the rules
In reply to Tvrtko UrsulinDma-fence objects currently suffer from a potential use after free problem where fences exported to userspace and other drivers can outlive the exporting driver, or the associated data structures.
The discussion on how to address this concluded that adding reference counting to all the involved objects is not desirable, since it would need to be very wide reaching and could cause unloadable drivers if another entity would be holding onto a signaled fence reference potentially indefinitely.
This patch enables the safe access by introducing and documenting a contract between fence exporters and users. It documents a set of contraints and adds helpers which a) drivers with potential to suffer from the use after free must use and b) users of the dma-fence API must use as well.
Premise of the design has multiple sides:
1. Drivers (fence exporters) MUST ensure a RCU grace period between signalling a fence and freeing the driver private data associated with it.
The grace period does not have to follow the signalling immediately but HAS to happen before data is freed.
2. Users of the dma-fence API marked with such requirement MUST contain the complete access to the data within a single code block guarded by the new dma_fence_access_begin() and dma_fence_access_end() helpers.
The combination of the two ensures that whoever sees the DMA_FENCE_FLAG_SIGNALED_BIT not set is guaranteed to have access to a valid fence->lock and valid data potentially accessed by the fence->ops virtual functions, until the call to dma_fence_access_end().
3. Module unload (fence->ops) disappearing is for now explicitly not handled. That would required a more complex protection, possibly needing SRCU instead of RCU to handle callers such as dma_fence_wait_timeout(), where race between dma_fence_enable_sw_signaling, signalling, and dereference of fence->ops->wait() would need a sleeping SRCU context.
--- drivers/dma-buf/dma-fence.c | 69 +++++++++++++++++++++++++++++++++++++ include/linux/dma-fence.h | 32 ++++++++++++----- 2 files changed, 93 insertions(+), 8 deletions(-)
drivers/dma-buf/dma-fence.c +69 -0
@@ -533,6 +533,7 @@ void dma_fence_release(struct kref *kref)struct dma_fence *fence = container_of(kref, struct dma_fence, refcount); +dma_fence_access_begin ();trace_dma_fence_destroy (fence); if (WARN(!list_empty(&fence->cb_list) &&
@@ -560,6 +561,8 @@ void dma_fence_release(struct kref *kref) fence->ops->release (fence); elsedma_fence_free (fence ); + +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_release);
@@ -982,11 +985,13 @@ EXPORT_SYMBOL(dma_fence_set_deadline);*/ void dma_fence_describe (struct dma_fence *fence,struct seq_file *seq) { +dma_fence_access_begin ();seq_printf (seq,"%s %s seq %llu %ssignalled\n" ,dma_fence_driver_name (fence),dma_fence_timeline_name (fence), fence->seqno,dma_fence_is_signaled (fence) ?"" :"un" ); +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_describe);
@@ -1033,3 +1038,67 @@ dma_fence_init64(struct dma_fence *fence, const struct dma_fence_ops *ops,__set_bit (DMA_FENCE_FLAG_SEQNO64_BIT , &fence->flags); }EXPORT_SYMBOL (dma_fence_init64); + +/** +* dma_fence_driver_name - Access the driver name +* @fence: the fence to query +* +* Returns a driver name backing the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_driver_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "detached-driver" ; +} +EXPORT_SYMBOL (dma_fence_driver_name); + +/** +* dma_fence_timeline_name - Access the timeline name +* @fence: the fence to query +* +* Returns a timeline name provided by the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_timeline_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "signaled-timeline" ; +} +EXPORT_SYMBOL (dma_fence_timeline_name);
include/linux/dma-fence.h +24 -8
@@ -377,15 +377,31 @@ bool dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb);void dma_fence_enable_sw_signaling (struct dma_fence *fence); -static inline const char *dma_fence_driver_name (struct dma_fence *fence) -{ -return fence->ops->get_driver_name (fence); -} +/** +* DOC: Safe external access to driver provided object members +* +* All data not stored directly in the dma-fence object, such as the +* &dma_fence.lock and memory potentially accessed by functions in the +* &dma_fence.ops table, MUST NOT be accessed after the fence has been signalled +* because after that point drivers are allowed to free it. +* +* All code accessing that data via the dma-fence API (or directly, which is +* discouraged), MUST make sure to contain the complete access within a +* &dma_fence_access_begin and &dma_fence_access_end pair. +* +* Some dma-fence API handles this automatically, while other, as for example +* &dma_fence_driver_name and &dma_fence_timeline_name, leave that +* responsibility to the caller. +* +* To enable this scheme to work drivers MUST ensure a RCU grace period elapses +* between signalling the fence and freeing the said data. +* +*/ +#define dma_fence_access_begin rcu_read_lock +#define dma_fence_access_end rcu_read_unlock -static inline const char *dma_fence_timeline_name (struct dma_fence *fence) -{ -return fence->ops->get_timeline_name (fence); -} +const char *dma_fence_driver_name (struct dma_fence *fence); +const char *dma_fence_timeline_name (struct dma_fence *fence);/** * dma_fence_is_signaled_locked - Return an indication if the fence
Signature · 1 line
2.48.0
Christian König
maintainerRe: [RFC v3 07/10] dma-fence: Add safe access helpers and document the rules
I'm going to push patches #1-#6 to drm-misc-next.
They make sense as a stand alone cleanups anyway.
But that here needs a bit more documentation I think.
Quoted 16 lines · Tvrtko Ursulin
Dma-fence objects currently suffer from a potential use after free problem where fences exported to userspace and other drivers can outlive the exporting driver, or the associated data structures.
The discussion on how to address this concluded that adding reference counting to all the involved objects is not desirable, since it would need to be very wide reaching and could cause unloadable drivers if another entity would be holding onto a signaled fence reference potentially indefinitely.
This patch enables the safe access by introducing and documenting a contract between fence exporters and users. It documents a set of contraints and adds helpers which a) drivers with potential to suffer from the use after free must use and b) users of the dma-fence API must use as well.
Quoted 4 lines
Premise of the design has multiple sides:
1. Drivers (fence exporters) MUST ensure a RCU grace period between signalling a fence and freeing the driver private data associated with it.
That's a must have anyway, otherwise functions like dma_fence_get_rcu() won't work.
I hope that we have documented that somewhere, but I'm not 100% sure to be honest.
Quoted 2 lines
The grace period does not have to follow the signalling immediately but HAS to happen before data is freed.
That is the new requirement we have to document somehow.
I'm not 100% sure but I think module unloading waits for an RCU grace period anyway.
Quoted 8 lines
2. Users of the dma-fence API marked with such requirement MUST contain the complete access to the data within a single code block guarded by the new
dma_fence_access_begin()anddma_fence_access_end()helpers.The combination of the two ensures that whoever sees the
DMA_FENCE_FLAG_SIGNALED_BITnot set is guaranteed to have access to a validfence->lockand valid data potentially accessed by thefence->opsvirtual functions, until the call todma_fence_access_end().
Mhm, how about returning copies of the string?
This is only for debugging anyway and kstrdup_const() isn't that costly.
Regards,
Christian.
Quoted 160 lines
3. Module unload (
fence->ops) disappearing is for now explicitly not handled. That would required a more complex protection, possibly needing SRCU instead of RCU to handle callers such asdma_fence_wait_timeout(), where race betweendma_fence_enable_sw_signaling, signalling, and dereference offence->ops->wait()would need a sleeping SRCU context.Signed-off-by Tvrtko Ursulin <[email protected]>--- drivers/dma-buf/dma-fence.c | 69 +++++++++++++++++++++++++++++++++++++ include/linux/dma-fence.h | 32 ++++++++++++----- 2 files changed, 93 insertions(+), 8 deletions(-)drivers/dma-buf/dma-fence.c +69
-0@@ -533,6 +533,7 @@ void dma_fence_release(struct kref *kref)struct dma_fence *fence = container_of(kref, struct dma_fence, refcount); +dma_fence_access_begin ();trace_dma_fence_destroy (fence); if (WARN(!list_empty(&fence->cb_list) &&@@ -560,6 +561,8 @@ void dma_fence_release(struct kref *kref) fence->ops->release (fence); elsedma_fence_free (fence ); + +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_release);@@ -982,11 +985,13 @@ EXPORT_SYMBOL(dma_fence_set_deadline);*/ void dma_fence_describe (struct dma_fence *fence,struct seq_file *seq) { +dma_fence_access_begin ();seq_printf (seq,"%s %s seq %llu %ssignalled\n" ,dma_fence_driver_name (fence),dma_fence_timeline_name (fence), fence->seqno,dma_fence_is_signaled (fence) ?"" :"un" ); +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_describe);@@ -1033,3 +1038,67 @@ dma_fence_init64(struct dma_fence *fence, const struct dma_fence_ops *ops,__set_bit (DMA_FENCE_FLAG_SEQNO64_BIT , &fence->flags); }EXPORT_SYMBOL (dma_fence_init64); + +/** +* dma_fence_driver_name - Access the driver name +* @fence: the fence to query +* +* Returns a driver name backing the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_driver_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "detached-driver" ; +} +EXPORT_SYMBOL (dma_fence_driver_name); + +/** +* dma_fence_timeline_name - Access the timeline name +* @fence: the fence to query +* +* Returns a timeline name provided by the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_timeline_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "signaled-timeline" ; +} +EXPORT_SYMBOL (dma_fence_timeline_name);include/linux/dma-fence.h +24
-8@@ -377,15 +377,31 @@ bool dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb);void dma_fence_enable_sw_signaling (struct dma_fence *fence); -static inline const char *dma_fence_driver_name (struct dma_fence *fence) -{ -return fence->ops->get_driver_name (fence); -} +/** +* DOC: Safe external access to driver provided object members +* +* All data not stored directly in the dma-fence object, such as the +* &dma_fence.lock and memory potentially accessed by functions in the +* &dma_fence.ops table, MUST NOT be accessed after the fence has been signalled +* because after that point drivers are allowed to free it. +* +* All code accessing that data via the dma-fence API (or directly, which is +* discouraged), MUST make sure to contain the complete access within a +* &dma_fence_access_begin and &dma_fence_access_end pair. +* +* Some dma-fence API handles this automatically, while other, as for example +* &dma_fence_driver_name and &dma_fence_timeline_name, leave that +* responsibility to the caller. +* +* To enable this scheme to work drivers MUST ensure a RCU grace period elapses +* between signalling the fence and freeing the said data. +* +*/ +#define dma_fence_access_begin rcu_read_lock +#define dma_fence_access_end rcu_read_unlock -static inline const char *dma_fence_timeline_name (struct dma_fence *fence) -{ -return fence->ops->get_timeline_name (fence); -} +const char *dma_fence_driver_name (struct dma_fence *fence); +const char *dma_fence_timeline_name (struct dma_fence *fence);/** * dma_fence_is_signaled_locked - Return an indication if the fence
Re: [RFC v3 07/10] dma-fence: Add safe access helpers and document the rules
Quoted 3 lines · Christian König
I'm going to push patches #1-#6 to drm-misc-next.
They make sense as a stand alone cleanups anyway.
Holding off for now because the 64 bit seqno flag needs a build fix. I have it locally but was waiting for more feedback on the series.
Quoted 19 lines
But that here needs a bit more documentation I think.
Quoted 16 lines · Tvrtko Ursulin
Dma-fence objects currently suffer from a potential use after free problem where fences exported to userspace and other drivers can outlive the exporting driver, or the associated data structures.
The discussion on how to address this concluded that adding reference counting to all the involved objects is not desirable, since it would need to be very wide reaching and could cause unloadable drivers if another entity would be holding onto a signaled fence reference potentially indefinitely.
This patch enables the safe access by introducing and documenting a contract between fence exporters and users. It documents a set of contraints and adds helpers which a) drivers with potential to suffer from the use after free must use and b) users of the dma-fence API must use as well.
Quoted 6 lines
Quoted 4 lines
Premise of the design has multiple sides:
1. Drivers (fence exporters) MUST ensure a RCU grace period between signalling a fence and freeing the driver private data associated with it.
That's a must have anyway, otherwise functions like
dma_fence_get_rcu()won't work.
That one is for the fence object itself, right? Above I was specifically talking about the data pointed to from the fence such as the lock and and driver data accessible via the ops vfuncs.
Quoted 6 lines
I hope that we have documented that somewhere, but I'm not 100% sure to be honest.
Quoted 2 lines
The grace period does not have to follow the signalling immediately but HAS to happen before data is freed.
That is the new requirement we have to document somehow.
It is still the same number 1) bullet point. Just clarifying that one does not need engineer for grace periods right after signalling.
Quoted 7 lines
I'm not 100% sure but I think module unloading waits for an RCU grace period anyway.
Quoted 4 lines
2. Users of the dma-fence API marked with such requirement MUST contain the complete access to the data within a single code block guarded by the new
dma_fence_access_begin()anddma_fence_access_end()helpers.
Quoted 8 lines
Quoted 4 lines
The combination of the two ensures that whoever sees the
DMA_FENCE_FLAG_SIGNALED_BITnot set is guaranteed to have access to a validfence->lockand valid data potentially accessed by thefence->opsvirtual functions, until the call todma_fence_access_end().Mhm, how about returning copies of the string?
This is only for debugging anyway and
kstrdup_const()isn't that costly.
Not sure exactly how that would work. Wouldn't it imply either GFP_ATOMIC or upgrading the RCU requirements to SRCU?
Regards,
Tvrtko
Quoted 160 lines
Quoted 159 lines
3. Module unload (
fence->ops) disappearing is for now explicitly not handled. That would required a more complex protection, possibly needing SRCU instead of RCU to handle callers such asdma_fence_wait_timeout(), where race betweendma_fence_enable_sw_signaling, signalling, and dereference offence->ops->wait()would need a sleeping SRCU context.Signed-off-by Tvrtko Ursulin <[email protected]>--- drivers/dma-buf/dma-fence.c | 69 +++++++++++++++++++++++++++++++++++++ include/linux/dma-fence.h | 32 ++++++++++++----- 2 files changed, 93 insertions(+), 8 deletions(-)drivers/dma-buf/dma-fence.c +69
-0@@ -533,6 +533,7 @@ void dma_fence_release(struct kref *kref)struct dma_fence *fence = container_of(kref, struct dma_fence, refcount); +dma_fence_access_begin ();trace_dma_fence_destroy (fence); if (WARN(!list_empty(&fence->cb_list) &&@@ -560,6 +561,8 @@ void dma_fence_release(struct kref *kref) fence->ops->release (fence); elsedma_fence_free (fence ); + +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_release);@@ -982,11 +985,13 @@ EXPORT_SYMBOL(dma_fence_set_deadline);*/ void dma_fence_describe (struct dma_fence *fence,struct seq_file *seq) { +dma_fence_access_begin ();seq_printf (seq,"%s %s seq %llu %ssignalled\n" ,dma_fence_driver_name (fence),dma_fence_timeline_name (fence), fence->seqno,dma_fence_is_signaled (fence) ?"" :"un" ); +dma_fence_access_end (); }EXPORT_SYMBOL (dma_fence_describe);@@ -1033,3 +1038,67 @@ dma_fence_init64(struct dma_fence *fence, const struct dma_fence_ops *ops,__set_bit (DMA_FENCE_FLAG_SEQNO64_BIT , &fence->flags); }EXPORT_SYMBOL (dma_fence_init64); + +/** +* dma_fence_driver_name - Access the driver name +* @fence: the fence to query +* +* Returns a driver name backing the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_driver_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "detached-driver" ; +} +EXPORT_SYMBOL (dma_fence_driver_name); + +/** +* dma_fence_timeline_name - Access the timeline name +* @fence: the fence to query +* +* Returns a timeline name provided by the dma-fence implementation. +* +* IMPORTANT CONSIDERATION: +* Dma-fence contract stipulates that access to driver provided data (data not +* directly embedded into the object itself), such as the &dma_fence.lock and +* memory potentially accessed by the &dma_fence.ops functions, is forbidden +* after the fence has been signalled. Drivers are allowed to free that data, +* and some do. +* +* To allow safe access drivers are mandated to guarantee a RCU grace period +* between signalling the fence and freeing said data. +* +* As such access to the driver name is only valid inside a RCU locked section. +* The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded +* by the &dma_fence_access_being and &dma_fence_access_end pair. +*/ +const char *dma_fence_timeline_name (struct dma_fence *fence) +{ +RCU_LOCKDEP_WARN (!rcu_read_lock_held (), +"rcu_read_lock() required for safe access to returned string" ); + +if (!test_bit (DMA_FENCE_FLAG_SIGNALED_BIT , &fence->flags)) +return fence->ops->get_driver_name (fence); +else +return "signaled-timeline" ; +} +EXPORT_SYMBOL (dma_fence_timeline_name);include/linux/dma-fence.h +24
-8@@ -377,15 +377,31 @@ bool dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb);void dma_fence_enable_sw_signaling (struct dma_fence *fence); -static inline const char *dma_fence_driver_name (struct dma_fence *fence) -{ -return fence->ops->get_driver_name (fence); -} +/** +* DOC: Safe external access to driver provided object members +* +* All data not stored directly in the dma-fence object, such as the +* &dma_fence.lock and memory potentially accessed by functions in the +* &dma_fence.ops table, MUST NOT be accessed after the fence has been signalled +* because after that point drivers are allowed to free it. +* +* All code accessing that data via the dma-fence API (or directly, which is +* discouraged), MUST make sure to contain the complete access within a +* &dma_fence_access_begin and &dma_fence_access_end pair. +* +* Some dma-fence API handles this automatically, while other, as for example +* &dma_fence_driver_name and &dma_fence_timeline_name, leave that +* responsibility to the caller. +* +* To enable this scheme to work drivers MUST ensure a RCU grace period elapses +* between signalling the fence and freeing the said data. +* +*/ +#define dma_fence_access_begin rcu_read_lock +#define dma_fence_access_end rcu_read_unlock -static inline const char *dma_fence_timeline_name (struct dma_fence *fence) -{ -return fence->ops->get_timeline_name (fence); -} +const char *dma_fence_driver_name (struct dma_fence *fence); +const char *dma_fence_timeline_name (struct dma_fence *fence);/** * dma_fence_is_signaled_locked - Return an indication if the fence
RFC v3 8/10 sync_file: Protect access to driver and timeline name
In reply to Tvrtko UrsulinProtect the access to driver and timeline name which otherwise could be freed as dma-fence exported is signalling fences.
--- drivers/dma-buf/sync_file.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/dma-buf/sync_file.c +6 -0
@@ -136,11 +136,13 @@ char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len) }else {struct dma_fence *fence = sync_file->fence; +dma_fence_access_begin ();snprintf (buf, len,"%s-%s%llu-%lld" ,dma_fence_driver_name (fence),dma_fence_timeline_name (fence), fence->context, fence->seqno); +dma_fence_access_end (); }return buf;
@@ -262,6 +264,8 @@ static long sync_file_ioctl_merge(struct sync_file *sync_file,static int sync_fill_fence_info (struct dma_fence *fence,struct sync_fence_info *info) { +dma_fence_access_begin (); +strscpy (info->obj_name,dma_fence_timeline_name (fence),sizeof (info->obj_name)); strscpy(info->driver_name, dma_fence_driver_name(fence),
@@ -273,6 +277,8 @@ static int sync_fill_fence_info(struct dma_fence *fence, ktime_to_ns(dma_fence_timestamp(fence)) :ktime_set (0 ,0 ); +dma_fence_access_end (); +return info->status; }
Signature · 1 line
2.48.0
RFC v3 9/10 drm/i915: Protect access to driver and timeline name
In reply to Tvrtko UrsulinProtect the access to driver and timeline name which otherwise could be freed as dma-fence exported is signalling fences.
--- drivers/gpu/drm/i915/gt/intel_gt_requests.c | 2 ++ drivers/gpu/drm/i915/i915_request.c | 5 +++-- drivers/gpu/drm/i915/i915_sw_fence.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt_requests.c +2 -0
@@ -251,10 +251,12 @@ void intel_gt_watchdog_work(struct work_struct *work)if (!i915_request_completed (rq)) {struct dma_fence *f = &rq->fence; +dma_fence_access_begin ();pr_notice ("Fence expiration time out i915-%s:%s:%llx!\n" ,dma_fence_driver_name (f),dma_fence_timeline_name (f), f->seqno); +dma_fence_access_end ();i915_request_cancel (rq, -EINTR ); }i915_request_put (rq);
drivers/gpu/drm/i915/i915_request.c +3 -2
@@ -2184,7 +2184,6 @@ void i915_request_show(struct drm_printer *m,const char *prefix, int indent) { - const char *name = dma_fence_timeline_name((struct dma_fence *)&rq->fence); char buf[80] = "";int x =0 ;
@@ -2220,6 +2219,7 @@ void i915_request_show(struct drm_printer *m, x =print_sched_attr (&rq->sched.attr, buf, x,sizeof (buf)); +dma_fence_access_begin (); drm_printf(m, "%s%.*s%c %llx:%lld%s%s %s @ %dms: %s\n", prefix, indent, " ", queue_status(rq),
@@ -2228,7 +2228,8 @@ void i915_request_show(struct drm_printer *m,fence_status (rq), buf,jiffies_to_msecs (jiffies - rq->emitted_jiffies), - name); + dma_fence_timeline_name((struct dma_fence *)&rq->fence)); +dma_fence_access_end (); }static bool engine_match_ring (struct intel_engine_cs *engine,struct i915_request *rq)
drivers/gpu/drm/i915/i915_sw_fence.c +2 -0
@@ -434,11 +434,13 @@ static void timer_i915_sw_fence_wake(struct timer_list *t)if (!fence)return ; +dma_fence_access_begin ();pr_notice ("Asynchronous wait on fence %s:%s:%llx timed out (hint:%ps)\n" ,dma_fence_driver_name (cb->dma),dma_fence_timeline_name (cb->dma), cb->dma->seqno,i915_sw_fence_debug_hint (fence)); +dma_fence_access_end ();i915_sw_fence_set_error_once (fence, -ETIMEDOUT );i915_sw_fence_complete (fence);
Signature · 1 line
2.48.0
RFC v3 10/10 drm/xe: Make dma-fences compliant with the safe access rules
In reply to Tvrtko UrsulinXe can free some of the data pointed to by the dma-fences it exports. Most notably the timeline name can get freed if userspace closes the associated submit queue. At the same time the fence could have been exported to a third party (for example a sync_fence fd) which will then cause an use- after-free on subsequent access.
To make this safe we need to make the driver compliant with the newly documented dma-fence rules. Driver has to ensure a RCU grace period between signalling a fence and freeing any data pointed to by said fence.
For the timeline name we simply make the queue be freed via kfree_rcu and for the shared lock associated with multiple queues we add a RCU grace period before freeing the per GT structure holding the lock.
--- drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 2 ++ drivers/gpu/drm/xe/xe_guc_submit.c | 7 ++++++- drivers/gpu/drm/xe/xe_hw_fence.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_guc_exec_queue_types.h +2 -0
@@ -20,6 +20,8 @@ struct xe_exec_queue;struct xe_guc_exec_queue {/** @q: Backpointer to parent xe_exec_queue */ struct xe_exec_queue *q; +/** @rcu: For safe freeing of exported dma fences */ +struct rcu_head rcu;/** @sched: GPU scheduler for this xe_exec_queue */ struct xe_gpu_scheduler sched;/** @entity: Scheduler entity for this xe_exec_queue */
drivers/gpu/drm/xe/xe_guc_submit.c +6 -1
@@ -1291,7 +1291,11 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)xe_sched_entity_fini (&ge->entity);xe_sched_fini (&ge->sched); -kfree (ge); +/* +* RCU free due sched being exported via DRM scheduler fences +* (timeline name). +*/ +kfree_rcu (ge, rcu);xe_exec_queue_fini (q);xe_pm_runtime_put (guc_to_xe (guc)); }
@@ -1474,6 +1478,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) q->guc = ge; ge->q = q; +init_rcu_head (&ge->rcu);init_waitqueue_head (&ge->suspend_wait);for (i =0 ; i <MAX_STATIC_MSG_TYPE ; ++i)
drivers/gpu/drm/xe/xe_hw_fence.c +3 -0
@@ -100,6 +100,9 @@ void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq)spin_unlock_irqrestore (&irq->lock, flags);dma_fence_end_signalling (tmp); } + +/* Safe release of the irq->lock used in dma_fence_init. */ +synchronize_rcu (); }void xe_hw_fence_irq_run (struct xe_hw_fence_irq *irq)
Signature · 1 line
2.48.0
Patchwork
CI✗ Fi.CI.BUILD: failure for Some (drm_sched_|dma_)fence lifetime issues (rev2)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Some (drm_sched_|dma_)fence lifetime issues (rev2)
URL : https://patchwork.freedesktop.org/series/148826/
State : failure
== Summary ==
Error: make failed
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC [M] drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.odrivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c:337:10: error: ‘const struct dma_fence_ops’ has no member named ‘use_64bit_seqno’
337 | .use_64bit_seqno = true,
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c:337:28: warning: initialization of ‘const char * (*)(struct dma_fence *)’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
337 | .use_64bit_seqno = true,
| ^~~~drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c:337:28: note: (near initialization for ‘amdgpu_userq_fence_ops.get_driver_name’)
make[6]: *** [scripts/Makefile.build:203: drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.o] Error 1
make[5]: *** [scripts/Makefile.build:461: drivers/gpu/drm/amd/amdgpu] Error 2
make[4]: *** [scripts/Makefile.build:461: drivers/gpu/drm] Error 2
make[3]: *** [scripts/Makefile.build:461: drivers/gpu] Error 2
make[2]: *** [scripts/Makefile.build:461: drivers] Error 2
make[1]: *** [/home/kbuild2/kernel/Makefile:2004: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Build failed, no error log produced
Patchwork
CI✓ CI.Patch_applied: success for Some (drm_sched_|dma_)fence lifetime issues (rev2)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Some (drm_sched_|dma_)fence lifetime issues (rev2)
URL : https://patchwork.freedesktop.org/series/148825/
State : success
== Summary ==
=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: 4fd790cf2b20 drm-tip: 2025y-05m-14d-06h-10m-57s UTC integration manifest === git am output follows ===
Applying: dma-fence: Change signature of __dma_fence_is_later
Applying: dma-fence: Use a flag for 64-bit seqnos
Applying: dma-fence: Add helpers for accessing driver and timeline name
Applying: sync_file: Use dma-fence driver and timeline name helpers
Applying: drm/amdgpu: Use dma-fence driver and timeline name helpers
Applying: drm/i915: Use dma-fence driver and timeline name helpers
Applying: dma-fence: Add safe access helpers and document the rules
Applying: sync_file: Protect access to driver and timeline name
Applying: drm/i915: Protect access to driver and timeline name
Applying: drm/xe: Make dma-fences compliant with the safe access rules
✗ CI.checkpatch: warning for Some (drm_sched_|dma_)fence lifetime issues (rev2)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Some (drm_sched_|dma_)fence lifetime issues (rev2)
URL : https://patchwork.freedesktop.org/series/148825/
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 202708c00696422fd217223bb679a353a5936e23
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 636b44b647b6b27e867b51f52c3ec750baa05f61
Author: Tvrtko Ursulin <[email protected]> Date: Tue May 13 08:45:13 2025 +0100
drm/xe: Make dma-fences compliant with the safe access rules
Xe can free some of the data pointed to by the dma-fences it exports. Most notably the timeline name can get freed if userspace closes the associated submit queue. At the same time the fence could have been exported to a third party (for example a sync_fence fd) which will then cause an use- after-free on subsequent access.
To make this safe we need to make the driver compliant with the newly documented dma-fence rules. Driver has to ensure a RCU grace period between signalling a fence and freeing any data pointed to by said fence.
For the timeline name we simply make the queue be freed via kfree_rcu and for the shared lock associated with multiple queues we add a RCU grace period before freeing the per GT structure holding the lock.
+ /mt/dim checkpatch 4fd790cf2b20fd2ab205aa2a074cecd214562089 drm-intel ee2b886611c9 dma-fence: Change signature of __dma_fence_is_later 4bc7eb42dffc dma-fence: Use a flag for 64-bit seqnos 1f4fabe8b696 dma-fence: Add helpers for accessing driver and timeline name 8c64a8b5f3b9 sync_file: Use dma-fence driver and timeline name helpers 36f60e347180 drm/amdgpu: Use dma-fence driver and timeline name helpers -:31: WARNING:LONG_LINE: line length of 102 exceeds 100 columns #31: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h:168:
+ __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished))
-:40: WARNING:LONG_LINE: line length of 102 exceeds 100 columns #40: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h:194:
+ __string(timeline, dma_fence_timeline_name(&job->base.s_fence->finished))
total: 0 errors, 2 warnings, 0 checks, 33 lines checked6354406be720 drm/i915: Use dma-fence driver and timeline name helpers 362c28e1835f dma-fence: Add safe access helpers and document the rules -:18: WARNING:TYPO_SPELLING: 'contraints' may be misspelled - perhaps 'constraints'? #18:
contraints and adds helpers which a) drivers with potential to suffer from ^^^^^^^^^^
total: 0 errors, 1 warnings, 0 checks, 134 lines checked dfcbd6bd374e sync_file: Protect access to driver and timeline name 100fb0599e79 drm/i915: Protect access to driver and timeline name 636b44b647b6 drm/xe: Make dma-fences compliant with the safe access rules
Patchwork
CI✓ CI.KUnit: success for Some (drm_sched_|dma_)fence lifetime issues (rev2)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Some (drm_sched_|dma_)fence lifetime issues (rev2)
URL : https://patchwork.freedesktop.org/series/148825/
State : success
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [06:12:49] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [06:12:54] 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 [06:13:20] Starting KUnit Kernel (1/1)... [06:13:20] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [06:13:20] ================== guc_buf (11 subtests) =================== [06:13:20] [PASSED] test_smallest [06:13:20] [PASSED] test_largest [06:13:20] [PASSED] test_granular [06:13:20] [PASSED] test_unique [06:13:20] [PASSED] test_overlap [06:13:20] [PASSED] test_reusable [06:13:20] [PASSED] test_too_big [06:13:20] [PASSED] test_flush [06:13:20] [PASSED] test_lookup [06:13:21] [PASSED] test_data [06:13:21] [PASSED] test_class [06:13:21] ===================== [PASSED] guc_buf ===================== [06:13:21] =================== guc_dbm (7 subtests) =================== [06:13:21] [PASSED] test_empty [06:13:21] [PASSED] test_default [06:13:21] ======================== test_size ======================== [06:13:21] [PASSED] 4 [06:13:21] [PASSED] 8 [06:13:21] [PASSED] 32 [06:13:21] [PASSED] 256 [06:13:21] ==================== [PASSED] test_size ==================== [06:13:21] ======================= test_reuse ======================== [06:13:21] [PASSED] 4 [06:13:21] [PASSED] 8 [06:13:21] [PASSED] 32 [06:13:21] [PASSED] 256 [06:13:21] =================== [PASSED] test_reuse ==================== [06:13:21] =================== test_range_overlap ==================== [06:13:21] [PASSED] 4 [06:13:21] [PASSED] 8 [06:13:21] [PASSED] 32 [06:13:21] [PASSED] 256 [06:13:21] =============== [PASSED] test_range_overlap ================ [06:13:21] =================== test_range_compact ==================== [06:13:21] [PASSED] 4 [06:13:21] [PASSED] 8 [06:13:21] [PASSED] 32 [06:13:21] [PASSED] 256 [06:13:21] =============== [PASSED] test_range_compact ================ [06:13:21] ==================== test_range_spare ===================== [06:13:21] [PASSED] 4 [06:13:21] [PASSED] 8 [06:13:21] [PASSED] 32 [06:13:21] [PASSED] 256 [06:13:21] ================ [PASSED] test_range_spare ================= [06:13:21] ===================== [PASSED] guc_dbm ===================== [06:13:21] =================== guc_idm (6 subtests) =================== [06:13:21] [PASSED] bad_init [06:13:21] [PASSED] no_init [06:13:21] [PASSED] init_fini [06:13:21] [PASSED] check_used [06:13:21] [PASSED] check_quota [06:13:21] [PASSED] check_all [06:13:21] ===================== [PASSED] guc_idm ===================== [06:13:21] ================== no_relay (3 subtests) =================== [06:13:21] [PASSED] xe_drops_guc2pf_if_not_ready [06:13:21] [PASSED] xe_drops_guc2vf_if_not_ready [06:13:21] [PASSED] xe_rejects_send_if_not_ready [06:13:21] ==================== [PASSED] no_relay ===================== [06:13:21] ================== pf_relay (14 subtests) ================== [06:13:21] [PASSED] pf_rejects_guc2pf_too_short [06:13:21] [PASSED] pf_rejects_guc2pf_too_long [06:13:21] [PASSED] pf_rejects_guc2pf_no_payload [06:13:21] [PASSED] pf_fails_no_payload [06:13:21] [PASSED] pf_fails_bad_origin [06:13:21] [PASSED] pf_fails_bad_type [06:13:21] [PASSED] pf_txn_reports_error [06:13:21] [PASSED] pf_txn_sends_pf2guc [06:13:21] [PASSED] pf_sends_pf2guc [06:13:21] [SKIPPED] pf_loopback_nop [06:13:21] [SKIPPED] pf_loopback_echo [06:13:21] [SKIPPED] pf_loopback_fail [06:13:21] [SKIPPED] pf_loopback_busy [06:13:21] [SKIPPED] pf_loopback_retry [06:13:21] ==================== [PASSED] pf_relay ===================== [06:13:21] ================== vf_relay (3 subtests) =================== [06:13:21] [PASSED] vf_rejects_guc2vf_too_short [06:13:21] [PASSED] vf_rejects_guc2vf_too_long [06:13:21] [PASSED] vf_rejects_guc2vf_no_payload [06:13:21] ==================== [PASSED] vf_relay ===================== [06:13:21] ================= pf_service (11 subtests) ================= [06:13:21] [PASSED] pf_negotiate_any [06:13:21] [PASSED] pf_negotiate_base_match [06:13:21] [PASSED] pf_negotiate_base_newer [06:13:21] [PASSED] pf_negotiate_base_next [06:13:21] [SKIPPED] pf_negotiate_base_older [06:13:21] [PASSED] pf_negotiate_base_prev [06:13:21] [PASSED] pf_negotiate_latest_match [06:13:21] [PASSED] pf_negotiate_latest_newer [06:13:21] [PASSED] pf_negotiate_latest_next [06:13:21] [SKIPPED] pf_negotiate_latest_older [06:13:21] [SKIPPED] pf_negotiate_latest_prev [06:13:21] =================== [PASSED] pf_service ==================== [06:13:21] ===================== lmtt (1 subtest) ===================== [06:13:21] ======================== test_ops ========================= [06:13:21] [PASSED] 2-level [06:13:21] [PASSED] multi-level [06:13:21] ==================== [PASSED] test_ops ===================== [06:13:21] ====================== [PASSED] lmtt ======================= [06:13:21] =================== xe_mocs (2 subtests) =================== [06:13:21] ================ xe_live_mocs_kernel_kunit ================ [06:13:21] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============ [06:13:21] ================ xe_live_mocs_reset_kunit ================= [06:13:21] ============ [SKIPPED] xe_live_mocs_reset_kunit ============ [06:13:21] ==================== [SKIPPED] xe_mocs ===================== [06:13:21] ================= xe_migrate (2 subtests) ================== [06:13:21] ================= xe_migrate_sanity_kunit ================= [06:13:21] ============ [SKIPPED] xe_migrate_sanity_kunit ============= [06:13:21] ================== xe_validate_ccs_kunit ================== [06:13:21] ============= [SKIPPED] xe_validate_ccs_kunit ============== [06:13:21] =================== [SKIPPED] xe_migrate =================== [06:13:21] ================== xe_dma_buf (1 subtest) ================== [06:13:21] ==================== xe_dma_buf_kunit ===================== [06:13:21] ================ [SKIPPED] xe_dma_buf_kunit ================ [06:13:21] =================== [SKIPPED] xe_dma_buf =================== [06:13:21] ================= xe_bo_shrink (1 subtest) ================= [06:13:21] =================== xe_bo_shrink_kunit ==================== [06:13:21] =============== [SKIPPED] xe_bo_shrink_kunit =============== [06:13:21] ================== [SKIPPED] xe_bo_shrink ================== [06:13:21] ==================== xe_bo (2 subtests) ==================== [06:13:21] ================== xe_ccs_migrate_kunit =================== [06:13:21] ============== [SKIPPED] xe_ccs_migrate_kunit ============== [06:13:21] ==================== xe_bo_evict_kunit ==================== [06:13:21] =============== [SKIPPED] xe_bo_evict_kunit ================ [06:13:21] ===================== [SKIPPED] xe_bo ====================== [06:13:21] ==================== args (11 subtests) ==================== [06:13:21] [PASSED] count_args_test [06:13:21] [PASSED] call_args_example [06:13:21] [PASSED] call_args_test [06:13:21] [PASSED] drop_first_arg_example [06:13:21] [PASSED] drop_first_arg_test [06:13:21] [PASSED] first_arg_example [06:13:21] [PASSED] first_arg_test [06:13:21] [PASSED] last_arg_example [06:13:21] [PASSED] last_arg_test [06:13:21] [PASSED] pick_arg_example [06:13:21] [PASSED] sep_comma_example [06:13:21] ====================== [PASSED] args ======================= [06:13:21] =================== xe_pci (2 subtests) ==================== [06:13:21] [PASSED] xe_gmdid_graphics_ip [06:13:21] [PASSED] xe_gmdid_media_ip [06:13:21] ===================== [PASSED] xe_pci ====================== [06:13:21] =================== xe_rtp (2 subtests) ==================== [06:13:21] =============== xe_rtp_process_to_sr_tests ================ [06:13:21] [PASSED] coalesce-same-reg [06:13:21] [PASSED] no-match-no-add [06:13:21] [PASSED] match-or [06:13:21] [PASSED] match-or-xfail [06:13:21] [PASSED] no-match-no-add-multiple-rules [06:13:21] [PASSED] two-regs-two-entries [06:13:21] [PASSED] clr-one-set-other [06:13:21] [PASSED] set-field [06:13:21] [PASSED] conflict-duplicate [06:13:21] [PASSED] conflict-not-disjoint stty: 'standard input': Inappropriate ioctl for device [06:13:21] [PASSED] conflict-reg-type [06:13:21] =========== [PASSED] xe_rtp_process_to_sr_tests ============ [06:13:21] ================== xe_rtp_process_tests =================== [06:13:21] [PASSED] active1 [06:13:21] [PASSED] active2 [06:13:21] [PASSED] active-inactive [06:13:21] [PASSED] inactive-active [06:13:21] [PASSED] inactive-1st_or_active-inactive [06:13:21] [PASSED] inactive-2nd_or_active-inactive [06:13:21] [PASSED] inactive-last_or_active-inactive [06:13:21] [PASSED] inactive-no_or_active-inactive [06:13:21] ============== [PASSED] xe_rtp_process_tests =============== [06:13:21] ===================== [PASSED] xe_rtp ====================== [06:13:21] ==================== xe_wa (1 subtest) ===================== [06:13:21] ======================== xe_wa_gt ========================= [06:13:21] [PASSED] TIGERLAKE (B0) [06:13:21] [PASSED] DG1 (A0) [06:13:21] [PASSED] DG1 (B0) [06:13:21] [PASSED] ALDERLAKE_S (A0) [06:13:21] [PASSED] ALDERLAKE_S (B0) [06:13:21] [PASSED] ALDERLAKE_S (C0) [06:13:21] [PASSED] ALDERLAKE_S (D0) [06:13:21] [PASSED] ALDERLAKE_P (A0) [06:13:21] [PASSED] ALDERLAKE_P (B0) [06:13:21] [PASSED] ALDERLAKE_P (C0) [06:13:21] [PASSED] ALDERLAKE_S_RPLS (D0) [06:13:21] [PASSED] ALDERLAKE_P_RPLU (E0) [06:13:21] [PASSED] DG2_G10 (C0) [06:13:21] [PASSED] DG2_G11 (B1) [06:13:21] [PASSED] DG2_G12 (A1) [06:13:21] [PASSED] METEORLAKE (g:A0, m:A0) [06:13:21] [PASSED] METEORLAKE (g:A0, m:A0) [06:13:21] [PASSED] METEORLAKE (g:A0, m:A0) [06:13:21] [PASSED] LUNARLAKE (g:A0, m:A0) [06:13:21] [PASSED] LUNARLAKE (g:B0, m:A0) [06:13:21] [PASSED] BATTLEMAGE (g:A0, m:A1) [06:13:21] ==================== [PASSED] xe_wa_gt ===================== [06:13:21] ====================== [PASSED] xe_wa ====================== [06:13:21] ============================================================ [06:13:21] Testing complete. Ran 133 tests: passed: 117, skipped: 16 [06:13:21] Elapsed time: 31.117s total, 4.220s configuring, 26.579s building, 0.292s running
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [06:13:21] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [06:13:22] 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 [06:13:44] Starting KUnit Kernel (1/1)... [06:13:44] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [06:13:44] == drm_test_atomic_get_connector_for_encoder (1 subtest) === [06:13:44] [PASSED] drm_test_drm_atomic_get_connector_for_encoder [06:13:44] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ==== [06:13:44] =========== drm_validate_clone_mode (2 subtests) =========== [06:13:44] ============== drm_test_check_in_clone_mode =============== [06:13:44] [PASSED] in_clone_mode [06:13:44] [PASSED] not_in_clone_mode [06:13:44] ========== [PASSED] drm_test_check_in_clone_mode =========== [06:13:44] =============== drm_test_check_valid_clones =============== [06:13:44] [PASSED] not_in_clone_mode [06:13:44] [PASSED] valid_clone [06:13:44] [PASSED] invalid_clone [06:13:44] =========== [PASSED] drm_test_check_valid_clones =========== [06:13:44] ============= [PASSED] drm_validate_clone_mode ============= [06:13:44] ============= drm_validate_modeset (1 subtest) ============= [06:13:44] [PASSED] drm_test_check_connector_changed_modeset [06:13:44] ============== [PASSED] drm_validate_modeset =============== [06:13:44] ====== drm_test_bridge_get_current_state (2 subtests) ====== [06:13:44] [PASSED] drm_test_drm_bridge_get_current_state_atomic [06:13:44] [PASSED] drm_test_drm_bridge_get_current_state_legacy [06:13:44] ======== [PASSED] drm_test_bridge_get_current_state ======== [06:13:44] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ====== [06:13:44] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic [06:13:44] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled [06:13:44] [PASSED] drm_test_drm_bridge_helper_reset_crtc_legacy [06:13:44] ======== [PASSED] drm_test_bridge_helper_reset_crtc ======== [06:13:44] ================== drm_buddy (7 subtests) ================== [06:13:44] [PASSED] drm_test_buddy_alloc_limit [06:13:44] [PASSED] drm_test_buddy_alloc_optimistic [06:13:44] [PASSED] drm_test_buddy_alloc_pessimistic [06:13:44] [PASSED] drm_test_buddy_alloc_pathological [06:13:44] [PASSED] drm_test_buddy_alloc_contiguous [06:13:44] [PASSED] drm_test_buddy_alloc_clear [06:13:44] [PASSED] drm_test_buddy_alloc_range_bias [06:13:44] ==================== [PASSED] drm_buddy ==================== [06:13:44] ============= drm_cmdline_parser (40 subtests) ============= [06:13:44] [PASSED] drm_test_cmdline_force_d_only [06:13:44] [PASSED] drm_test_cmdline_force_D_only_dvi [06:13:44] [PASSED] drm_test_cmdline_force_D_only_hdmi [06:13:44] [PASSED] drm_test_cmdline_force_D_only_not_digital [06:13:44] [PASSED] drm_test_cmdline_force_e_only [06:13:44] [PASSED] drm_test_cmdline_res [06:13:44] [PASSED] drm_test_cmdline_res_vesa [06:13:44] [PASSED] drm_test_cmdline_res_vesa_rblank [06:13:44] [PASSED] drm_test_cmdline_res_rblank [06:13:44] [PASSED] drm_test_cmdline_res_bpp [06:13:44] [PASSED] drm_test_cmdline_res_refresh [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_margins [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital [06:13:44] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on [06:13:44] [PASSED] drm_test_cmdline_res_margins_force_on [06:13:44] [PASSED] drm_test_cmdline_res_vesa_margins [06:13:44] [PASSED] drm_test_cmdline_name [06:13:44] [PASSED] drm_test_cmdline_name_bpp [06:13:44] [PASSED] drm_test_cmdline_name_option [06:13:44] [PASSED] drm_test_cmdline_name_bpp_option [06:13:44] [PASSED] drm_test_cmdline_rotate_0 [06:13:44] [PASSED] drm_test_cmdline_rotate_90 [06:13:44] [PASSED] drm_test_cmdline_rotate_180 [06:13:44] [PASSED] drm_test_cmdline_rotate_270 [06:13:44] [PASSED] drm_test_cmdline_hmirror [06:13:44] [PASSED] drm_test_cmdline_vmirror [06:13:44] [PASSED] drm_test_cmdline_margin_options [06:13:44] [PASSED] drm_test_cmdline_multiple_options [06:13:44] [PASSED] drm_test_cmdline_bpp_extra_and_option [06:13:44] [PASSED] drm_test_cmdline_extra_and_option [06:13:44] [PASSED] drm_test_cmdline_freestanding_options [06:13:44] [PASSED] drm_test_cmdline_freestanding_force_e_and_options [06:13:44] [PASSED] drm_test_cmdline_panel_orientation [06:13:44] ================ drm_test_cmdline_invalid ================= [06:13:44] [PASSED] margin_only [06:13:44] [PASSED] interlace_only [06:13:44] [PASSED] res_missing_x [06:13:44] [PASSED] res_missing_y [06:13:44] [PASSED] res_bad_y [06:13:44] [PASSED] res_missing_y_bpp [06:13:44] [PASSED] res_bad_bpp [06:13:44] [PASSED] res_bad_refresh [06:13:44] [PASSED] res_bpp_refresh_force_on_off [06:13:44] [PASSED] res_invalid_mode [06:13:44] [PASSED] res_bpp_wrong_place_mode [06:13:44] [PASSED] name_bpp_refresh [06:13:44] [PASSED] name_refresh [06:13:44] [PASSED] name_refresh_wrong_mode [06:13:44] [PASSED] name_refresh_invalid_mode [06:13:44] [PASSED] rotate_multiple [06:13:44] [PASSED] rotate_invalid_val [06:13:44] [PASSED] rotate_truncated [06:13:44] [PASSED] invalid_option [06:13:44] [PASSED] invalid_tv_option [06:13:44] [PASSED] truncated_tv_option [06:13:44] ============ [PASSED] drm_test_cmdline_invalid ============= [06:13:44] =============== drm_test_cmdline_tv_options =============== [06:13:44] [PASSED] NTSC [06:13:44] [PASSED] NTSC_443 [06:13:44] [PASSED] NTSC_J [06:13:44] [PASSED] PAL [06:13:44] [PASSED] PAL_M [06:13:44] [PASSED] PAL_N [06:13:44] [PASSED] SECAM [06:13:44] [PASSED] MONO_525 [06:13:44] [PASSED] MONO_625 [06:13:44] =========== [PASSED] drm_test_cmdline_tv_options =========== [06:13:44] =============== [PASSED] drm_cmdline_parser ================ [06:13:44] ========== drmm_connector_hdmi_init (20 subtests) ========== [06:13:44] [PASSED] drm_test_connector_hdmi_init_valid [06:13:44] [PASSED] drm_test_connector_hdmi_init_bpc_8 [06:13:44] [PASSED] drm_test_connector_hdmi_init_bpc_10 [06:13:44] [PASSED] drm_test_connector_hdmi_init_bpc_12 [06:13:44] [PASSED] drm_test_connector_hdmi_init_bpc_invalid [06:13:44] [PASSED] drm_test_connector_hdmi_init_bpc_null [06:13:44] [PASSED] drm_test_connector_hdmi_init_formats_empty [06:13:44] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb [06:13:44] === drm_test_connector_hdmi_init_formats_yuv420_allowed === [06:13:44] [PASSED] supported_formats=0x9 yuv420_allowed=1 [06:13:44] [PASSED] supported_formats=0x9 yuv420_allowed=0 [06:13:44] [PASSED] supported_formats=0x3 yuv420_allowed=1 [06:13:44] [PASSED] supported_formats=0x3 yuv420_allowed=0 [06:13:44] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed === [06:13:44] [PASSED] drm_test_connector_hdmi_init_null_ddc [06:13:44] [PASSED] drm_test_connector_hdmi_init_null_product [06:13:44] [PASSED] drm_test_connector_hdmi_init_null_vendor [06:13:44] [PASSED] drm_test_connector_hdmi_init_product_length_exact [06:13:44] [PASSED] drm_test_connector_hdmi_init_product_length_too_long [06:13:44] [PASSED] drm_test_connector_hdmi_init_product_valid [06:13:44] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact [06:13:44] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long [06:13:44] [PASSED] drm_test_connector_hdmi_init_vendor_valid [06:13:44] ========= drm_test_connector_hdmi_init_type_valid ========= [06:13:44] [PASSED] HDMI-A [06:13:44] [PASSED] HDMI-B [06:13:44] ===== [PASSED] drm_test_connector_hdmi_init_type_valid ===== [06:13:44] ======== drm_test_connector_hdmi_init_type_invalid ======== [06:13:44] [PASSED] Unknown [06:13:44] [PASSED] VGA [06:13:44] [PASSED] DVI-I [06:13:44] [PASSED] DVI-D [06:13:44] [PASSED] DVI-A [06:13:44] [PASSED] Composite [06:13:44] [PASSED] SVIDEO [06:13:44] [PASSED] LVDS [06:13:44] [PASSED] Component [06:13:44] [PASSED] DIN [06:13:44] [PASSED] DP [06:13:44] [PASSED] TV [06:13:44] [PASSED] eDP [06:13:44] [PASSED] Virtual [06:13:44] [PASSED] DSI [06:13:44] [PASSED] DPI [06:13:44] [PASSED] Writeback [06:13:44] [PASSED] SPI [06:13:44] [PASSED] USB [06:13:44] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ==== [06:13:44] ============ [PASSED] drmm_connector_hdmi_init ============= [06:13:44] ============= drmm_connector_init (3 subtests) ============= [06:13:44] [PASSED] drm_test_drmm_connector_init [06:13:44] [PASSED] drm_test_drmm_connector_init_null_ddc [06:13:44] ========= drm_test_drmm_connector_init_type_valid ========= [06:13:44] [PASSED] Unknown [06:13:44] [PASSED] VGA [06:13:44] [PASSED] DVI-I [06:13:44] [PASSED] DVI-D [06:13:44] [PASSED] DVI-A [06:13:44] [PASSED] Composite [06:13:44] [PASSED] SVIDEO [06:13:44] [PASSED] LVDS [06:13:44] [PASSED] Component [06:13:44] [PASSED] DIN [06:13:44] [PASSED] DP [06:13:44] [PASSED] HDMI-A [06:13:44] [PASSED] HDMI-B [06:13:44] [PASSED] TV [06:13:44] [PASSED] eDP [06:13:44] [PASSED] Virtual [06:13:44] [PASSED] DSI [06:13:44] [PASSED] DPI [06:13:44] [PASSED] Writeback [06:13:44] [PASSED] SPI [06:13:44] [PASSED] USB [06:13:44] ===== [PASSED] drm_test_drmm_connector_init_type_valid ===== [06:13:44] =============== [PASSED] drmm_connector_init =============== [06:13:44] ========= drm_connector_dynamic_init (6 subtests) ========== [06:13:44] [PASSED] drm_test_drm_connector_dynamic_init [06:13:44] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc [06:13:44] [PASSED] drm_test_drm_connector_dynamic_init_not_added [06:13:44] [PASSED] drm_test_drm_connector_dynamic_init_properties [06:13:44] ===== drm_test_drm_connector_dynamic_init_type_valid ====== [06:13:44] [PASSED] Unknown [06:13:44] [PASSED] VGA [06:13:44] [PASSED] DVI-I [06:13:44] [PASSED] DVI-D [06:13:44] [PASSED] DVI-A [06:13:44] [PASSED] Composite [06:13:44] [PASSED] SVIDEO [06:13:44] [PASSED] LVDS [06:13:44] [PASSED] Component [06:13:44] [PASSED] DIN [06:13:44] [PASSED] DP [06:13:44] [PASSED] HDMI-A [06:13:44] [PASSED] HDMI-B [06:13:44] [PASSED] TV [06:13:44] [PASSED] eDP [06:13:44] [PASSED] Virtual [06:13:44] [PASSED] DSI [06:13:44] [PASSED] DPI [06:13:44] [PASSED] Writeback [06:13:44] [PASSED] SPI [06:13:44] [PASSED] USB [06:13:44] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid == [06:13:44] ======== drm_test_drm_connector_dynamic_init_name ========= [06:13:44] [PASSED] Unknown [06:13:44] [PASSED] VGA [06:13:44] [PASSED] DVI-I [06:13:44] [PASSED] DVI-D [06:13:44] [PASSED] DVI-A [06:13:44] [PASSED] Composite [06:13:44] [PASSED] SVIDEO [06:13:44] [PASSED] LVDS [06:13:44] [PASSED] Component [06:13:44] [PASSED] DIN [06:13:44] [PASSED] DP [06:13:44] [PASSED] HDMI-A [06:13:44] [PASSED] HDMI-B [06:13:44] [PASSED] TV [06:13:44] [PASSED] eDP [06:13:44] [PASSED] Virtual [06:13:44] [PASSED] DSI [06:13:44] [PASSED] DPI [06:13:44] [PASSED] Writeback [06:13:44] [PASSED] SPI [06:13:44] [PASSED] USB [06:13:44] ==== [PASSED] drm_test_drm_connector_dynamic_init_name ===== [06:13:44] =========== [PASSED] drm_connector_dynamic_init ============ [06:13:44] ==== drm_connector_dynamic_register_early (4 subtests) ===== [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_early_defer [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object [06:13:44] ====== [PASSED] drm_connector_dynamic_register_early ======= [06:13:44] ======= drm_connector_dynamic_register (7 subtests) ======== [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_on_list [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_no_defer [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_no_init [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_mode_object [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_sysfs [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name [06:13:44] [PASSED] drm_test_drm_connector_dynamic_register_debugfs [06:13:44] ========= [PASSED] drm_connector_dynamic_register ========== [06:13:44] = drm_connector_attach_broadcast_rgb_property (2 subtests) = [06:13:44] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property [06:13:44] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector [06:13:44] === [PASSED] drm_connector_attach_broadcast_rgb_property === [06:13:44] ========== drm_get_tv_mode_from_name (2 subtests) ========== [06:13:44] ========== drm_test_get_tv_mode_from_name_valid =========== [06:13:44] [PASSED] NTSC [06:13:44] [PASSED] NTSC-443 [06:13:44] [PASSED] NTSC-J [06:13:44] [PASSED] PAL [06:13:44] [PASSED] PAL-M [06:13:44] [PASSED] PAL-N [06:13:44] [PASSED] SECAM [06:13:44] [PASSED] Mono [06:13:44] ====== [PASSED] drm_test_get_tv_mode_from_name_valid ======= [06:13:44] [PASSED] drm_test_get_tv_mode_from_name_truncated [06:13:44] ============ [PASSED] drm_get_tv_mode_from_name ============ [06:13:44] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) = [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1 [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1 [06:13:44] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double [06:13:44] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid = [06:13:44] [PASSED] VIC 96 [06:13:44] [PASSED] VIC 97 [06:13:44] [PASSED] VIC 101 [06:13:44] [PASSED] VIC 102 [06:13:44] [PASSED] VIC 106 [06:13:44] [PASSED] VIC 107 [06:13:44] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid === [06:13:44] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc [06:13:44] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc [06:13:44] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc [06:13:44] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc [06:13:44] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc [06:13:44] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ==== [06:13:44] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) == [06:13:44] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name ==== [06:13:44] [PASSED] Automatic [06:13:44] [PASSED] Full [06:13:44] [PASSED] Limited 16:235 [06:13:44] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name === [06:13:44] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid [06:13:44] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ==== [06:13:44] == drm_hdmi_connector_get_output_format_name (2 subtests) == [06:13:44] === drm_test_drm_hdmi_connector_get_output_format_name ==== [06:13:44] [PASSED] RGB [06:13:44] [PASSED] YUV 4:2:0 [06:13:44] [PASSED] YUV 4:2:2 [06:13:44] [PASSED] YUV 4:4:4 [06:13:44] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name === [06:13:44] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid [06:13:44] ==== [PASSED] drm_hdmi_connector_get_output_format_name ==== [06:13:44] ============= drm_damage_helper (21 subtests) ============== [06:13:44] [PASSED] drm_test_damage_iter_no_damage [06:13:44] [PASSED] drm_test_damage_iter_no_damage_fractional_src [06:13:44] [PASSED] drm_test_damage_iter_no_damage_src_moved [06:13:44] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved [06:13:44] [PASSED] drm_test_damage_iter_no_damage_not_visible [06:13:44] [PASSED] drm_test_damage_iter_no_damage_no_crtc [06:13:44] [PASSED] drm_test_damage_iter_no_damage_no_fb [06:13:44] [PASSED] drm_test_damage_iter_simple_damage [06:13:44] [PASSED] drm_test_damage_iter_single_damage [06:13:44] [PASSED] drm_test_damage_iter_single_damage_intersect_src [06:13:44] [PASSED] drm_test_damage_iter_single_damage_outside_src [06:13:44] [PASSED] drm_test_damage_iter_single_damage_fractional_src [06:13:44] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src [06:13:44] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src [06:13:44] [PASSED] drm_test_damage_iter_single_damage_src_moved [06:13:44] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved [06:13:44] [PASSED] drm_test_damage_iter_damage [06:13:44] [PASSED] drm_test_damage_iter_damage_one_intersect [06:13:44] [PASSED] drm_test_damage_iter_damage_one_outside [06:13:44] [PASSED] drm_test_damage_iter_damage_src_moved [06:13:44] [PASSED] drm_test_damage_iter_damage_not_visible [06:13:44] ================ [PASSED] drm_damage_helper ================ [06:13:44] ============== drm_dp_mst_helper (3 subtests) ============== [06:13:44] ============== drm_test_dp_mst_calc_pbn_mode ============== [06:13:44] [PASSED] Clock 154000 BPP 30 DSC disabled [06:13:44] [PASSED] Clock 234000 BPP 30 DSC disabled [06:13:44] [PASSED] Clock 297000 BPP 24 DSC disabled [06:13:44] [PASSED] Clock 332880 BPP 24 DSC enabled [06:13:44] [PASSED] Clock 324540 BPP 24 DSC enabled [06:13:44] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ========== [06:13:44] ============== drm_test_dp_mst_calc_pbn_div =============== [06:13:44] [PASSED] Link rate 2000000 lane count 4 [06:13:44] [PASSED] Link rate 2000000 lane count 2 [06:13:44] [PASSED] Link rate 2000000 lane count 1 [06:13:44] [PASSED] Link rate 1350000 lane count 4 [06:13:44] [PASSED] Link rate 1350000 lane count 2 [06:13:44] [PASSED] Link rate 1350000 lane count 1 [06:13:44] [PASSED] Link rate 1000000 lane count 4 [06:13:44] [PASSED] Link rate 1000000 lane count 2 [06:13:44] [PASSED] Link rate 1000000 lane count 1 [06:13:44] [PASSED] Link rate 810000 lane count 4 [06:13:44] [PASSED] Link rate 810000 lane count 2 [06:13:44] [PASSED] Link rate 810000 lane count 1 [06:13:44] [PASSED] Link rate 540000 lane count 4 [06:13:44] [PASSED] Link rate 540000 lane count 2 [06:13:44] [PASSED] Link rate 540000 lane count 1 [06:13:44] [PASSED] Link rate 270000 lane count 4 [06:13:44] [PASSED] Link rate 270000 lane count 2 [06:13:44] [PASSED] Link rate 270000 lane count 1 [06:13:44] [PASSED] Link rate 162000 lane count 4 [06:13:44] [PASSED] Link rate 162000 lane count 2 [06:13:44] [PASSED] Link rate 162000 lane count 1 [06:13:44] ========== [PASSED] drm_test_dp_mst_calc_pbn_div =========== [06:13:44] ========= drm_test_dp_mst_sideband_msg_req_decode ========= [06:13:44] [PASSED] DP_ENUM_PATH_RESOURCES with port number [06:13:44] [PASSED] DP_POWER_UP_PHY with port number [06:13:44] [PASSED] DP_POWER_DOWN_PHY with port number [06:13:44] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks [06:13:44] [PASSED] DP_ALLOCATE_PAYLOAD with port number [06:13:44] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI [06:13:44] [PASSED] DP_ALLOCATE_PAYLOAD with PBN [06:13:44] [PASSED] DP_QUERY_PAYLOAD with port number [06:13:44] [PASSED] DP_QUERY_PAYLOAD with VCPI [06:13:44] [PASSED] DP_REMOTE_DPCD_READ with port number [06:13:44] [PASSED] DP_REMOTE_DPCD_READ with DPCD address [06:13:44] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes [06:13:44] [PASSED] DP_REMOTE_DPCD_WRITE with port number [06:13:44] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address [06:13:44] [PASSED] DP_REMOTE_DPCD_WRITE with data array [06:13:44] [PASSED] DP_REMOTE_I2C_READ with port number [06:13:44] [PASSED] DP_REMOTE_I2C_READ with I2C device ID [06:13:44] [PASSED] DP_REMOTE_I2C_READ with transactions array [06:13:44] [PASSED] DP_REMOTE_I2C_WRITE with port number [06:13:44] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID [06:13:44] [PASSED] DP_REMOTE_I2C_WRITE with data array [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior [06:13:44] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior [06:13:44] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode ===== [06:13:44] ================ [PASSED] drm_dp_mst_helper ================ [06:13:44] ================== drm_exec (7 subtests) =================== [06:13:44] [PASSED] sanitycheck [06:13:44] [PASSED] test_lock [06:13:44] [PASSED] test_lock_unlock [06:13:44] [PASSED] test_duplicates [06:13:44] [PASSED] test_prepare [06:13:44] [PASSED] test_prepare_array [06:13:44] [PASSED] test_multiple_loops [06:13:44] ==================== [PASSED] drm_exec ===================== [06:13:44] =========== drm_format_helper_test (18 subtests) =========== [06:13:44] ============== drm_test_fb_xrgb8888_to_gray8 ============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ========== [06:13:44] ============= drm_test_fb_xrgb8888_to_rgb332 ============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ========== [06:13:44] ============= drm_test_fb_xrgb8888_to_rgb565 ============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ========== [06:13:44] ============ drm_test_fb_xrgb8888_to_xrgb1555 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 ========= [06:13:44] ============ drm_test_fb_xrgb8888_to_argb1555 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 ========= [06:13:44] ============ drm_test_fb_xrgb8888_to_rgba5551 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 ========= [06:13:44] ============= drm_test_fb_xrgb8888_to_rgb888 ============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ========== [06:13:44] ============= drm_test_fb_xrgb8888_to_bgr888 ============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ========== [06:13:44] ============ drm_test_fb_xrgb8888_to_argb8888 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 ========= [06:13:44] =========== drm_test_fb_xrgb8888_to_xrgb2101010 =========== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 ======= [06:13:44] =========== drm_test_fb_xrgb8888_to_argb2101010 =========== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 ======= [06:13:44] ============== drm_test_fb_xrgb8888_to_mono =============== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ========== [PASSED] drm_test_fb_xrgb8888_to_mono =========== [06:13:44] ==================== drm_test_fb_swab ===================== [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ================ [PASSED] drm_test_fb_swab ================= [06:13:44] ============ drm_test_fb_xrgb8888_to_xbgr8888 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 ========= [06:13:44] ============ drm_test_fb_xrgb8888_to_abgr8888 ============= [06:13:44] [PASSED] single_pixel_source_buffer [06:13:44] [PASSED] single_pixel_clip_rectangle [06:13:44] [PASSED] well_known_colors [06:13:44] [PASSED] destination_pitch [06:13:44] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 ========= [06:13:44] ================= drm_test_fb_clip_offset ================= [06:13:44] [PASSED] pass through [06:13:44] [PASSED] horizontal offset [06:13:44] [PASSED] vertical offset [06:13:44] [PASSED] horizontal and vertical offset [06:13:44] [PASSED] horizontal offset (custom pitch) [06:13:44] [PASSED] vertical offset (custom pitch) [06:13:44] [PASSED] horizontal and vertical offset (custom pitch) [06:13:44] ============= [PASSED] drm_test_fb_clip_offset ============= [06:13:44] ============== drm_test_fb_build_fourcc_list ============== [06:13:44] [PASSED] no native formats [06:13:44] [PASSED] XRGB8888 as native format [06:13:44] [PASSED] remove duplicates [06:13:44] [PASSED] convert alpha formats [06:13:44] [PASSED] random formats [06:13:44] ========== [PASSED] drm_test_fb_build_fourcc_list ========== [06:13:44] =================== drm_test_fb_memcpy ==================== [06:13:44] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258) [06:13:44] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258) [06:13:44] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559) [06:13:44] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258) [06:13:44] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258) [06:13:44] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559) [06:13:44] [PASSED] well_known_colors: XB24 little-endian (0x34324258) [06:13:44] [PASSED] well_known_colors: XRA8 little-endian (0x38415258) [06:13:44] [PASSED] well_known_colors: YU24 little-endian (0x34325559) [06:13:44] [PASSED] destination_pitch: XB24 little-endian (0x34324258) [06:13:44] [PASSED] destination_pitch: XRA8 little-endian (0x38415258) [06:13:44] [PASSED] destination_pitch: YU24 little-endian (0x34325559) [06:13:44] =============== [PASSED] drm_test_fb_memcpy ================ [06:13:44] ============= [PASSED] drm_format_helper_test ============== [06:13:44] ================= drm_format (18 subtests) ================= [06:13:44] [PASSED] drm_test_format_block_width_invalid [06:13:44] [PASSED] drm_test_format_block_width_one_plane [06:13:44] [PASSED] drm_test_format_block_width_two_plane [06:13:44] [PASSED] drm_test_format_block_width_three_plane [06:13:44] [PASSED] drm_test_format_block_width_tiled [06:13:44] [PASSED] drm_test_format_block_height_invalid [06:13:44] [PASSED] drm_test_format_block_height_one_plane [06:13:44] [PASSED] drm_test_format_block_height_two_plane [06:13:44] [PASSED] drm_test_format_block_height_three_plane [06:13:44] [PASSED] drm_test_format_block_height_tiled [06:13:44] [PASSED] drm_test_format_min_pitch_invalid [06:13:44] [PASSED] drm_test_format_min_pitch_one_plane_8bpp [06:13:44] [PASSED] drm_test_format_min_pitch_one_plane_16bpp [06:13:44] [PASSED] drm_test_format_min_pitch_one_plane_24bpp [06:13:44] [PASSED] drm_test_format_min_pitch_one_plane_32bpp [06:13:44] [PASSED] drm_test_format_min_pitch_two_plane [06:13:44] [PASSED] drm_test_format_min_pitch_three_plane_8bpp [06:13:44] [PASSED] drm_test_format_min_pitch_tiled [06:13:44] =================== [PASSED] drm_format ==================== [06:13:44] ============== drm_framebuffer (10 subtests) =============== [06:13:44] ========== drm_test_framebuffer_check_src_coords ========== [06:13:44] [PASSED] Success: source fits into fb [06:13:44] [PASSED] Fail: overflowing fb with x-axis coordinate [06:13:44] [PASSED] Fail: overflowing fb with y-axis coordinate [06:13:44] [PASSED] Fail: overflowing fb with source width [06:13:44] [PASSED] Fail: overflowing fb with source height [06:13:44] ====== [PASSED] drm_test_framebuffer_check_src_coords ====== [06:13:44] [PASSED] drm_test_framebuffer_cleanup [06:13:44] =============== drm_test_framebuffer_create =============== [06:13:44] [PASSED] ABGR8888 normal sizes [06:13:44] [PASSED] ABGR8888 max sizes [06:13:44] [PASSED] ABGR8888 pitch greater than min required [06:13:44] [PASSED] ABGR8888 pitch less than min required [06:13:44] [PASSED] ABGR8888 Invalid width [06:13:44] [PASSED] ABGR8888 Invalid buffer handle [06:13:44] [PASSED] No pixel format [06:13:44] [PASSED] ABGR8888 Width 0 [06:13:44] [PASSED] ABGR8888 Height 0 [06:13:44] [PASSED] ABGR8888 Out of bound height * pitch combination [06:13:44] [PASSED] ABGR8888 Large buffer offset [06:13:44] [PASSED] ABGR8888 Buffer offset for inexistent plane [06:13:44] [PASSED] ABGR8888 Invalid flag [06:13:44] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers [06:13:44] [PASSED] ABGR8888 Valid buffer modifier [06:13:44] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE) [06:13:44] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] NV12 Normal sizes [06:13:44] [PASSED] NV12 Max sizes [06:13:44] [PASSED] NV12 Invalid pitch [06:13:44] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag [06:13:44] [PASSED] NV12 different modifier per-plane [06:13:44] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE [06:13:44] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] NV12 Modifier for inexistent plane [06:13:44] [PASSED] NV12 Handle for inexistent plane [06:13:44] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier [06:13:44] [PASSED] YVU420 Normal sizes [06:13:44] [PASSED] YVU420 Max sizes [06:13:44] [PASSED] YVU420 Invalid pitch [06:13:44] [PASSED] YVU420 Different pitches [06:13:44] [PASSED] YVU420 Different buffer offsets/pitches [06:13:44] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS [06:13:44] [PASSED] YVU420 Valid modifier [06:13:44] [PASSED] YVU420 Different modifiers per plane [06:13:44] [PASSED] YVU420 Modifier for inexistent plane [06:13:44] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR) [06:13:44] [PASSED] X0L2 Normal sizes [06:13:44] [PASSED] X0L2 Max sizes [06:13:44] [PASSED] X0L2 Invalid pitch [06:13:44] [PASSED] X0L2 Pitch greater than minimum required [06:13:44] [PASSED] X0L2 Handle for inexistent plane [06:13:44] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set [06:13:44] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set [06:13:44] [PASSED] X0L2 Valid modifier [06:13:44] [PASSED] X0L2 Modifier for inexistent plane [06:13:44] =========== [PASSED] drm_test_framebuffer_create =========== [06:13:44] [PASSED] drm_test_framebuffer_free [06:13:44] [PASSED] drm_test_framebuffer_init [06:13:44] [PASSED] drm_test_framebuffer_init_bad_format [06:13:44] [PASSED] drm_test_framebuffer_init_dev_mismatch [06:13:44] [PASSED] drm_test_framebuffer_lookup [06:13:44] [PASSED] drm_test_framebuffer_lookup_inexistent [06:13:44] [PASSED] drm_test_framebuffer_modifiers_not_supported [06:13:44] ================= [PASSED] drm_framebuffer ================= [06:13:44] ================ drm_gem_shmem (8 subtests) ================ [06:13:44] [PASSED] drm_gem_shmem_test_obj_create [06:13:44] [PASSED] drm_gem_shmem_test_obj_create_private [06:13:44] [PASSED] drm_gem_shmem_test_pin_pages [06:13:44] [PASSED] drm_gem_shmem_test_vmap [06:13:44] [PASSED] drm_gem_shmem_test_get_pages_sgt [06:13:44] [PASSED] drm_gem_shmem_test_get_sg_table [06:13:44] [PASSED] drm_gem_shmem_test_madvise [06:13:44] [PASSED] drm_gem_shmem_test_purge [06:13:44] ================== [PASSED] drm_gem_shmem ================== [06:13:44] === drm_atomic_helper_connector_hdmi_check (23 subtests) === [06:13:44] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode [06:13:44] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1 [06:13:44] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode [06:13:44] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1 [06:13:44] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode [06:13:44] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1 [06:13:44] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed [06:13:44] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed [06:13:44] [PASSED] drm_test_check_disable_connector [06:13:44] [PASSED] drm_test_check_hdmi_funcs_reject_rate [06:13:44] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback [06:13:44] [PASSED] drm_test_check_max_tmds_rate_format_fallback [06:13:44] [PASSED] drm_test_check_output_bpc_crtc_mode_changed [06:13:44] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed [06:13:44] [PASSED] drm_test_check_output_bpc_dvi [06:13:44] [PASSED] drm_test_check_output_bpc_format_vic_1 [06:13:44] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only [06:13:44] [PASSED] drm_test_check_output_bpc_format_display_rgb_only [06:13:44] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only [06:13:44] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only [06:13:44] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc [06:13:44] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc [06:13:44] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc [06:13:44] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ====== [06:13:44] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ==== [06:13:44] [PASSED] drm_test_check_broadcast_rgb_value [06:13:44] [PASSED] drm_test_check_bpc_8_value [06:13:44] [PASSED] drm_test_check_bpc_10_value [06:13:44] [PASSED] drm_test_check_bpc_12_value [06:13:44] [PASSED] drm_test_check_format_value [06:13:44] [PASSED] drm_test_check_tmds_char_value [06:13:44] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ====== [06:13:44] = drm_atomic_helper_connector_hdmi_mode_valid (4 subtests) = [06:13:44] [PASSED] drm_test_check_mode_valid [06:13:44] [PASSED] drm_test_check_mode_valid_reject [06:13:44] [PASSED] drm_test_check_mode_valid_reject_rate [06:13:44] [PASSED] drm_test_check_mode_valid_reject_max_clock [06:13:44] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid === [06:13:44] ================= drm_managed (2 subtests) ================= [06:13:44] [PASSED] drm_test_managed_release_action [06:13:44] [PASSED] drm_test_managed_run_action [06:13:44] =================== [PASSED] drm_managed =================== [06:13:44] =================== drm_mm (6 subtests) ==================== [06:13:44] [PASSED] drm_test_mm_init [06:13:44] [PASSED] drm_test_mm_debug [06:13:44] [PASSED] drm_test_mm_align32 [06:13:44] [PASSED] drm_test_mm_align64 [06:13:44] [PASSED] drm_test_mm_lowest [06:13:44] [PASSED] drm_test_mm_highest [06:13:44] ===================== [PASSED] drm_mm ====================== [06:13:44] ============= drm_modes_analog_tv (5 subtests) ============= [06:13:44] [PASSED] drm_test_modes_analog_tv_mono_576i [06:13:44] [PASSED] drm_test_modes_analog_tv_ntsc_480i [06:13:44] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined [06:13:44] [PASSED] drm_test_modes_analog_tv_pal_576i [06:13:44] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined [06:13:44] =============== [PASSED] drm_modes_analog_tv =============== [06:13:44] ============== drm_plane_helper (2 subtests) =============== [06:13:44] =============== drm_test_check_plane_state ================ [06:13:44] [PASSED] clipping_simple [06:13:44] [PASSED] clipping_rotate_reflect [06:13:44] [PASSED] positioning_simple [06:13:44] [PASSED] upscaling [06:13:44] [PASSED] downscaling [06:13:44] [PASSED] rounding1 [06:13:44] [PASSED] rounding2 [06:13:44] [PASSED] rounding3 [06:13:44] [PASSED] rounding4 [06:13:44] =========== [PASSED] drm_test_check_plane_state ============ [06:13:44] =========== drm_test_check_invalid_plane_state ============ [06:13:44] [PASSED] positioning_invalid [06:13:44] [PASSED] upscaling_invalid [06:13:44] [PASSED] downscaling_invalid [06:13:44] ======= [PASSED] drm_test_check_invalid_plane_state ======== [06:13:44] ================ [PASSED] drm_plane_helper ================= [06:13:44] ====== drm_connector_helper_tv_get_modes (1 subtest) ======= [06:13:44] ====== drm_test_connector_helper_tv_get_modes_check ======= [06:13:44] [PASSED] None [06:13:44] [PASSED] PAL [06:13:44] [PASSED] NTSC [06:13:44] [PASSED] Both, NTSC Default [06:13:44] [PASSED] Both, PAL Default [06:13:44] [PASSED] Both, NTSC Default, with PAL on command-line [06:13:44] [PASSED] Both, PAL Default, with NTSC on command-line [06:13:44] == [PASSED] drm_test_connector_helper_tv_get_modes_check === [06:13:44] ======== [PASSED] drm_connector_helper_tv_get_modes ======== [06:13:44] ================== drm_rect (9 subtests) =================== [06:13:44] [PASSED] drm_test_rect_clip_scaled_div_by_zero [06:13:44] [PASSED] drm_test_rect_clip_scaled_not_clipped [06:13:44] [PASSED] drm_test_rect_clip_scaled_clipped [06:13:44] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned [06:13:44] ================= drm_test_rect_intersect ================= [06:13:44] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0 [06:13:44] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1 [06:13:44] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0 [06:13:44] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1 [06:13:44] [PASSED] right x left: 2x1+0+0 x 3x1+1+0 [06:13:44] [PASSED] left x right: 3x1+1+0 x 2x1+0+0 [06:13:44] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1 [06:13:44] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0 [06:13:44] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1 [06:13:44] [PASSED] touching side: 1x1+0+0 x 1x1+1+0 [06:13:44] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0 [06:13:44] [PASSED] inside another: 2x2+0+0 x 1x1+1+1 [06:13:44] [PASSED] far away: 1x1+0+0 x 1x1+3+6 [06:13:44] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10 [06:13:44] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10 [06:13:44] ============= [PASSED] drm_test_rect_intersect ============= [06:13:44] ================ drm_test_rect_calc_hscale ================ [06:13:44] [PASSED] normal use [06:13:44] [PASSED] out of max range [06:13:44] [PASSED] out of min range [06:13:44] [PASSED] zero dst [06:13:44] [PASSED] negative src [06:13:44] [PASSED] negative dst [06:13:44] ============ [PASSED] drm_test_rect_calc_hscale ============ [06:13:44] ================ drm_test_rect_calc_vscale ================ [06:13:44] [PASSED] normal use [06:13:44] [PASSED] out of max range [06:13:44] [PASSED] out of min range [06:13:44] [PASSED] zero dst [06:13:44] [PASSED] negative src [06:13:44] [PASSED] negative dst [06:13:44] ============ [PASSED] drm_test_rect_calc_vscale ============ [06:13:44] ================== drm_test_rect_rotate =================== [06:13:44] [PASSED] reflect-x [06:13:44] [PASSED] reflect-y [06:13:44] [PASSED] rotate-0 [06:13:44] [PASSED] rotate-90 [06:13:44] [PASSED] rotate-180 [06:13:44] [PASSED] rotate-270 [06:13:44] ============== [PASSED] drm_test_rect_rotate =============== [06:13:44] ================ drm_test_rect_rotate_inv ================= [06:13:44] [PASSED] reflect-x [06:13:44] [PASSED] reflect-y [06:13:44] [PASSED] rotate-0 [06:13:44] [PASSED] rotate-90 [06:13:44] [PASSED] rotate-180 [06:13:44] [PASSED] rotate-270 [06:13:44] ============ [PASSED] drm_test_rect_rotate_inv ============= stty: 'standard input': Inappropriate ioctl for device [06:13:44] ==================== [PASSED] drm_rect ===================== [06:13:44] ============================================================ [06:13:44] Testing complete. Ran 608 tests: passed: 608 [06:13:44] Elapsed time: 23.144s total, 1.681s configuring, 21.295s building, 0.142s running
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [06:13:44] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig [06:13:46] 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 [06:13:54] Starting KUnit Kernel (1/1)... [06:13:54] ============================================================ Running tests with: $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt [06:13:54] ================= ttm_device (5 subtests) ================== [06:13:54] [PASSED] ttm_device_init_basic [06:13:54] [PASSED] ttm_device_init_multiple [06:13:54] [PASSED] ttm_device_fini_basic [06:13:54] [PASSED] ttm_device_init_no_vma_man [06:13:54] ================== ttm_device_init_pools ================== [06:13:54] [PASSED] No DMA allocations, no DMA32 required [06:13:54] [PASSED] DMA allocations, DMA32 required [06:13:54] [PASSED] No DMA allocations, DMA32 required [06:13:54] [PASSED] DMA allocations, no DMA32 required [06:13:54] ============== [PASSED] ttm_device_init_pools ============== [06:13:54] =================== [PASSED] ttm_device ==================== [06:13:54] ================== ttm_pool (8 subtests) =================== [06:13:54] ================== ttm_pool_alloc_basic =================== [06:13:54] [PASSED] One page [06:13:54] [PASSED] More than one page [06:13:54] [PASSED] Above the allocation limit [06:13:54] [PASSED] One page, with coherent DMA mappings enabled [06:13:54] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [06:13:54] ============== [PASSED] ttm_pool_alloc_basic =============== [06:13:54] ============== ttm_pool_alloc_basic_dma_addr ============== [06:13:54] [PASSED] One page [06:13:54] [PASSED] More than one page [06:13:54] [PASSED] Above the allocation limit [06:13:54] [PASSED] One page, with coherent DMA mappings enabled [06:13:54] [PASSED] Above the allocation limit, with coherent DMA mappings enabled [06:13:54] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ========== [06:13:54] [PASSED] ttm_pool_alloc_order_caching_match [06:13:54] [PASSED] ttm_pool_alloc_caching_mismatch [06:13:54] [PASSED] ttm_pool_alloc_order_mismatch [06:13:54] [PASSED] ttm_pool_free_dma_alloc [06:13:54] [PASSED] ttm_pool_free_no_dma_alloc [06:13:54] [PASSED] ttm_pool_fini_basic [06:13:54] ==================== [PASSED] ttm_pool ===================== [06:13:54] ================ ttm_resource (8 subtests) ================= [06:13:54] ================= ttm_resource_init_basic ================= [06:13:54] [PASSED] Init resource in TTM_PL_SYSTEM [06:13:54] [PASSED] Init resource in TTM_PL_VRAM [06:13:54] [PASSED] Init resource in a private placement [06:13:54] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags [06:13:54] ============= [PASSED] ttm_resource_init_basic ============= [06:13:54] [PASSED] ttm_resource_init_pinned [06:13:54] [PASSED] ttm_resource_fini_basic [06:13:54] [PASSED] ttm_resource_manager_init_basic [06:13:54] [PASSED] ttm_resource_manager_usage_basic [06:13:54] [PASSED] ttm_resource_manager_set_used_basic [06:13:54] [PASSED] ttm_sys_man_alloc_basic [06:13:54] [PASSED] ttm_sys_man_free_basic [06:13:54] ================== [PASSED] ttm_resource =================== [06:13:54] =================== ttm_tt (15 subtests) =================== [06:13:54] ==================== ttm_tt_init_basic ==================== [06:13:54] [PASSED] Page-aligned size [06:13:54] [PASSED] Extra pages requested [06:13:54] ================ [PASSED] ttm_tt_init_basic ================ [06:13:54] [PASSED] ttm_tt_init_misaligned [06:13:54] [PASSED] ttm_tt_fini_basic [06:13:54] [PASSED] ttm_tt_fini_sg [06:13:54] [PASSED] ttm_tt_fini_shmem [06:13:54] [PASSED] ttm_tt_create_basic [06:13:54] [PASSED] ttm_tt_create_invalid_bo_type [06:13:54] [PASSED] ttm_tt_create_ttm_exists [06:13:54] [PASSED] ttm_tt_create_failed [06:13:54] [PASSED] ttm_tt_destroy_basic [06:13:54] [PASSED] ttm_tt_populate_null_ttm [06:13:54] [PASSED] ttm_tt_populate_populated_ttm [06:13:54] [PASSED] ttm_tt_unpopulate_basic [06:13:54] [PASSED] ttm_tt_unpopulate_empty_ttm [06:13:54] [PASSED] ttm_tt_swapin_basic [06:13:54] ===================== [PASSED] ttm_tt ====================== [06:13:54] =================== ttm_bo (14 subtests) =================== [06:13:54] =========== ttm_bo_reserve_optimistic_no_ticket =========== [06:13:54] [PASSED] Cannot be interrupted and sleeps [06:13:54] [PASSED] Cannot be interrupted, locks straight away [06:13:54] [PASSED] Can be interrupted, sleeps [06:13:54] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket ======= [06:13:54] [PASSED] ttm_bo_reserve_locked_no_sleep [06:13:54] [PASSED] ttm_bo_reserve_no_wait_ticket [06:13:54] [PASSED] ttm_bo_reserve_double_resv [06:13:54] [PASSED] ttm_bo_reserve_interrupted [06:13:54] [PASSED] ttm_bo_reserve_deadlock [06:13:54] [PASSED] ttm_bo_unreserve_basic [06:13:54] [PASSED] ttm_bo_unreserve_pinned [06:13:54] [PASSED] ttm_bo_unreserve_bulk [06:13:54] [PASSED] ttm_bo_put_basic [06:13:54] [PASSED] ttm_bo_put_shared_resv [06:13:54] [PASSED] ttm_bo_pin_basic [06:13:54] [PASSED] ttm_bo_pin_unpin_resource [06:13:54] [PASSED] ttm_bo_multiple_pin_one_unpin [06:13:54] ===================== [PASSED] ttm_bo ====================== [06:13:54] ============== ttm_bo_validate (22 subtests) =============== [06:13:54] ============== ttm_bo_init_reserved_sys_man =============== [06:13:54] [PASSED] Buffer object for userspace [06:13:54] [PASSED] Kernel buffer object [06:13:54] [PASSED] Shared buffer object [06:13:54] ========== [PASSED] ttm_bo_init_reserved_sys_man =========== [06:13:54] ============== ttm_bo_init_reserved_mock_man ============== [06:13:54] [PASSED] Buffer object for userspace [06:13:54] [PASSED] Kernel buffer object [06:13:54] [PASSED] Shared buffer object [06:13:54] ========== [PASSED] ttm_bo_init_reserved_mock_man ========== [06:13:54] [PASSED] ttm_bo_init_reserved_resv [06:13:54] ================== ttm_bo_validate_basic ================== [06:13:54] [PASSED] Buffer object for userspace [06:13:54] [PASSED] Kernel buffer object [06:13:54] [PASSED] Shared buffer object [06:13:54] ============== [PASSED] ttm_bo_validate_basic ============== [06:13:54] [PASSED] ttm_bo_validate_invalid_placement [06:13:54] ============= ttm_bo_validate_same_placement ============== [06:13:54] [PASSED] System manager [06:13:54] [PASSED] VRAM manager [06:13:54] ========= [PASSED] ttm_bo_validate_same_placement ========== [06:13:54] [PASSED] ttm_bo_validate_failed_alloc [06:13:54] [PASSED] ttm_bo_validate_pinned [06:13:54] [PASSED] ttm_bo_validate_busy_placement [06:13:54] ================ ttm_bo_validate_multihop ================= [06:13:54] [PASSED] Buffer object for userspace [06:13:54] [PASSED] Kernel buffer object [06:13:54] [PASSED] Shared buffer object [06:13:54] ============ [PASSED] ttm_bo_validate_multihop ============= [06:13:54] ========== ttm_bo_validate_no_placement_signaled ========== [06:13:54] [PASSED] Buffer object in system domain, no page vector [06:13:54] [PASSED] Buffer object in system domain with an existing page vector [06:13:54] ====== [PASSED] ttm_bo_validate_no_placement_signaled ====== [06:13:54] ======== ttm_bo_validate_no_placement_not_signaled ======== [06:13:54] [PASSED] Buffer object for userspace [06:13:54] [PASSED] Kernel buffer object [06:13:54] [PASSED] Shared buffer object [06:13:54] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ==== [06:13:54] [PASSED] ttm_bo_validate_move_fence_signaled [06:13:54] ========= ttm_bo_validate_move_fence_not_signaled ========= [06:13:54] [PASSED] Waits for GPU [06:13:54] [PASSED] Tries to lock straight away [06:13:54] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled ===== [06:13:54] [PASSED] ttm_bo_validate_swapout [06:13:54] [PASSED] ttm_bo_validate_happy_evict [06:13:54] [PASSED] ttm_bo_validate_all_pinned_evict [06:13:54] [PASSED] ttm_bo_validate_allowed_only_evict [06:13:54] [PASSED] ttm_bo_validate_deleted_evict [06:13:54] [PASSED] ttm_bo_validate_busy_domain_evict [06:13:54] [PASSED] ttm_bo_validate_evict_gutting [06:13:54] [PASSED] ttm_bo_validate_recrusive_evict stty: 'standard input': Inappropriate ioctl for device [06:13:54] ================= [PASSED] ttm_bo_validate ================= [06:13:54] ============================================================ [06:13:54] Testing complete. Ran 102 tests: passed: 102 [06:13:54] Elapsed time: 10.412s total, 1.801s configuring, 7.993s building, 0.535s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
Patchwork
CI✗ CI.Build: failure for Some (drm_sched_|dma_)fence lifetime issues (rev2)
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: Some (drm_sched_|dma_)fence lifetime issues (rev2)
URL : https://patchwork.freedesktop.org/series/148825/
State : failure