Matthew Brost
75cbe49f9e
drm/xe: Fix UBSAN splat in add_preempt_fences()
add_preempt_fences() calls dma_resv_reserve_fences() with num_fences ==
0 resulting in the below UBSAN splat. Short circuit add_preempt_fences()
if num_fences == 0.
[ 58.652241] ================================================================================
[ 58.660736] UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13
[ 58.667281] shift exponent 64 is too large for 64-bit type 'long unsigned int'
[ 58.674539] CPU: 2 PID: 1170 Comm: xe_gpgpu_fill Not tainted 6.6.0-rc3-guc+ #630
[ 58.674545] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020
[ 58.674547] Call Trace:
[ 58.674548] <TASK>
[ 58.674550] dump_stack_lvl+0x92/0xb0
[ 58.674555] __ubsan_handle_shift_out_of_bounds+0x15a/0x300
[ 58.674559] ? rcu_is_watching+0x12/0x60
[ 58.674564] ? software_resume+0x141/0x210
[ 58.674575] ? new_vma+0x44b/0x600 [xe]
[ 58.674606] dma_resv_reserve_fences.cold+0x40/0x66
[ 58.674612] new_vma+0x4b3/0x600 [xe]
[ 58.674638] xe_vm_bind_ioctl+0xffd/0x1e00 [xe]
[ 58.674663] ? __pfx_xe_vm_bind_ioctl+0x10/0x10 [xe]
[ 58.674680] drm_ioctl_kernel+0xc1/0x170
[ 58.674686] ? __pfx_xe_vm_bind_ioctl+0x10/0x10 [xe]
[ 58.674703] drm_ioctl+0x247/0x4c0
[ 58.674709] ? find_held_lock+0x2b/0x80
[ 58.674716] __x64_sys_ioctl+0x8c/0xb0
[ 58.674720] do_syscall_64+0x3c/0x90
[ 58.674723] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[ 58.674727] RIP: 0033:0x7fce4bd1aaff
[ 58.674730] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
[ 58.674731] RSP: 002b:00007ffc57434050 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 58.674734] RAX: ffffffffffffffda RBX: 00007ffc574340e0 RCX: 00007fce4bd1aaff
[ 58.674736] RDX: 00007ffc574340e0 RSI: 0000000040886445 RDI: 0000000000000003
[ 58.674737] RBP: 0000000040886445 R08: 0000000000000002 R09: 00007ffc574341b0
[ 58.674739] R10: 000055de43eb3780 R11: 0000000000000246 R12: 00007ffc574340e0
[ 58.674740] R13: 0000000000000003 R14: 00007ffc574341b0 R15: 0000000000000001
[ 58.674747] </TASK>
[ 58.674748] ================================================================================
Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20231215230203.719244-1-matthew.brost@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-12-26 12:51:41 -05:00
..
2023-12-20 07:54:03 +10:00
2023-12-13 15:09:53 -05:00
2023-11-27 13:56:32 -06:00
2023-11-27 13:56:32 -06:00
2023-11-28 16:17:08 +01:00
2023-09-21 10:41:04 -07:00
2023-12-22 14:36:03 +10:00
2023-12-20 07:54:03 +10:00
2023-11-23 20:25:24 +01:00
2023-11-21 09:17:54 +01:00
2023-12-12 13:06:38 +09:00
2023-09-21 10:41:04 -07:00
2023-09-27 12:38:54 +02:00
2023-11-15 10:56:44 +01:00
2023-09-21 10:54:20 -07:00
2023-11-03 15:44:25 -10:00
2023-07-17 15:37:57 +02:00
2023-12-20 08:32:55 +10:00
2023-12-22 14:36:03 +10:00
2023-12-01 16:04:14 +01:00
2023-09-13 11:12:20 -07:00
2023-11-21 09:18:52 +01:00
2023-11-10 02:54:29 +01:00
2023-11-10 16:57:49 +01:00
2023-12-06 10:36:01 +01:00
2023-09-21 10:41:04 -07:00
2023-12-20 08:32:38 +10:00
2023-11-21 09:18:53 +01:00
2023-09-21 10:51:55 -07:00
2023-12-14 09:27:46 +02:00
2023-11-27 13:56:32 -06:00
2023-12-20 07:54:03 +10:00
2023-12-01 12:04:28 +02:00
2023-12-19 17:07:32 +10:00
2023-12-12 11:32:33 +10:00
2023-09-21 10:51:55 -07:00
2023-12-04 09:42:32 +01:00
2023-12-14 15:28:53 -05:00
2023-12-06 10:36:06 +01:00
2023-12-13 15:37:30 +01:00
2023-11-28 14:16:56 -05:00
2023-12-06 10:36:10 +01:00
2023-11-21 09:18:53 +01:00
2023-09-21 10:41:04 -07:00
2023-09-21 10:51:55 -07:00
2023-09-29 08:27:15 +10:00
2023-11-09 16:47:31 +02:00
2023-12-10 10:38:47 -08:00
2023-12-01 12:04:43 +02:00
2023-11-28 21:57:16 +02:00
2023-12-06 10:36:18 +01:00
2023-11-27 10:58:36 +01:00
2023-09-21 10:51:55 -07:00
2023-12-06 10:35:49 +01:00
2023-12-04 21:30:33 -01:00
2023-11-24 11:58:00 +01:00
2023-12-13 16:19:01 +01:00
2023-11-24 15:15:27 +01:00
2023-12-08 10:24:30 +01:00
2023-11-24 15:15:28 +01:00
2023-12-26 12:51:41 -05:00
2023-07-21 09:12:43 +02:00
2023-12-06 10:36:21 +01:00
2023-04-16 14:17:55 +02:00
2023-12-19 17:07:32 +10:00
2023-12-13 15:09:53 -05:00
2023-12-13 15:09:53 -05:00
2023-12-13 15:09:53 -05:00
2023-12-06 10:08:28 +01:00
2023-12-04 21:33:10 +02:00
2023-12-03 20:22:02 +02:00
2023-12-04 16:07:29 +02:00
2023-09-29 08:27:15 +10:00
2023-07-13 15:55:58 +02:00
2023-11-15 13:51:38 +01:00
2023-10-27 16:01:10 +02:00
2023-12-06 10:35:49 +01:00
2023-12-04 21:33:07 +02:00
2023-11-24 15:15:25 +01:00
2023-12-07 12:29:17 +02:00
2023-12-06 10:08:28 +01:00
2023-11-21 12:22:48 +02:00
2023-11-15 10:56:44 +01:00
2023-11-09 16:48:27 +02:00
2023-12-04 16:07:29 +02:00
2023-12-10 10:38:47 -08:00
2023-07-25 19:21:03 +02:00
2023-07-31 20:07:18 +02:00
2023-07-31 20:07:24 +02:00
2023-12-07 09:21:43 +02:00
2023-11-14 10:23:11 +01:00
2023-11-14 10:16:53 +01:00
2023-10-24 21:34:35 +02:00
2023-12-07 09:21:43 +02:00
2023-11-14 10:01:14 +01:00
2023-07-28 11:46:02 +02:00
2023-08-24 07:26:06 +10:00
2023-05-08 09:16:18 +02:00
2023-10-12 10:44:06 +02:00
2023-12-20 07:54:03 +10:00
2023-12-06 10:08:37 +01:00
2023-12-06 10:08:32 +01:00
2023-12-06 10:08:32 +01:00
2023-11-21 12:22:48 +02:00
2023-10-09 16:59:49 +10:00
2023-07-24 15:44:47 +02:00
2023-11-14 10:16:53 +01:00
2023-12-07 09:22:47 +02:00
2023-09-01 08:53:05 +02:00
2023-11-23 17:12:38 +01:00
2023-11-15 16:57:08 +01:00
2023-08-01 07:38:13 -07:00
2023-12-06 10:08:37 +01:00
2023-12-06 10:35:49 +01:00
2023-12-04 21:33:10 +02:00
2023-11-30 14:46:04 -05:00
2023-08-23 17:14:37 -04:00
2023-12-13 15:09:53 -05:00
2023-12-02 01:17:45 +02:00
2023-09-15 14:46:42 +03:00
2023-10-03 16:01:03 +03:00
2023-12-06 10:08:28 +01:00
2023-12-12 14:05:48 -05:00
2023-12-12 14:05:48 -05:00