Commit d043b959 authored by Michal Wajdeczko's avatar Michal Wajdeczko
Browse files

drm/xe/vf: Reset VF GuC state on fini



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: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patch.msgid.link/20260122151924.3726-1-michal.wajdeczko@intel.com
parent 91e0c2fe
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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;

		ret = xe_guc_ct_init(&guc->ct);
		if (ret)
			goto out;