Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Have xe_vm and xe_exec_queue take references to xef
@ 2024-07-09  0:28 Umesh Nerlige Ramappa
  2024-07-09  0:28 ` [PATCH v2 1/4] drm/xe: Move part of xe_file cleanup to a helper Umesh Nerlige Ramappa
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Umesh Nerlige Ramappa @ 2024-07-09  0:28 UTC (permalink / raw)
  To: intel-xe, matthew.brost, lucas.demarchi

xe_file_close triggers an asynchronous queue cleanup and then frees up
the xef object. Since queue cleanup flushes all pending jobs and the KMD
stores client usage stats into the xef object after jobs are flushed, we
see a use-after-free for the xef object. Resolve this by taking a
reference to xef from xe_exec_queue.

Issue: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1908

The series adds xef refcounting and ensures all consumers of xef take a
ref to it.

v2:
- Include review comments from v1
- Squash patch 3 and 5 from v1 to add Fixes/Closes tags

Note: Patches 1 - 3 can be merged independently

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>

Umesh Nerlige Ramappa (4):
  drm/xe: Move part of xe_file cleanup to a helper
  drm/xe: Add ref counting for xe_file
  drm/xe: Take a ref to xe file when user creates a VM
  drm/xe: Fix use after free when client stats are captured

 drivers/gpu/drm/xe/xe_device.c           | 56 +++++++++++++++++++-----
 drivers/gpu/drm/xe/xe_device.h           |  3 ++
 drivers/gpu/drm/xe/xe_device_types.h     |  3 ++
 drivers/gpu/drm/xe/xe_drm_client.c       |  5 +--
 drivers/gpu/drm/xe/xe_exec_queue.c       | 10 ++++-
 drivers/gpu/drm/xe/xe_exec_queue_types.h |  7 ++-
 drivers/gpu/drm/xe/xe_vm.c               |  6 ++-
 7 files changed, 69 insertions(+), 21 deletions(-)

-- 
2.38.1


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

end of thread, other threads:[~2024-07-18 19:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09  0:28 [PATCH v2 0/4] Have xe_vm and xe_exec_queue take references to xef Umesh Nerlige Ramappa
2024-07-09  0:28 ` [PATCH v2 1/4] drm/xe: Move part of xe_file cleanup to a helper Umesh Nerlige Ramappa
2024-07-09  0:37   ` Matthew Brost
2024-07-18 12:53   ` Lucas De Marchi
2024-07-09  0:28 ` [PATCH v2 2/4] drm/xe: Add ref counting for xe_file Umesh Nerlige Ramappa
2024-07-09 20:41   ` Matthew Brost
2024-07-18 13:01     ` Lucas De Marchi
2024-07-18 18:57       ` Umesh Nerlige Ramappa
2024-07-18 19:24         ` Lucas De Marchi
2024-07-09  0:28 ` [PATCH v2 3/4] drm/xe: Take a ref to xe file when user creates a VM Umesh Nerlige Ramappa
2024-07-18 13:01   ` Lucas De Marchi
2024-07-09  0:28 ` [PATCH v2 4/4] drm/xe: Fix use after free when client stats are captured Umesh Nerlige Ramappa
2024-07-09 20:46   ` Matthew Brost
2024-07-18 13:35   ` Lucas De Marchi
2024-07-09  0:33 ` ✓ CI.Patch_applied: success for Have xe_vm and xe_exec_queue take references to xef (rev2) Patchwork
2024-07-09  0:33 ` ✓ CI.checkpatch: " Patchwork
2024-07-09  0:34 ` ✓ CI.KUnit: " Patchwork
2024-07-09  0:46 ` ✓ CI.Build: " Patchwork
2024-07-09  0:49 ` ✓ CI.Hooks: " Patchwork
2024-07-09  0:50 ` ✓ CI.checksparse: " Patchwork
2024-07-09  1:04 ` ✓ CI.BAT: " Patchwork
2024-07-09  4:21 ` ✓ CI.FULL: " Patchwork

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