✗ CI.checkpatch: warning for drm/xe/vm: Avoid reserving zero fences

Patchwork patchwork at emeril.freedesktop.org
Thu Feb 8 13:31:58 UTC 2024


== Series Details ==

Series: drm/xe/vm: Avoid reserving zero fences
URL   : https://patchwork.freedesktop.org/series/129668/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
35591fb8b4d5305b37ce31483f85ac0956eaa536
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit c03e3d1134e78460c4898d18ea682c00559cabb2
Author: Thomas Hellström <thomas.hellstrom at linux.intel.com>
Date:   Thu Feb 8 14:21:15 2024 +0100

    drm/xe/vm: Avoid reserving zero fences
    
    The function xe_vm_prepare_vma was blindly accepting zero as the
    number of fences and forwarded that to drm_exec_prepare_obj.
    
    However, that leads to an out-of-bounds shift in the
    dma_resv_reserve_fences() and while one could argue that the
    dma_resv code should be robust against that, avoid attempting
    to reserve zero fences.
    
    Relevant stack trace:
    
    [773.183188] ------------[ cut here ]------------
    [773.183199] UBSAN: shift-out-of-bounds in ../include/linux/log2.h:57:13
    [773.183241] shift exponent 64 is too large for 64-bit type 'long unsigned int'
    [773.183254] CPU: 2 PID: 1816 Comm: xe_evict Tainted: G     U             6.8.0-rc3-xe #1
    [773.183256] Hardware name: ASUS System Product Name/PRIME Z690-P D4, BIOS 2014 10/14/2022
    [773.183257] Call Trace:
    [773.183258]  <TASK>
    [773.183260]  dump_stack_lvl+0xaf/0xd0
    [773.183266]  dump_stack+0x10/0x20
    [773.183283]  ubsan_epilogue+0x9/0x40
    [773.183286]  __ubsan_handle_shift_out_of_bounds+0x10f/0x170
    [773.183293]  dma_resv_reserve_fences.cold+0x2b/0x48
    [773.183295]  ? ww_mutex_lock+0x3c/0x110
    [773.183301]  drm_exec_prepare_obj+0x45/0x60 [drm_exec]
    [773.183313]  xe_vm_prepare_vma+0x33/0x70 [xe]
    [773.183375]  xe_vma_destroy_unlocked+0x55/0xa0 [xe]
    [773.183427]  xe_vm_close_and_put+0x526/0x940 [xe]
    
    Fixes: 2714d5093620 ("drm/xe: Convert pagefaulting code to use drm_exec")
    Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
    Cc: Matthew Brost <matthew.brost at intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
    Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
+ /mt/dim checkpatch aed7e9419a8e3775ed46af4cff2de11d7e76c960 drm-intel
c03e3d113 drm/xe/vm: Avoid reserving zero fences
-:37: WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '2714d5093620', maybe rebased or not pulled?
#37: 
Fixes: 2714d5093620 ("drm/xe: Convert pagefaulting code to use drm_exec")

total: 0 errors, 1 warnings, 0 checks, 19 lines checked




More information about the Intel-xe mailing list