]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/guc: Fix CFI violation in debugfs access.
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 29 Jan 2026 18:25:48 +0000 (10:25 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 5 Feb 2026 13:03:25 +0000 (08:03 -0500)
xe_guc_print_info is void-returning, but the function pointer it is
assigned to expects an int-returning function, leading to the following
CFI error:

[  206.873690] CFI failure at guc_debugfs_show+0xa1/0xf0 [xe]
(target: xe_guc_print_info+0x0/0x370 [xe]; expected type: 0xbe3bc66a)

Fix this by updating xe_guc_print_info to return an integer.

Fixes: e15826bb3c2c ("drm/xe/guc: Refactor GuC debugfs initialization")
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: George D Sworo <george.d.sworo@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20260129182547.32899-2-daniele.ceraolospurio@intel.com
(cherry picked from commit dd8ea2f2ab71b98887fdc426b0651dbb1d1ea760)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc.c
drivers/gpu/drm/xe/xe_guc.h

index 44360437beeb05460838e276e591cebdc7f2db97..6df7c3f260e5bd0f1b7a34ecc84b391274482e83 100644 (file)
@@ -1661,7 +1661,7 @@ void xe_guc_runtime_resume(struct xe_guc *guc)
        xe_guc_submit_unpause(guc);
 }
 
-void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
+int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
 {
        struct xe_gt *gt = guc_to_gt(guc);
        u32 status;
@@ -1672,7 +1672,7 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
        if (!IS_SRIOV_VF(gt_to_xe(gt))) {
                CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
                if (!fw_ref.domains)
-                       return;
+                       return -EIO;
 
                status = xe_mmio_read32(&gt->mmio, GUC_STATUS);
 
@@ -1698,6 +1698,8 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
 
        drm_puts(p, "\n");
        xe_guc_submit_print(guc, p);
+
+       return 0;
 }
 
 /**
index a169f231cbd8104042c36510223a4e771914cb02..66e7edc70ed9f449e42882b19a69850bc6843367 100644 (file)
@@ -53,7 +53,7 @@ int xe_guc_self_cfg32(struct xe_guc *guc, u16 key, u32 val);
 int xe_guc_self_cfg64(struct xe_guc *guc, u16 key, u64 val);
 void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir);
 void xe_guc_sanitize(struct xe_guc *guc);
-void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p);
+int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p);
 int xe_guc_reset_prepare(struct xe_guc *guc);
 void xe_guc_reset_wait(struct xe_guc *guc);
 void xe_guc_stop_prepare(struct xe_guc *guc);