Skip to content

Commit 6e035ab

Browse files
dceraolorodrigovivi
authored andcommitted
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: e15826b ("drm/xe/guc: Refactor GuC debugfs initialization") Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: Michal Wajdeczko <[email protected]> Cc: George D Sworo <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Link: https://patch.msgid.link/[email protected] (cherry picked from commit dd8ea2f) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 3cc9398 commit 6e035ab

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_guc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ void xe_guc_runtime_resume(struct xe_guc *guc)
16611661
xe_guc_submit_unpause(guc);
16621662
}
16631663

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)
16651665
{
16661666
struct xe_gt *gt = guc_to_gt(guc);
16671667
u32 status;
@@ -1672,7 +1672,7 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
16721672
if (!IS_SRIOV_VF(gt_to_xe(gt))) {
16731673
CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
16741674
if (!fw_ref.domains)
1675-
return;
1675+
return -EIO;
16761676

16771677
status = xe_mmio_read32(&gt->mmio, GUC_STATUS);
16781678

@@ -1698,6 +1698,8 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
16981698

16991699
drm_puts(p, "\n");
17001700
xe_guc_submit_print(guc, p);
1701+
1702+
return 0;
17011703
}
17021704

17031705
/**

drivers/gpu/drm/xe/xe_guc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int xe_guc_self_cfg32(struct xe_guc *guc, u16 key, u32 val);
5353
int xe_guc_self_cfg64(struct xe_guc *guc, u16 key, u64 val);
5454
void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir);
5555
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);
5757
int xe_guc_reset_prepare(struct xe_guc *guc);
5858
void xe_guc_reset_wait(struct xe_guc *guc);
5959
void xe_guc_stop_prepare(struct xe_guc *guc);

0 commit comments

Comments
 (0)