Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/guc: Fix CFI violation in debugfs access.

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>

authored by

Daniele Ceraolo Spurio and committed by
Rodrigo Vivi
6e035abf 3cc9398a

+5 -3
+4 -2
drivers/gpu/drm/xe/xe_guc.c
··· 1661 1661 xe_guc_submit_unpause(guc); 1662 1662 } 1663 1663 1664 - void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p) 1664 + int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p) 1665 1665 { 1666 1666 struct xe_gt *gt = guc_to_gt(guc); 1667 1667 u32 status; ··· 1672 1672 if (!IS_SRIOV_VF(gt_to_xe(gt))) { 1673 1673 CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT); 1674 1674 if (!fw_ref.domains) 1675 - return; 1675 + return -EIO; 1676 1676 1677 1677 status = xe_mmio_read32(&gt->mmio, GUC_STATUS); 1678 1678 ··· 1698 1698 1699 1699 drm_puts(p, "\n"); 1700 1700 xe_guc_submit_print(guc, p); 1701 + 1702 + return 0; 1701 1703 } 1702 1704 1703 1705 /**
+1 -1
drivers/gpu/drm/xe/xe_guc.h
··· 53 53 int xe_guc_self_cfg64(struct xe_guc *guc, u16 key, u64 val); 54 54 void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir); 55 55 void xe_guc_sanitize(struct xe_guc *guc); 56 - void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p); 56 + int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p); 57 57 int xe_guc_reset_prepare(struct xe_guc *guc); 58 58 void xe_guc_reset_wait(struct xe_guc *guc); 59 59 void xe_guc_stop_prepare(struct xe_guc *guc);