diff options
| author | Zongyao Bai <zongyao.bai@intel.com> | 2026-11-16 11:22:19 -0800 |
|---|---|---|
| committer | Matthew Brost <matthew.brost@intel.com> | 2026-11-18 19:52:28 -0800 |
| commit | b865310c41f5b68c7de3bec86f205ba8cd284fd1 (patch) | |
| tree | 556aafa0dc4d7513b2b2cd071c4e345c7d91679f /tools/perf/scripts/python | |
| parent | 22e05ee854e1bdacebcfa36ecd3f33ec80cf897a (diff) | |
drm/xe/guc: Treat CT-disabled TLB invalidation as cancelled
During a GT reset the GuC CT channel goes through two states before it
is enabled again:
gt_reset_worker()
xe_uc_stop() ENABLED -> STOPPED send: -ECANCELED
xe_tlb_inval_reset()
do_gt_reset()
do_gt_restart()
xe_uc_sanitize_reset() STOPPED -> DISABLED send: -ENODEV
GuC load, CT enable DISABLED -> ENABLED
xe_tlb_inval_issue() treats -ECANCELED as "undelivered, report done",
but -ENODEV is propagated to the caller. A userptr invalidation from an
MMU notifier (e.g. munmap() on a fault-mode VM) issued in the DISABLED
window thus trips the XE_WARN_ON() in xe_vma_userptr_do_inval() and
taints the kernel:
Tile0: GT1: GT: reset started
WARNING: drivers/gpu/drm/xe/xe_userptr.c:133 at xe_vma_userptr_do_inval+0x340/0x4a0 [xe]
RAX: 00000000ffffffed
xe_vma_userptr_invalidate_start+0x4b7/0x7c0 [xe]
__mmu_notifier_invalidate_range_start+0x247/0x370
unmap_vmas+0x1af/0x1c0
unmap_region+0x91/0xf0
...
The TLB invalidation ops contract is that the backend returns
-ECANCELED when it is mid-reset. The reset invalidates all TLBs, so
there is nothing left to do. Map -ENODEV to -ECANCELED in
send_tlb_inval() so that every GuC TLB invalidation type handles it the
same way, instead of only send_tlb_inval_ggtt_full() as done so far.
The CT is also DISABLED across system suspend and runtime suspend. On
resume from system suspend the GuC is reloaded with all TLBs invalid, so
nothing is lost there either; user space and the MM kernel threads are
frozen by then, so such a request is not expected anyway. A request
issued while runtime suspended violates the PM rules and is still
reported by the "Missing outer runtime PM protection" warning in
xe_tlb_inval_fence_init().
Fixes: db16f9d90c1d ("drm/xe: Split TLB invalidation code in frontend and backend")
Cc: stable@vger.kernel.org # v6.18+
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Zongyao Bai <zongyao.bai@intel.com>
Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Link: https://patch.msgid.link/20261116192220.3872267-2-zongyao.bai@intel.com
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
(cherry picked from commit c17474e39028c7fb5cd6b2fb0f0413d07b1bf232)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
