linux/drivers/gpu/drm/xe
Matthew Auld 94c4aa2661
drm/xe/client: add missing bo locking in show_meminfo()
bo_meminfo() wants to inspect bo state like tt and the ttm resource,
however this state can change at any point leading to stuff like NPD and
UAF, if the bo lock is not held. Grab the bo lock when calling
bo_meminfo(), ensuring we drop any spinlocks first. In the case of
object_idr we now also need to hold a ref.

v2 (MattB)
  - Also add xe_bo_assert_held()

Fixes: 0845233388 ("drm/xe: Implement fdinfo memory stats printing")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911155527.178910-6-matthew.auld@intel.com
(cherry picked from commit 4f63d712fa)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2024-09-12 10:07:22 -04:00
..
abi drm/xe/guc: Add more GuC error codes to ABI 2024-06-26 18:25:07 -04:00
compat-i915-headers drm/xe/display: fix compat IS_DISPLAY_STEP() range end 2024-09-12 10:06:55 -04:00
display drm/xe/display: Avoid encoder_suspend at runtime suspend 2024-09-04 12:24:47 -04:00
instructions
regs drm/xe/oa: Enable Xe2+ PES disaggregation 2024-09-12 10:07:15 -04:00
tests drm/xe/mocs: Clarify difference between hw and sw sizes 2024-06-28 14:00:09 -07:00
.gitignore
.kunitconfig
Kconfig
Kconfig.debug
Kconfig.profile
Makefile drm/xe/bmg: implement Wa_16023588340 2024-08-19 13:30:41 -04:00
xe_args.h
xe_assert.h
xe_bb.c
xe_bb.h
xe_bb_types.h
xe_bo.c drm/xe: use devm instead of drmm for managed bo 2024-08-19 13:37:50 -04:00
xe_bo.h
xe_bo_doc.h
xe_bo_evict.c
xe_bo_evict.h
xe_bo_types.h drm/xe: Use write-back caching mode for system memory on DGFX 2024-07-11 08:25:26 -07:00
xe_debugfs.c
xe_debugfs.h
xe_devcoredump.c
xe_devcoredump.h
xe_devcoredump_types.h
xe_device.c drm/xe/xe2: Make subsequent L2 flush sequential 2024-08-19 13:30:47 -04:00
xe_device.h drm/xe/bmg: implement Wa_16023588340 2024-08-19 13:30:41 -04:00
xe_device_sysfs.c
xe_device_sysfs.h
xe_device_types.h drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_dma_buf.c
xe_dma_buf.h
xe_drm_client.c drm/xe/client: add missing bo locking in show_meminfo() 2024-09-12 10:07:22 -04:00
xe_drm_client.h
xe_drv.h
xe_exec.c drm/xe/exec: Fix minor bug related to xe_sync_entry_cleanup 2024-07-18 10:25:17 -04:00
xe_exec.h
xe_exec_queue.c drm/xe: prevent UAF around preempt fence 2024-08-19 10:39:28 -04:00
xe_exec_queue.h
xe_exec_queue_types.h drm/xe: prevent UAF around preempt fence 2024-08-19 10:39:28 -04:00
xe_execlist.c
xe_execlist.h
xe_execlist_types.h
xe_force_wake.c
xe_force_wake.h
xe_force_wake_types.h
xe_gen_wa_oob.c
xe_ggtt.c drm/xe/bmg: Apply Wa_22019338487 2024-07-02 12:14:00 -04:00
xe_ggtt.h
xe_ggtt_types.h
xe_gpu_scheduler.c
xe_gpu_scheduler.h
xe_gpu_scheduler_types.h
xe_gsc.c drm/xe/gsc: Do not attempt to load the GSC multiple times 2024-09-03 10:36:38 -04:00
xe_gsc.h
xe_gsc_proxy.c
xe_gsc_proxy.h
xe_gsc_submit.c
xe_gsc_submit.h
xe_gsc_types.h
xe_gt.c drm/xe/gt: Remove double include 2024-09-12 10:06:02 -04:00
xe_gt.h drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_gt_ccs_mode.c
xe_gt_ccs_mode.h
xe_gt_clock.c
xe_gt_clock.h
xe_gt_debugfs.c
xe_gt_debugfs.h
xe_gt_freq.c
xe_gt_freq.h
xe_gt_idle.c
xe_gt_idle.h
xe_gt_idle_types.h
xe_gt_mcr.c drm/xe/mcr: Avoid clobbering DSS steering 2024-07-04 10:36:30 +02:00
xe_gt_mcr.h
xe_gt_pagefault.c drm/xe: Fix missing workqueue destroy in xe_gt_pagefault 2024-08-21 11:53:02 -04:00
xe_gt_pagefault.h
xe_gt_printk.h
xe_gt_sriov_pf.c drm/xe/pf: Restart VFs provisioning after GT reset 2024-07-01 19:43:52 +02:00
xe_gt_sriov_pf.h drm/xe/pf: Restart VFs provisioning after GT reset 2024-07-01 19:43:52 +02:00
xe_gt_sriov_pf_config.c drm/xe/pf: Fix VF config validation on multi-GT platforms 2024-08-15 09:44:22 -04:00
xe_gt_sriov_pf_config.h drm/xe/pf: Restart VFs provisioning after GT reset 2024-07-01 19:43:52 +02:00
xe_gt_sriov_pf_config_types.h
xe_gt_sriov_pf_control.c drm/xe/pf: Trigger explicit FLR while disabling VFs 2024-06-26 18:25:20 -04:00
xe_gt_sriov_pf_control.h drm/xe/pf: Trigger explicit FLR while disabling VFs 2024-06-26 18:25:20 -04:00
xe_gt_sriov_pf_debugfs.c
xe_gt_sriov_pf_debugfs.h
xe_gt_sriov_pf_helpers.h
xe_gt_sriov_pf_monitor.c
xe_gt_sriov_pf_monitor.h
xe_gt_sriov_pf_monitor_types.h
xe_gt_sriov_pf_policy.c
xe_gt_sriov_pf_policy.h
xe_gt_sriov_pf_policy_types.h
xe_gt_sriov_pf_service.c
xe_gt_sriov_pf_service.h
xe_gt_sriov_pf_service_types.h
xe_gt_sriov_pf_types.h
xe_gt_sriov_printk.h
xe_gt_sriov_vf.c drm/xe/vf: Fix register value lookup 2024-08-15 09:44:22 -04:00
xe_gt_sriov_vf.h
xe_gt_sriov_vf_debugfs.c
xe_gt_sriov_vf_debugfs.h
xe_gt_sriov_vf_types.h
xe_gt_sysfs.c
xe_gt_sysfs.h
xe_gt_sysfs_types.h
xe_gt_throttle.c
xe_gt_throttle.h
xe_gt_tlb_invalidation.c drm/xe: Remove fence check from send_tlb_invalidation 2024-09-12 10:06:16 -04:00
xe_gt_tlb_invalidation.h drm/xe: Hold a PM ref when GT TLB invalidations are inflight 2024-08-15 09:44:22 -04:00
xe_gt_tlb_invalidation_types.h drm/xe: Hold a PM ref when GT TLB invalidations are inflight 2024-08-15 09:44:22 -04:00
xe_gt_topology.c
xe_gt_topology.h
xe_gt_types.h drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_guc.c drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_guc.h drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_guc_ads.c
xe_guc_ads.h
xe_guc_ads_types.h
xe_guc_ct.c drm/xe: Build PM into GuC CT layer 2024-08-15 09:44:22 -04:00
xe_guc_ct.h drm/xe/guc: Configure TLB timeout based on CT buffer size 2024-07-01 17:38:48 +02:00
xe_guc_ct_types.h
xe_guc_db_mgr.c
xe_guc_db_mgr.h
xe_guc_debugfs.c
xe_guc_debugfs.h
xe_guc_exec_queue_types.h
xe_guc_fwif.h
xe_guc_hwconfig.c
xe_guc_hwconfig.h
xe_guc_hxg_helpers.h
xe_guc_id_mgr.c
xe_guc_id_mgr.h
xe_guc_klv_helpers.c
xe_guc_klv_helpers.h
xe_guc_klv_thresholds_set.h
xe_guc_klv_thresholds_set_types.h
xe_guc_log.c
xe_guc_log.h
xe_guc_log_types.h
xe_guc_pc.c drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_guc_pc.h drm/xe/guc: Request max GT freq during resume 2024-06-26 18:23:45 -04:00
xe_guc_pc_types.h
xe_guc_relay.c
xe_guc_relay.h
xe_guc_relay_types.h
xe_guc_submit.c drm/xe: Fix possible UAF in guc_exec_queue_process_msg 2024-09-12 10:06:22 -04:00
xe_guc_submit.h drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_guc_submit_types.h
xe_guc_types.h
xe_heci_gsc.c
xe_heci_gsc.h
xe_hmm.c
xe_hmm.h
xe_huc.c drm/xe/huc: Use GT oriented error messages in xe_huc.c 2024-06-26 18:24:29 -04:00
xe_huc.h
xe_huc_debugfs.c
xe_huc_debugfs.h
xe_huc_types.h
xe_hw_engine.c drm/xe: Get hwe domain specific FW to read RING_TIMESTAMP 2024-06-28 11:52:29 -07:00
xe_hw_engine.h drm/xe: Get hwe domain specific FW to read RING_TIMESTAMP 2024-06-28 11:52:29 -07:00
xe_hw_engine_class_sysfs.c
xe_hw_engine_class_sysfs.h
xe_hw_engine_types.h
xe_hw_fence.c drm/xe: Drop HW fence pointer to HW fence ctx 2024-08-21 11:53:12 -04:00
xe_hw_fence.h
xe_hw_fence_types.h drm/xe: Drop HW fence pointer to HW fence ctx 2024-08-21 11:53:12 -04:00
xe_hwmon.c drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_hwmon.h
xe_irq.c drm/xe/irq: remove xe_irq_shutdown 2024-06-26 18:25:22 -04:00
xe_irq.h drm/xe/irq: remove xe_irq_shutdown 2024-06-26 18:25:22 -04:00
xe_lmtt.c
xe_lmtt.h
xe_lmtt_2l.c
xe_lmtt_ml.c
xe_lmtt_types.h
xe_lrc.c drm/xe: Take ref to VM in delayed snapshot 2024-08-08 13:48:01 -04:00
xe_lrc.h
xe_lrc_types.h
xe_macros.h
xe_map.h
xe_memirq.c
xe_memirq.h
xe_memirq_types.h
xe_migrate.c drm/xe: fix error handling in xe_migrate_update_pgtables 2024-07-04 10:36:20 +02:00
xe_migrate.h
xe_migrate_doc.h
xe_mmio.c drm/xe/xe2: Add Wa_15015404425 2024-08-19 13:30:47 -04:00
xe_mmio.h
xe_mocs.c drm/xe/mocs: Clarify difference between hw and sw sizes 2024-06-28 14:00:09 -07:00
xe_mocs.h
xe_module.c drm/xe/uapi: Rename xe perf layer as xe observation layer 2024-07-11 09:54:24 -04:00
xe_module.h
xe_oa.c drm/xe/oa: Enable Xe2+ PES disaggregation 2024-09-12 10:07:15 -04:00
xe_oa.h
xe_oa_types.h drm/xe/oa/uapi: Allow preemption to be disabled on the stream exec queue 2024-06-26 18:25:46 -04:00
xe_observation.c drm/xe/observation: Drop empty sysctl table entry 2024-08-19 10:38:58 -04:00
xe_observation.h drm/xe/uapi: Rename xe perf layer as xe observation layer 2024-07-11 09:54:24 -04:00
xe_pat.c drm/xe/bmg: implement Wa_16023588340 2024-08-19 13:30:41 -04:00
xe_pat.h
xe_pci.c drm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV 2024-07-01 18:01:31 +02:00
xe_pci.h
xe_pci_sriov.c drm/xe/pf: Skip fair VFs provisioning if already provisioned 2024-07-01 19:43:50 +02:00
xe_pci_sriov.h drm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV 2024-07-01 18:01:31 +02:00
xe_pci_types.h
xe_pcode.c drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_pcode.h drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_pcode_api.h
xe_platform_types.h
xe_pm.c drm/xe/display: Make display suspend/resume work on discrete 2024-08-19 10:39:36 -04:00
xe_pm.h
xe_preempt_fence.c drm/xe: prevent UAF around preempt fence 2024-08-19 10:39:28 -04:00
xe_preempt_fence.h
xe_preempt_fence_types.h drm/xe: prevent UAF around preempt fence 2024-08-19 10:39:28 -04:00
xe_pt.c drm/xe: Drop xe_gt_tlb_invalidation_wait 2024-08-15 09:44:22 -04:00
xe_pt.h
xe_pt_types.h
xe_pt_walk.c
xe_pt_walk.h
xe_query.c
xe_query.h
xe_range_fence.c
xe_range_fence.h
xe_reg_sr.c
xe_reg_sr.h
xe_reg_sr_types.h
xe_reg_whitelist.c
xe_reg_whitelist.h
xe_res_cursor.h
xe_ring_ops.c
xe_ring_ops.h
xe_ring_ops_types.h
xe_rtp.c drm/xe/rtp: Fix off-by-one when processing rules 2024-08-08 13:48:01 -04:00
xe_rtp.h
xe_rtp_helpers.h
xe_rtp_types.h
xe_sa.c
xe_sa.h
xe_sa_types.h
xe_sched_job.c drm/xe: Free job before xe_exec_queue_put 2024-08-21 11:53:15 -04:00
xe_sched_job.h
xe_sched_job_types.h
xe_sriov.c
xe_sriov.h
xe_sriov_pf.c
xe_sriov_pf.h
xe_sriov_pf_helpers.h
xe_sriov_printk.h
xe_sriov_types.h
xe_step.c
xe_step.h
xe_step_types.h
xe_sync.c drm/xe: Fix access_ok check in user_fence_create 2024-09-12 10:06:30 -04:00
xe_sync.h
xe_sync_types.h
xe_tile.c drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_tile.h
xe_tile_sysfs.c
xe_tile_sysfs.h
xe_tile_sysfs_types.h
xe_trace.c
xe_trace.h drm/xe: Drop HW fence pointer to HW fence ctx 2024-08-21 11:53:12 -04:00
xe_trace_bo.c
xe_trace_bo.h
xe_trace_guc.c
xe_trace_guc.h
xe_ttm_stolen_mgr.c
xe_ttm_stolen_mgr.h
xe_ttm_sys_mgr.c
xe_ttm_sys_mgr.h
xe_ttm_vram_mgr.c drm/buddy: Add start address support to trim function 2024-08-07 18:19:00 -04:00
xe_ttm_vram_mgr.h
xe_ttm_vram_mgr_types.h
xe_tuning.c
xe_tuning.h
xe_uc.c drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_uc.h drm/xe: Wedge the entire device 2024-07-18 10:25:33 -04:00
xe_uc_debugfs.c
xe_uc_debugfs.h
xe_uc_fw.c
xe_uc_fw.h drm/xe/gsc: Do not attempt to load the GSC multiple times 2024-09-03 10:36:38 -04:00
xe_uc_fw_abi.h
xe_uc_fw_types.h
xe_uc_types.h
xe_vm.c drm/xe: Invalidate media_gt TLBs 2024-08-27 09:31:28 -04:00
xe_vm.h
xe_vm_doc.h
xe_vm_types.h
xe_vram.c
xe_vram.h
xe_vram_freq.c drm/xe/pcode: Treat pcode as per-tile rather than per-GT 2024-09-03 10:36:46 -04:00
xe_vram_freq.h
xe_wa.c drm/xe/xe2hpg: Add Wa_14021821874 2024-08-19 13:34:58 -04:00
xe_wa.h
xe_wa_oob.rules drm/xe/bmg: implement Wa_16023588340 2024-08-19 13:30:41 -04:00
xe_wait_user_fence.c
xe_wait_user_fence.h
xe_wopcm.c
xe_wopcm.h
xe_wopcm_types.h