Skip to content

Commit 3874449

Browse files
committed
drm/xe/guc: Don't expose GuC privileged debugfs files if VF
Some of the GuC debugfs files require access to the data that is not available on the VFs. Don't expose those files on the VF driver. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e15826b commit 3874449

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

drivers/gpu/drm/xe/xe_guc_debugfs.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,33 @@ static int guc_pc(struct xe_guc *guc, struct drm_printer *p)
103103
return 0;
104104
}
105105

106-
static const struct drm_info_list debugfs_list[] = {
106+
/*
107+
* only for GuC debugfs files which can be safely used on the VF as well:
108+
* - without access to the GuC privileged registers
109+
* - without access to the PF specific GuC objects
110+
*/
111+
static const struct drm_info_list vf_safe_debugfs_list[] = {
107112
{ "guc_info", .show = guc_debugfs_show, .data = xe_guc_print_info },
113+
{ "guc_ctb", .show = guc_debugfs_show, .data = guc_ctb },
114+
};
115+
116+
/* everything else should be added here */
117+
static const struct drm_info_list pf_only_debugfs_list[] = {
108118
{ "guc_log", .show = guc_debugfs_show, .data = guc_log },
109119
{ "guc_log_dmesg", .show = guc_debugfs_show, .data = guc_log_dmesg },
110-
{ "guc_ctb", .show = guc_debugfs_show, .data = guc_ctb },
111120
{ "guc_pc", .show = guc_debugfs_show, .data = guc_pc },
112121
};
113122

114123
void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent)
115124
{
116125
struct drm_minor *minor = guc_to_xe(guc)->drm.primary;
117126

118-
drm_debugfs_create_files(debugfs_list,
119-
ARRAY_SIZE(debugfs_list),
127+
drm_debugfs_create_files(vf_safe_debugfs_list,
128+
ARRAY_SIZE(vf_safe_debugfs_list),
120129
parent, minor);
130+
131+
if (!IS_SRIOV_VF(guc_to_xe(guc)))
132+
drm_debugfs_create_files(pf_only_debugfs_list,
133+
ARRAY_SIZE(pf_only_debugfs_list),
134+
parent, minor);
121135
}

0 commit comments

Comments
 (0)