Commit cea084e8 authored by Michał Winiarski's avatar Michał Winiarski
Browse files

drm/xe/pf: Remove GuC migration data save/restore from GT debugfs



In upcoming changes, SR-IOV VF migration data will be extended beyond
GuC data and exported to userspace using VFIO interface (with a
vendor-specific variant driver) and a device-level debugfs interface.
Remove the GT-level debugfs.

Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20251112132220.516975-14-michal.winiarski@intel.com


Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
parent d608fbf4
Loading
Loading
Loading
Loading
+0 −47
Original line number Diff line number Diff line
@@ -327,9 +327,6 @@ static const struct {
	{ "stop", xe_gt_sriov_pf_control_stop_vf },
	{ "pause", xe_gt_sriov_pf_control_pause_vf },
	{ "resume", xe_gt_sriov_pf_control_resume_vf },
#ifdef CONFIG_DRM_XE_DEBUG_SRIOV
	{ "restore!", xe_gt_sriov_pf_migration_restore_guc_state },
#endif
};

static ssize_t control_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)
@@ -393,47 +390,6 @@ static const struct file_operations control_ops = {
	.llseek		= default_llseek,
};

/*
 *      /sys/kernel/debug/dri/BDF/
 *      ├── sriov
 *      :   ├── vf1
 *          :   ├── tile0
 *              :   ├── gt0
 *                  :   ├── guc_state
 */

static ssize_t guc_state_read(struct file *file, char __user *buf,
			      size_t count, loff_t *pos)
{
	struct dentry *dent = file_dentry(file);
	struct dentry *parent = dent->d_parent;
	struct xe_gt *gt = extract_gt(parent);
	unsigned int vfid = extract_vfid(parent);

	return xe_gt_sriov_pf_migration_read_guc_state(gt, vfid, buf, count, pos);
}

static ssize_t guc_state_write(struct file *file, const char __user *buf,
			       size_t count, loff_t *pos)
{
	struct dentry *dent = file_dentry(file);
	struct dentry *parent = dent->d_parent;
	struct xe_gt *gt = extract_gt(parent);
	unsigned int vfid = extract_vfid(parent);

	if (*pos)
		return -EINVAL;

	return xe_gt_sriov_pf_migration_write_guc_state(gt, vfid, buf, count);
}

static const struct file_operations guc_state_ops = {
	.owner		= THIS_MODULE,
	.read		= guc_state_read,
	.write		= guc_state_write,
	.llseek		= default_llseek,
};

/*
 *      /sys/kernel/debug/dri/BDF/
 *      ├── sriov
@@ -568,9 +524,6 @@ static void pf_populate_gt(struct xe_gt *gt, struct dentry *dent, unsigned int v

		/* for testing/debugging purposes only! */
		if (IS_ENABLED(CONFIG_DRM_XE_DEBUG)) {
			debugfs_create_file("guc_state",
					    IS_ENABLED(CONFIG_DRM_XE_DEBUG_SRIOV) ? 0600 : 0400,
					    dent, NULL, &guc_state_ops);
			debugfs_create_file("config_blob",
					    IS_ENABLED(CONFIG_DRM_XE_DEBUG_SRIOV) ? 0600 : 0400,
					    dent, NULL, &config_blob_ops);