Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: George D Sworo <george.d.sworo@intel.com>
Subject: Re: [PATCH] drm/xe/guc: Fix CFI violation in debugfs access.
Date: Mon, 26 Jan 2026 15:24:54 -0800	[thread overview]
Message-ID: <18169bd1-e978-4862-8513-82ee9ce760e9@intel.com> (raw)
In-Reply-To: <0e4d6316-6734-4564-bfa5-6c13085c6824@intel.com>



On 1/26/2026 3:21 PM, Michal Wajdeczko wrote:
>
> On 1/27/2026 12:10 AM, 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 using a local int-returning function, like we do for the
>> other debugfs entries in the same file.
> or maybe better option would be to fix the xe_guc_print_info() signature and return int ?
> then we will be able to correctly handle this forcewake error there:
>
>          err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
>          if (err)
> -               return;
> +               return err;

That was actually what I had in my first local rev, but then I switched 
to this approach because every other entry in this file was handled that 
way. I'll switch back to returning int from xe_guc_print_info

Daniele

>
>> 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>
>> ---
>>   drivers/gpu/drm/xe/xe_guc_debugfs.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c
>> index 2f23119686d4..1a4c940ebecb 100644
>> --- a/drivers/gpu/drm/xe/xe_guc_debugfs.c
>> +++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c
>> @@ -74,6 +74,12 @@ static int guc_debugfs_show(struct seq_file *m, void *data)
>>   	return print(&gt->uc.guc, &p);
>>   }
>>   
>> +static int guc_info(struct xe_guc *guc, struct drm_printer *p)
>> +{
>> +	xe_guc_print_info(guc, p);
>> +	return 0;
>> +}
>> +
>>   static int guc_log(struct xe_guc *guc, struct drm_printer *p)
>>   {
>>   	xe_guc_log_print(&guc->log, p);
>> @@ -110,7 +116,7 @@ static int guc_pc(struct xe_guc *guc, struct drm_printer *p)
>>    * - without access to the PF specific GuC objects
>>    */
>>   static const struct drm_info_list vf_safe_debugfs_list[] = {
>> -	{ "guc_info", .show = guc_debugfs_show, .data = xe_guc_print_info },
>> +	{ "guc_info", .show = guc_debugfs_show, .data = guc_info },
>>   	{ "guc_ctb", .show = guc_debugfs_show, .data = guc_ctb },
>>   };
>>   


  reply	other threads:[~2026-01-26 23:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 23:10 [PATCH] drm/xe/guc: Fix CFI violation in debugfs access Daniele Ceraolo Spurio
2026-01-26 23:21 ` Michal Wajdeczko
2026-01-26 23:24   ` Daniele Ceraolo Spurio [this message]
2026-01-26 23:27 ` ✓ CI.KUnit: success for " Patchwork
2026-01-27  2:25 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-28  8:18 ` Patchwork
2026-01-28 14:03 ` ✓ CI.KUnit: success for drm/xe/guc: Fix CFI violation in debugfs access. (rev2) Patchwork
2026-01-28 15:00 ` ✓ Xe.CI.BAT: " Patchwork

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=18169bd1-e978-4862-8513-82ee9ce760e9@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=george.d.sworo@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /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