mirror of https://github.com/torvalds/linux.git
Make sure to call xe_pt_update_ops_fini in xe_pt_update_ops_abort to
free any memory the bind allocated.
Caught by kmemleak when running Vulkan CTS tests on LNL. The leak
seems to happen only when there's some kind of failure happening, like
the lack of memory. Example output:
unreferenced object 0xffff9120bdf62000 (size 8192):
comm "deqp-vk", pid 115008, jiffies 4310295728
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 1b 05 f9 28 01 00 00 40 ...........(...@
00 00 00 00 00 00 00 00 1b 15 f9 28 01 00 00 40 ...........(...@
backtrace (crc 7a56be79):
[<ffffffff86dd81f0>] __kmalloc_cache_noprof+0x310/0x3d0
[<ffffffffc08e8211>] xe_pt_new_shared.constprop.0+0x81/0xb0 [xe]
[<ffffffffc08e8309>] xe_pt_insert_entry+0xb9/0x140 [xe]
[<ffffffffc08eab6d>] xe_pt_stage_bind_entry+0x12d/0x5b0 [xe]
[<ffffffffc08ecbca>] xe_pt_walk_range+0xea/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08e9eff>] xe_pt_stage_bind.constprop.0+0x25f/0x580 [xe]
[<ffffffffc08eb21a>] bind_op_prepare+0xea/0x6e0 [xe]
[<ffffffffc08ebab8>] xe_pt_update_ops_prepare+0x1c8/0x440 [xe]
[<ffffffffc08ffbf3>] ops_execute+0x143/0x850 [xe]
[<ffffffffc0900b64>] vm_bind_ioctl_ops_execute+0x244/0x800 [xe]
[<ffffffffc0906467>] xe_vm_bind_ioctl+0x1877/0x2370 [xe]
[<ffffffffc05e92b3>] drm_ioctl_kernel+0xb3/0x110 [drm]
unreferenced object 0xffff9120bdf72000 (size 8192):
comm "deqp-vk", pid 115008, jiffies 4310295728
hex dump (first 32 bytes):
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
backtrace (crc 23b2f0b5):
[<ffffffff86dd81f0>] __kmalloc_cache_noprof+0x310/0x3d0
[<ffffffffc08e8211>] xe_pt_new_shared.constprop.0+0x81/0xb0 [xe]
[<ffffffffc08e8453>] xe_pt_stage_unbind_post_descend+0xb3/0x150 [xe]
[<ffffffffc08ecd26>] xe_pt_walk_range+0x246/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08eccea>] xe_pt_walk_range+0x20a/0x280 [xe]
[<ffffffffc08ece31>] xe_pt_walk_shared+0xc1/0x110 [xe]
[<ffffffffc08e7b2a>] xe_pt_stage_unbind+0x9a/0xd0 [xe]
[<ffffffffc08e913d>] unbind_op_prepare+0xdd/0x270 [xe]
[<ffffffffc08eb9f6>] xe_pt_update_ops_prepare+0x106/0x440 [xe]
[<ffffffffc08ffbf3>] ops_execute+0x143/0x850 [xe]
[<ffffffffc0900b64>] vm_bind_ioctl_ops_execute+0x244/0x800 [xe]
[<ffffffffc0906467>] xe_vm_bind_ioctl+0x1877/0x2370 [xe]
[<ffffffffc05e92b3>] drm_ioctl_kernel+0xb3/0x110 [drm]
[<ffffffffc05e95a0>] drm_ioctl+0x280/0x4e0 [drm]
Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2877
Fixes:
|
||
|---|---|---|
| .. | ||
| abi | ||
| compat-i915-headers | ||
| display | ||
| instructions | ||
| regs | ||
| tests | ||
| .gitignore | ||
| .kunitconfig | ||
| Kconfig | ||
| Kconfig.debug | ||
| Kconfig.profile | ||
| Makefile | ||
| xe_args.h | ||
| xe_assert.h | ||
| xe_bb.c | ||
| xe_bb.h | ||
| xe_bb_types.h | ||
| xe_bo.c | ||
| xe_bo.h | ||
| xe_bo_doc.h | ||
| xe_bo_evict.c | ||
| xe_bo_evict.h | ||
| xe_bo_types.h | ||
| xe_debugfs.c | ||
| xe_debugfs.h | ||
| xe_devcoredump.c | ||
| xe_devcoredump.h | ||
| xe_devcoredump_types.h | ||
| xe_device.c | ||
| xe_device.h | ||
| xe_device_sysfs.c | ||
| xe_device_sysfs.h | ||
| xe_device_types.h | ||
| xe_dma_buf.c | ||
| xe_dma_buf.h | ||
| xe_drm_client.c | ||
| xe_drm_client.h | ||
| xe_drv.h | ||
| xe_exec.c | ||
| xe_exec.h | ||
| xe_exec_queue.c | ||
| xe_exec_queue.h | ||
| xe_exec_queue_types.h | ||
| 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 | ||
| xe_ggtt.h | ||
| xe_ggtt_types.h | ||
| xe_gpu_scheduler.c | ||
| xe_gpu_scheduler.h | ||
| xe_gpu_scheduler_types.h | ||
| xe_gsc.c | ||
| xe_gsc.h | ||
| xe_gsc_debugfs.c | ||
| xe_gsc_debugfs.h | ||
| xe_gsc_proxy.c | ||
| xe_gsc_proxy.h | ||
| xe_gsc_submit.c | ||
| xe_gsc_submit.h | ||
| xe_gsc_types.h | ||
| xe_gt.c | ||
| xe_gt.h | ||
| 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 | ||
| xe_gt_mcr.h | ||
| xe_gt_pagefault.c | ||
| xe_gt_pagefault.h | ||
| xe_gt_printk.h | ||
| xe_gt_sriov_pf.c | ||
| xe_gt_sriov_pf.h | ||
| xe_gt_sriov_pf_config.c | ||
| xe_gt_sriov_pf_config.h | ||
| xe_gt_sriov_pf_config_types.h | ||
| xe_gt_sriov_pf_control.c | ||
| xe_gt_sriov_pf_control.h | ||
| xe_gt_sriov_pf_control_types.h | ||
| 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 | ||
| 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_stats.c | ||
| xe_gt_stats.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 | ||
| xe_gt_tlb_invalidation.h | ||
| xe_gt_tlb_invalidation_types.h | ||
| xe_gt_topology.c | ||
| xe_gt_topology.h | ||
| xe_gt_types.h | ||
| xe_guc.c | ||
| xe_guc.h | ||
| xe_guc_ads.c | ||
| xe_guc_ads.h | ||
| xe_guc_ads_types.h | ||
| xe_guc_ct.c | ||
| xe_guc_ct.h | ||
| 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 | ||
| xe_guc_pc.h | ||
| xe_guc_pc_types.h | ||
| xe_guc_relay.c | ||
| xe_guc_relay.h | ||
| xe_guc_relay_types.h | ||
| xe_guc_submit.c | ||
| xe_guc_submit.h | ||
| 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 | ||
| xe_huc.h | ||
| xe_huc_debugfs.c | ||
| xe_huc_debugfs.h | ||
| xe_huc_types.h | ||
| xe_hw_engine.c | ||
| xe_hw_engine.h | ||
| xe_hw_engine_class_sysfs.c | ||
| xe_hw_engine_class_sysfs.h | ||
| xe_hw_engine_group.c | ||
| xe_hw_engine_group.h | ||
| xe_hw_engine_group_types.h | ||
| xe_hw_engine_types.h | ||
| xe_hw_fence.c | ||
| xe_hw_fence.h | ||
| xe_hw_fence_types.h | ||
| xe_hwmon.c | ||
| xe_hwmon.h | ||
| xe_irq.c | ||
| xe_irq.h | ||
| xe_lmtt.c | ||
| xe_lmtt.h | ||
| xe_lmtt_2l.c | ||
| xe_lmtt_ml.c | ||
| xe_lmtt_types.h | ||
| xe_lrc.c | ||
| 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 | ||
| xe_migrate.h | ||
| xe_migrate_doc.h | ||
| xe_mmio.c | ||
| xe_mmio.h | ||
| xe_mocs.c | ||
| xe_mocs.h | ||
| xe_module.c | ||
| xe_module.h | ||
| xe_oa.c | ||
| xe_oa.h | ||
| xe_oa_types.h | ||
| xe_observation.c | ||
| xe_observation.h | ||
| xe_pat.c | ||
| xe_pat.h | ||
| xe_pci.c | ||
| xe_pci.h | ||
| xe_pci_sriov.c | ||
| xe_pci_sriov.h | ||
| xe_pci_types.h | ||
| xe_pcode.c | ||
| xe_pcode.h | ||
| xe_pcode_api.h | ||
| xe_platform_types.h | ||
| xe_pm.c | ||
| xe_pm.h | ||
| xe_preempt_fence.c | ||
| xe_preempt_fence.h | ||
| xe_preempt_fence_types.h | ||
| xe_pt.c | ||
| 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 | ||
| 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 | ||
| 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 | ||
| xe_sync.h | ||
| xe_sync_types.h | ||
| xe_tile.c | ||
| xe_tile.h | ||
| xe_tile_sysfs.c | ||
| xe_tile_sysfs.h | ||
| xe_tile_sysfs_types.h | ||
| xe_trace.c | ||
| xe_trace.h | ||
| 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 | ||
| xe_ttm_vram_mgr.h | ||
| xe_ttm_vram_mgr_types.h | ||
| xe_tuning.c | ||
| xe_tuning.h | ||
| xe_uc.c | ||
| xe_uc.h | ||
| xe_uc_debugfs.c | ||
| xe_uc_debugfs.h | ||
| xe_uc_fw.c | ||
| xe_uc_fw.h | ||
| xe_uc_fw_abi.h | ||
| xe_uc_fw_types.h | ||
| xe_uc_types.h | ||
| xe_vm.c | ||
| xe_vm.h | ||
| xe_vm_doc.h | ||
| xe_vm_types.h | ||
| xe_vram.c | ||
| xe_vram.h | ||
| xe_vram_freq.c | ||
| xe_vram_freq.h | ||
| xe_wa.c | ||
| xe_wa.h | ||
| xe_wa_oob.rules | ||
| xe_wait_user_fence.c | ||
| xe_wait_user_fence.h | ||
| xe_wopcm.c | ||
| xe_wopcm.h | ||
| xe_wopcm_types.h | ||