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

Patchwork patchwork at emeril.freedesktop.org
Thu Jun 22 16:29:49 UTC 2023


== Series Details ==

Series: drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN (rev2)
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 0d2d9fd98c73437f6b517aee28cc0d020c18c2fb
Author: Alan Previn <alan.previn.teres.alexis at intel.com>
Date:   Thu Jun 22 09:27:14 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 4287d7a61a8f6b40e4f99055870b1239d8439050 drm-intel
0d2d9fd98 drm/xe/guc: Fix h2g_write usage of GUC_CTB_MSG_MAX_LEN
-:42: 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
#42: FILE: drivers/gpu/drm/xe/xe_guc_ct.c:415:
+	XE_BUG_ON(len > (GUC_CTB_MSG_MAX_LEN - H2G_CT_HEADERS));

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




More information about the Intel-xe mailing list