On 2/23/2026 4:09 PM, Satyanarayana K V P wrote:
> When the PF is configured for admin‑only mode, it is restricted to
> management functions and should not expose a device node that would
> allow users to run workloads.

maybe instead of doing such massive changes, better option would be to
define a separate drm_driver structure with different set of ioctls?

as maybe in pf-admin-mode we may still want to use XE_DEVICE_QUERY
and/or XE_OBSERVATION or some other future ioctls for VFs monitoring

xe_device.c:

static struct drm_driver driver = {
...     .driver_features =
            DRIVER_GEM |
            DRIVER_RENDER | DRIVER_SYNCOBJ |
            DRIVER_SYNCOBJ_TIMELINE | DRIVER_GEM_GPUVA,
...
        .ioctls = xe_ioctls,
        .num_ioctls = ARRAY_SIZE(xe_ioctls),
};


static struct drm_driver driver_admin_only_pf = {
...     .driver_features = 0,
...
        .ioctls = xe_ioctls_admin_only_pf,
        .num_ioctls = ARRAY_SIZE(xe_ioctls_admin_only_pf),
};

the only problem seems to be that we have to make this choice sooner
than today we detect PF/VF mode, but OTOH the admin-only-pf flag is
only available as configfs attribute so we can just trust that flag

> 
> In this mode, no DRM device entry is created; however, sysfs and debugfs
> interfaces for the PF remain available at:
> 
> sysfs: /sys/devices/pci0000:00/<B:D:F>
> debugfs: /sys/kernel/debug/dri/<B:D:F>
> 
> Signed-off-by: Satyanarayana K V P <[email protected]>
> Cc: Michal Wajdeczko <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: Piotr Piórkowski <[email protected]>
> Cc: [email protected]
> 
> ---
> V2 -> V3:
> - Introduced new helper function xe_debugfs_create_files() to create
> debugfs entries based on admin_only_pf mode or normal mode.
> 
> V1 -> V2:
> - Rebased to latest drm-tip.
> - Update update_minor_dev() to debugfs_minor_dev().
> ---
>  drivers/gpu/drm/xe/Makefile                   |  1 +
>  drivers/gpu/drm/xe/xe_debugfs.c               | 18 +++--
>  drivers/gpu/drm/xe/xe_debugfs_helpers.c       | 78 +++++++++++++++++++
>  drivers/gpu/drm/xe/xe_debugfs_helpers.h       | 27 +++++++
>  drivers/gpu/drm/xe/xe_device.c                | 20 +++--
>  drivers/gpu/drm/xe/xe_gsc_debugfs.c           |  8 +-
>  drivers/gpu/drm/xe/xe_gt_debugfs.c            | 20 +++--
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c   |  5 +-
>  drivers/gpu/drm/xe/xe_gt_sriov_vf_debugfs.c   |  5 +-
>  drivers/gpu/drm/xe/xe_guc_debugfs.c           | 20 ++---
>  drivers/gpu/drm/xe/xe_huc_debugfs.c           |  8 +-
>  drivers/gpu/drm/xe/xe_pxp_debugfs.c           | 23 ++++--
>  drivers/gpu/drm/xe/xe_sriov.h                 |  8 ++
>  drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c      |  5 +-
>  drivers/gpu/drm/xe/xe_sriov_vf.c              |  5 +-
>  drivers/gpu/drm/xe/xe_tile_debugfs.c          | 10 +--
>  drivers/gpu/drm/xe/xe_tile_sriov_pf_debugfs.c | 14 ++--
>  17 files changed, 202 insertions(+), 73 deletions(-)
>  create mode 100644 drivers/gpu/drm/xe/xe_debugfs_helpers.c
>  create mode 100644 drivers/gpu/drm/xe/xe_debugfs_helpers.h
> 

Reply via email to