From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/vf: Reset VF GuC state on fini
Date: Thu, 22 Jan 2026 22:49:27 +0100 [thread overview]
Message-ID: <b87e317e-5383-449f-826b-2b5ffdae860f@intel.com> (raw)
In-Reply-To: <1e91b028-af9a-4a20-b5ba-5321b5ae1e9a@intel.com>
On 1/22/2026 10:34 PM, Daniele Ceraolo Spurio wrote:
>
>
> On 1/22/2026 7:19 AM, Michal Wajdeczko wrote:
>> Unlike native/PF driver, which was explicitly triggering full GuC
>> reset during driver unwind, the VF driver was not notifying GuC that
>> it is about to unwind, and this could lead GuC to access stale data,
>> which in turn could be interpreted as VF's malicious activity.
>>
>> Add managed action to send to GuC VF_RESET message during GT unwind.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_guc.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
>> index 44360437beeb..2efc4678fa73 100644
>> --- a/drivers/gpu/drm/xe/xe_guc.c
>> +++ b/drivers/gpu/drm/xe/xe_guc.c
>> @@ -668,6 +668,13 @@ static void guc_fini_hw(void *arg)
>> guc_g2g_fini(guc);
>> }
>> +static void vf_guc_fini_hw(void *arg)
>> +{
>> + struct xe_guc *guc = arg;
>> +
>> + xe_gt_sriov_vf_reset(guc_to_gt(guc));
>> +}
>> +
>> /**
>> * xe_guc_comm_init_early - early initialization of GuC communication
>> * @guc: the &xe_guc to initialize
>> @@ -772,6 +779,10 @@ int xe_guc_init(struct xe_guc *guc)
>> xe->info.has_page_reclaim_hw_assist = false;
>> if (IS_SRIOV_VF(xe)) {
>> + ret = devm_add_action_or_reset(xe->drm.dev, vf_guc_fini_hw, guc);
>> + if (ret)
>> + goto out;
>> +
>
> it kind of feels weird to have this before the ct_init, but it doesn't really matter, so:
this is on purpose, as on the unwind this RESET action will be called _after_ any devm action that CT could register in the future
(like CONTROL_CTB=disable, which won't be accepted by the GuC if we send earlier RESET without a NEGOTIATE_ABI call)
>
> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
thanks!
>
> Daniele
>
>> ret = xe_guc_ct_init(&guc->ct);
>> if (ret)
>> goto out;
>
next prev parent reply other threads:[~2026-01-22 21:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 15:19 [PATCH] drm/xe/vf: Reset VF GuC state on fini Michal Wajdeczko
2026-01-22 15:26 ` ✓ CI.KUnit: success for " Patchwork
2026-01-22 16:00 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-22 21:34 ` [PATCH] " Daniele Ceraolo Spurio
2026-01-22 21:49 ` Michal Wajdeczko [this message]
2026-01-23 6:48 ` ✗ Xe.CI.Full: failure for " Patchwork
2026-01-23 15:06 ` Michal Wajdeczko
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=b87e317e-5383-449f-826b-2b5ffdae860f@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=daniele.ceraolospurio@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