On Mon, Feb 23, 2026 at 09:31:56PM +0100, Michal Wajdeczko wrote:
>
>
> 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?
Well, I did considered that option, but that wouldn't be backward
compatible for UMDs. They use the availability of the cardN to enumarate
the GPU, regardless the subset of IOCTL you might have available.
>
> 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
As of now, there's no requirement for any of these IOCTL to be present
on the PF while VF is leased. So, this option here is the most
straightforward.
Except for our usage of the drm-debugfs. Hence this patch here end up
aligning with accel on that sense.
>
> 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
Yes, ideally sooner. Ideally if we could extract that from some
early SRIOV provisioning info and pass the total num VFs = 0 to avoid
this mode. But this mode being the default if in PF.
>
> >
> > 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.
Although this patch is bigger around the debugfs, it is less intrusive
then the previous one.
I glanced all the patch and everything looks good to me, except that I
didn't carefully reviewed line by line for now yet.
Acked-by: Rodrigo Vivi <[email protected]>
> >
> > 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
> >