diff options
author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2025-04-03 17:26:34 +0300 |
---|---|---|
committer | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2025-04-11 13:14:30 +0300 |
commit | 387444984d7b53dbaee263887cad4ea7c8e57b34 (patch) | |
tree | 1c5d95d7bdb338b15fc6f1dc6bdc96e6b1817410 | |
parent | e15826bb3c2c5377eedc757f2adec8dcaa5255f7 (diff) | |
download | linux-387444984d7b53dbaee263887cad4ea7c8e57b34.tar.xz |
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 <michal.wajdeczko@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250403142635.1821-3-michal.wajdeczko@intel.com
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_debugfs.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c index 9a1c78b89f45..f33013f8a0f3 100644 --- a/drivers/gpu/drm/xe/xe_guc_debugfs.c +++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c @@ -103,11 +103,20 @@ static int guc_pc(struct xe_guc *guc, struct drm_printer *p) return 0; } -static const struct drm_info_list debugfs_list[] = { +/* + * only for GuC debugfs files which can be safely used on the VF as well: + * - without access to the GuC privileged registers + * - 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_ctb", .show = guc_debugfs_show, .data = guc_ctb }, +}; + +/* everything else should be added here */ +static const struct drm_info_list pf_only_debugfs_list[] = { { "guc_log", .show = guc_debugfs_show, .data = guc_log }, { "guc_log_dmesg", .show = guc_debugfs_show, .data = guc_log_dmesg }, - { "guc_ctb", .show = guc_debugfs_show, .data = guc_ctb }, { "guc_pc", .show = guc_debugfs_show, .data = guc_pc }, }; @@ -115,7 +124,12 @@ void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent) { struct drm_minor *minor = guc_to_xe(guc)->drm.primary; - drm_debugfs_create_files(debugfs_list, - ARRAY_SIZE(debugfs_list), + drm_debugfs_create_files(vf_safe_debugfs_list, + ARRAY_SIZE(vf_safe_debugfs_list), parent, minor); + + if (!IS_SRIOV_VF(guc_to_xe(guc))) + drm_debugfs_create_files(pf_only_debugfs_list, + ARRAY_SIZE(pf_only_debugfs_list), + parent, minor); } |