mirror_ubuntu-kernels/drivers/gpu/drm/i915/gt/uc
Andrzej Hajda 5eefc5307c drm/i915: mark requests for GuC virtual engines to avoid use-after-free
References to i915_requests may be trapped by userspace inside a
sync_file or dmabuf (dma-resv) and held indefinitely across different
proceses. To counter-act the memory leaks, we try to not to keep
references from the request past their completion.
On the other side on fence release we need to know if rq->engine
is valid and points to hw engine (true for non-virtual requests).
To make it possible extra bit has been added to rq->execution_mask,
for marking virtual engines.

Fixes: bcb9aa45d5 ("Revert "drm/i915: Hold reference to intel_context over life of i915_request"")
Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230821153035.3903006-1-andrzej.hajda@intel.com
(cherry picked from commit 280410677a)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-08-30 11:32:48 -04:00
..
abi drm/i915/guc: Drop legacy CTB definitions 2023-05-31 12:07:07 -07:00
guc_capture_fwif.h drm/i915/guc: add intel_guc_state_capture member docs for ads_null_cache and max_mmio_per_node 2023-05-04 12:11:54 +03:00
intel_gsc_binary_headers.h drm/i915/mtl/gsc: extract release and security versions from the gsc binary 2023-06-13 15:02:40 -07:00
intel_gsc_fw.c drm/i915/gt: Apply workaround 22016122933 correctly 2023-08-10 14:14:13 +02:00
intel_gsc_fw.h drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests 2023-07-27 14:16:29 -07:00
intel_gsc_proxy.c drm/i915/gsc: use system include style for drm headers 2023-05-26 12:28:15 +03:00
intel_gsc_proxy.h drm/i915/gsc: add support for GSC proxy interrupt 2023-05-04 04:02:00 -07:00
intel_gsc_uc_debugfs.c drm/i915/mtl/gsc: Add a gsc_info debugfs 2023-06-13 15:02:44 -07:00
intel_gsc_uc_debugfs.h drm/i915/mtl/gsc: Add a gsc_info debugfs 2023-06-13 15:02:44 -07:00
intel_gsc_uc_heci_cmd_submit.c drm/i915/gsc: Fix error code in intel_gsc_uc_heci_cmd_submit_nonpriv() 2023-06-08 02:11:04 +02:00
intel_gsc_uc_heci_cmd_submit.h drm/i915/mtl/gsc: query the GSC FW for its compatibility version 2023-06-13 15:02:42 -07:00
intel_gsc_uc.c Merge tag 'drm-intel-gt-next-2023-08-04' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2023-08-07 13:49:25 +10:00
intel_gsc_uc.h drm/i915/mtl/gsc: Add a gsc_info debugfs 2023-06-13 15:02:44 -07:00
intel_guc_ads.c drm/i915/guc: Fix confused register capture list creation 2023-05-12 11:05:19 -07:00
intel_guc_ads.h
intel_guc_capture.c drm/i915/gt/uc: drop unused but set variable sseu 2023-06-07 13:23:16 +03:00
intel_guc_capture.h drm/i915/guc: Fix error capture for virtual engines 2023-05-03 11:42:14 -07:00
intel_guc_ct.c drm/i915/gt: Apply workaround 22016122933 correctly 2023-08-10 14:14:13 +02:00
intel_guc_ct.h drm/i915/guc: Track all sent actions to GuC 2023-05-30 15:18:21 -07:00
intel_guc_debugfs.c
intel_guc_debugfs.h
intel_guc_fw.c drm/i915/guc: Dump perf_limit_reasons for debug 2023-07-06 13:33:26 -07:00
intel_guc_fw.h
intel_guc_fwif.h drm/i915/guc: Remove some obsolete definitions 2023-06-06 11:35:27 -07:00
intel_guc_hwconfig.c drm/i915/adln: s/ADLP/ALDERLAKE_P in ADLN defines 2023-08-07 15:37:12 -07:00
intel_guc_log_debugfs.c
intel_guc_log_debugfs.h
intel_guc_log.c
intel_guc_log.h
intel_guc_print.h
intel_guc_rc.c
intel_guc_rc.h
intel_guc_reg.h
intel_guc_slpc_types.h drm/i915/guc/slpc: Provide sysfs for efficient freq 2023-04-28 09:59:51 -07:00
intel_guc_slpc.c drm/i915/guc/slpc: Restore efficient freq earlier 2023-08-02 11:08:02 -07:00
intel_guc_slpc.h drm/i915/guc/slpc: Provide sysfs for efficient freq 2023-04-28 09:59:51 -07:00
intel_guc_submission.c drm/i915: mark requests for GuC virtual engines to avoid use-after-free 2023-08-30 11:32:48 -04:00
intel_guc_submission.h
intel_guc.c drm/i915/gt: Apply workaround 22016122933 correctly 2023-08-10 14:14:13 +02:00
intel_guc.h drm/i915/guc: add dbgfs_node member kernel-doc 2023-05-04 12:11:41 +03:00
intel_huc_debugfs.c
intel_huc_debugfs.h
intel_huc_fw.c drm/i915: Make i915_coherent_map_type GT-centric 2023-08-10 14:14:11 +02:00
intel_huc_fw.h drm/i915/mtl/huc: auth HuC via GSC 2023-06-05 09:53:51 -07:00
intel_huc_print.h drm/i915/huc: Parse the GSC-enabled HuC binary 2023-06-05 09:52:44 -07:00
intel_huc.c Merge tag 'drm-intel-gt-next-2023-08-04' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2023-08-07 13:49:25 +10:00
intel_huc.h drm/i915/mtl/huc: auth HuC via GSC 2023-06-05 09:53:51 -07:00
intel_uc_debugfs.c drm/i915/mtl/gsc: Add a gsc_info debugfs 2023-06-13 15:02:44 -07:00
intel_uc_debugfs.h
intel_uc_fw_abi.h drm/i915/huc: Parse the GSC-enabled HuC binary 2023-06-05 09:52:44 -07:00
intel_uc_fw.c Merge tag 'drm-intel-gt-next-2023-08-11' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2023-08-15 11:53:32 +10:00
intel_uc_fw.h drm/i915/mtl/gsc: query the GSC FW for its compatibility version 2023-06-13 15:02:42 -07:00
intel_uc.c drm/i915/adls: s/ADLS_RPLS/RAPTORLAKE_S in platform and subplatform defines 2023-08-07 15:37:13 -07:00
intel_uc.h drm/i915/uc: perma-pin firmwares 2023-06-05 09:52:42 -07:00
selftest_guc_hangcheck.c
selftest_guc_multi_lrc.c
selftest_guc.c drm/i915/guc: Fix potential null pointer deref in GuC 'steal id' test 2023-08-10 16:02:01 -07:00