[Intel-xe] ✗ CI.checkpatch: warning for drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN (rev3)

Patchwork patchwork at emeril.freedesktop.org
Wed Jun 28 18:19:45 UTC 2023


== Series Details ==

Series: drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN (rev3)
URL   : https://patchwork.freedesktop.org/series/118799/
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
c7d32770e3cd31d9fc134ce41f329b10aa33ee15
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit a83654a6b4187e2e3a6725a63ebae75f3a806e0e
Author: Alan Previn <alan.previn.teres.alexis at intel.com>
Date:   Wed Jun 28 11:17:18 2023 -0700

    drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN
    
    In the ABI header, GUC_CTB_MSG_MIN_LEN is '1' because
    GUC_CTB_HDR_LEN is 1. This aligns with H2G/G2H CTB specification
    where all command formats are defined in units of dwords so that '1'
    is a dword. Accordingly, GUC_CTB_MSG_MAX_LEN is 256-1 (i.e. 255
    dwords). However, h2g_write was incorrectly assuming that
    GUC_CTB_MSG_MAX_LEN was in bytes. Fix this.
    
    v2: By correctly treating GUC_CTB_MSG_MAX_LEN as dwords, it causes
        a local array to consume 4x the stack size. Rework the function
        to avoid consuming stack even if the action size is large.
    
    Signed-off-by: Alan Previn <alan.previn.teres.alexis at intel.com>
+ /mt/dim checkpatch abdb420db479bae28a2abd7ba2c66229b7e8cb77 drm-intel
a83654a6b drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN
-:41: WARNING:AVOID_BUG: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants
#41: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:414:
+	XE_BUG_ON(full_len > (GUC_CTB_MSG_MAX_LEN - GUC_CTB_HDR_LEN));

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




More information about the Intel-xe mailing list