Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: George D Sworo <george.d.sworo@intel.com>
Subject: Re: [PATCH v2] drm/xe/guc: Fix CFI violation in debugfs access.
Date: Thu, 29 Jan 2026 21:46:04 +0100	[thread overview]
Message-ID: <f9ea0d01-a093-4480-a077-005ca61df82a@intel.com> (raw)
In-Reply-To: <20260129182547.32899-2-daniele.ceraolospurio@intel.com>



On 1/29/2026 7:25 PM, Daniele Ceraolo Spurio wrote:
> 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>

> ---
> v2: make xe_guc_print_info return int instead of using a local func
> ---
>  drivers/gpu/drm/xe/xe_guc.c | 6 ++++--
>  drivers/gpu/drm/xe/xe_guc.h | 2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index d2d3aa7a859a..8d7d20819eea 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -1662,7 +1662,7 @@ void xe_guc_runtime_resume(struct xe_guc *guc)
>  	xe_guc_submit_unpause(guc);
>  }
>  

nit: one day we should add kernel-doc here ...

> -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;
> @@ -1673,7 +1673,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);
>  
> @@ -1699,6 +1699,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;
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
> index a169f231cbd8..66e7edc70ed9 100644
> --- a/drivers/gpu/drm/xe/xe_guc.h
> +++ b/drivers/gpu/drm/xe/xe_guc.h
> @@ -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);


      parent reply	other threads:[~2026-01-29 20:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 18:25 [PATCH v2] drm/xe/guc: Fix CFI violation in debugfs access Daniele Ceraolo Spurio
2026-01-29 19:07 ` ✓ CI.KUnit: success for drm/xe/guc: Fix CFI violation in debugfs access. (rev3) Patchwork
2026-01-29 19:53 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-29 20:46 ` Michal Wajdeczko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9ea0d01-a093-4480-a077-005ca61df82a@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=george.d.sworo@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox