Xe Configfs¶
Overview¶
Configfs is a filesystem-based manager of kernel objects. XE KMD registers a
configfs subsystem called xe
that creates a directory in the mounted
configfs directory. The user can create devices under this directory and
configure them as necessary. See Configfs - Userspace-driven Kernel Object Configuration for
more information about how configfs works.
Create devices¶
To create a device, the xe
module should already be loaded, but some
attributes can only be set before binding the device. It can be accomplished
by blocking the driver autoprobe:
# echo 0 > /sys/bus/pci/drivers_autoprobe # modprobe xe
In order to create a device, the user has to create a directory inside xe
:
# mkdir /sys/kernel/config/xe/0000:03:00.0/
Every device created is populated by the driver with entries that can be used to configure it:
/sys/kernel/config/xe/
├── 0000:00:02.0
│ └── ...
├── 0000:00:02.1
│ └── ...
:
└── 0000:03:00.0
├── survivability_mode
├── engines_allowed
└── enable_psmi
After configuring the attributes as per next section, the device can be probed with:
# echo 0000:03:00.0 > /sys/bus/pci/drivers/xe/bind
# # or
# echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
Configure Attributes¶
Survivability mode:¶
Enable survivability mode on supported cards. This setting only takes effect when probing the device. Example to enable it:
# echo 1 > /sys/kernel/config/xe/0000:03:00.0/survivability_mode
Allowed engines:¶
Allow only a set of engine(s) to be available, disabling the other engines even if they are available in hardware. This is applied after HW fuses are considered on each tile. Examples:
Allow only one render and one copy engines, nothing else:
# echo 'rcs0,bcs0' > /sys/kernel/config/xe/0000:03:00.0/engines_allowed
Allow only compute engines and first copy engine:
# echo 'ccs*,bcs0' > /sys/kernel/config/xe/0000:03:00.0/engines_allowed
Note that the engine names are the per-GT hardware names. On multi-tile
platforms, writing rcs0,bcs0
to this file would allow the first render
and copy engines on each tile.
The requested configuration may not be supported by the platform and driver may fail to probe. For example: if at least one copy engine is expected to be available for migrations, but it’s disabled. This is intended for debugging purposes only.
PSMI¶
Enable extra debugging capabilities to trace engine execution. Only useful during early platform enabling and requires additional hardware connected. Once it’s enabled, additionals WAs are added and runtime configuration is done via debugfs. Example to enable it:
# echo 1 > /sys/kernel/config/xe/0000:03:00.0/enable_psmi
Remove devices¶
The created device directories can be removed using rmdir
:
# rmdir /sys/kernel/config/xe/0000:03:00.0/
Internal API¶
-
void xe_configfs_check_device(struct pci_dev *pdev)¶
Test if device was configured by configfs
Parameters
struct pci_dev *pdev
the
pci_dev
device to test
Description
Try to find the configfs group that belongs to the specified pci device and print a diagnostic message if different than the default value.
-
bool xe_configfs_get_survivability_mode(struct pci_dev *pdev)¶
get configfs survivability mode attribute
Parameters
struct pci_dev *pdev
pci device
Return
survivability_mode attribute in configfs
-
void xe_configfs_clear_survivability_mode(struct pci_dev *pdev)¶
clear configfs survivability mode
Parameters
struct pci_dev *pdev
pci device
-
u64 xe_configfs_get_engines_allowed(struct pci_dev *pdev)¶
get engine allowed mask from configfs
Parameters
struct pci_dev *pdev
pci device
Return
engine mask with allowed engines set in configfs
-
bool xe_configfs_get_psmi_enabled(struct pci_dev *pdev)¶
get configfs enable_psmi setting
Parameters
struct pci_dev *pdev
pci device
Return
enable_psmi setting in configfs