* [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:43 ` Rodrigo Vivi
2025-10-27 17:11 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 02/14] drm/xe/pf: Take RPM during calls to SR-IOV attr.store() Michal Wajdeczko
` (15 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
We already have some SR-IOV specific knobs exposed as debugfs
files to allow low level tuning of the SR-IOV configurations,
but those files are mainly for the use by the developers and
debugfs might not be available on the production builds.
Start building dedicated sysfs sub-tree under xe device, where
in upcoming patches we will add selected attributes that will
help provision and manage PF and all VFs:
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── pf/
├── vf1/
├── vf2/
:
└── vfN/
Add all required data types and helper macros that will be used
by upcoming patches to define actual attributes.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/Makefile | 1 +
drivers/gpu/drm/xe/xe_sriov_pf.c | 5 +
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 295 +++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h | 13 ++
drivers/gpu/drm/xe/xe_sriov_pf_types.h | 11 +
5 files changed, 325 insertions(+)
create mode 100644 drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
create mode 100644 drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 82c6b3d29676..e84811783115 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -178,6 +178,7 @@ xe-$(CONFIG_PCI_IOV) += \
xe_sriov_pf_debugfs.o \
xe_sriov_pf_provision.o \
xe_sriov_pf_service.o \
+ xe_sriov_pf_sysfs.o \
xe_tile_sriov_pf_debugfs.o
# include helpers for tests even when XE is built-in
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c
index bc1ab9ee31d9..b8af93eb5b5f 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf.c
@@ -16,6 +16,7 @@
#include "xe_sriov_pf.h"
#include "xe_sriov_pf_helpers.h"
#include "xe_sriov_pf_service.h"
+#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
static unsigned int wanted_max_vfs(struct xe_device *xe)
@@ -128,6 +129,10 @@ int xe_sriov_pf_init_late(struct xe_device *xe)
return err;
}
+ err = xe_sriov_pf_sysfs_init(xe);
+ if (err)
+ return err;
+
return 0;
}
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
new file mode 100644
index 000000000000..91962155f80b
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -0,0 +1,295 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+#include <drm/drm_managed.h>
+
+#include "xe_assert.h"
+#include "xe_sriov.h"
+#include "xe_sriov_pf_helpers.h"
+#include "xe_sriov_pf_sysfs.h"
+#include "xe_sriov_printk.h"
+
+/*
+ * /sys/bus/pci/drivers/xe/BDF/
+ * :
+ * ├── sriov_admin/
+ * ├── ...
+ * ├── pf/
+ * │ ├── ...
+ * │ └── ...
+ * ├── vf1/
+ * │ ├── ...
+ * │ └── ...
+ * ├── vf2/
+ * :
+ * └── vfN/
+ */
+
+struct xe_sriov_kobj {
+ struct kobject base;
+ struct xe_device *xe;
+ unsigned int vfid;
+};
+#define to_xe_sriov_kobj(p) container_of_const((p), struct xe_sriov_kobj, base)
+
+struct xe_sriov_dev_attr {
+ struct attribute attr;
+ ssize_t (*show)(struct xe_device *xe, char *buf);
+ ssize_t (*store)(struct xe_device *xe, const char *buf, size_t count);
+};
+#define to_xe_sriov_dev_attr(p) container_of_const((p), struct xe_sriov_dev_attr, attr)
+
+#define XE_SRIOV_DEV_ATTR(NAME) \
+struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
+ __ATTR(NAME, 0644, xe_sriov_dev_attr_##NAME##_show, xe_sriov_dev_attr_##NAME##_store)
+
+#define XE_SRIOV_DEV_ATTR_RO(NAME) \
+struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
+ __ATTR(NAME, 0444, xe_sriov_dev_attr_##NAME##_show, NULL)
+
+#define XE_SRIOV_DEV_ATTR_WO(NAME) \
+struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
+ __ATTR(NAME, 0200, NULL, xe_sriov_dev_attr_##NAME##_store)
+
+struct xe_sriov_vf_attr {
+ struct attribute attr;
+ ssize_t (*show)(struct xe_device *xe, unsigned int vfid, char *buf);
+ ssize_t (*store)(struct xe_device *xe, unsigned int vfid, const char *buf, size_t count);
+};
+#define to_xe_sriov_vf_attr(p) container_of_const((p), struct xe_sriov_vf_attr, attr)
+
+#define XE_SRIOV_VF_ATTR(NAME) \
+struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
+ __ATTR(NAME, 0644, xe_sriov_vf_attr_##NAME##_show, xe_sriov_vf_attr_##NAME##_store)
+
+#define XE_SRIOV_VF_ATTR_RO(NAME) \
+struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
+ __ATTR(NAME, 0444, xe_sriov_vf_attr_##NAME##_show, NULL)
+
+#define XE_SRIOV_VF_ATTR_WO(NAME) \
+struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
+ __ATTR(NAME, 0200, NULL, xe_sriov_vf_attr_##NAME##_store)
+
+/* device level attributes go here */
+
+static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
+ NULL
+};
+
+/* and VF-level attributes go here */
+
+static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
+ NULL
+};
+
+/* no user serviceable parts below */
+
+static struct kobject *new_xe_sriov_kobj(struct xe_device *xe, unsigned int vfid)
+{
+ struct xe_sriov_kobj *vkobj;
+
+ xe_sriov_pf_assert_vfid(xe, vfid);
+
+ vkobj = kzalloc(sizeof(*vkobj), GFP_KERNEL);
+ if (!vkobj)
+ return NULL;
+
+ vkobj->xe = xe;
+ vkobj->vfid = vfid;
+ return &vkobj->base;
+}
+
+static void release_xe_sriov_kobj(struct kobject *kobj)
+{
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+
+ kfree(vkobj);
+}
+
+static ssize_t xe_sriov_dev_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
+{
+ struct xe_sriov_dev_attr *vattr = to_xe_sriov_dev_attr(attr);
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+ struct xe_device *xe = vkobj->xe;
+
+ if (!vattr->show) {
+ xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
+ attr->name, "readable");
+ return -EPERM;
+ }
+ return vattr->show(xe, buf);
+}
+
+static ssize_t xe_sriov_dev_attr_store(struct kobject *kobj, struct attribute *attr,
+ const char *buf, size_t count)
+{
+ struct xe_sriov_dev_attr *vattr = to_xe_sriov_dev_attr(attr);
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+ struct xe_device *xe = vkobj->xe;
+
+ if (!vattr->store) {
+ xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
+ attr->name, "writable");
+ return -EPERM;
+ }
+ return vattr->store(xe, buf, count);
+}
+
+static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
+{
+ struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+ struct xe_device *xe = vkobj->xe;
+ unsigned int vfid = vkobj->vfid;
+
+ xe_sriov_pf_assert_vfid(xe, vfid);
+
+ if (!vattr->show) {
+ xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
+ attr->name, "readable");
+ return -EPERM;
+ }
+ return vattr->show(xe, vfid, buf);
+}
+
+static ssize_t xe_sriov_vf_attr_store(struct kobject *kobj, struct attribute *attr,
+ const char *buf, size_t count)
+{
+ struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+ struct xe_device *xe = vkobj->xe;
+ unsigned int vfid = vkobj->vfid;
+
+ xe_sriov_pf_assert_vfid(xe, vfid);
+
+ if (!vattr->store) {
+ xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
+ attr->name, "writable");
+ return -EPERM;
+ }
+ return vattr->store(xe, vfid, buf, count);
+}
+
+static const struct sysfs_ops xe_sriov_dev_sysfs_ops = {
+ .show = xe_sriov_dev_attr_show,
+ .store = xe_sriov_dev_attr_store,
+};
+
+static const struct sysfs_ops xe_sriov_vf_sysfs_ops = {
+ .show = xe_sriov_vf_attr_show,
+ .store = xe_sriov_vf_attr_store,
+};
+
+static const struct kobj_type xe_sriov_dev_ktype = {
+ .release = release_xe_sriov_kobj,
+ .sysfs_ops = &xe_sriov_dev_sysfs_ops,
+ .default_groups = xe_sriov_dev_attr_groups,
+};
+
+static const struct kobj_type xe_sriov_vf_ktype = {
+ .release = release_xe_sriov_kobj,
+ .sysfs_ops = &xe_sriov_vf_sysfs_ops,
+ .default_groups = xe_sriov_vf_attr_groups,
+};
+
+static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
+{
+ if (IS_ENABLED(CONFIG_DRM_XE_DEBUG))
+ xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
+ return err;
+}
+
+static void action_put_kobject(void *arg)
+{
+ struct kobject *kobj = arg;
+
+ kobject_put(kobj);
+}
+
+static int pf_setup_root(struct xe_device *xe)
+{
+ struct kobject *parent = &xe->drm.dev->kobj;
+ struct kobject *root;
+ int err;
+
+ root = new_xe_sriov_kobj(xe, PFID);
+ if (!root)
+ return pf_sysfs_error(xe, -ENOMEM, "root obj");
+
+ err = devm_add_action_or_reset(xe->drm.dev, action_put_kobject, root);
+ if (err)
+ return pf_sysfs_error(xe, err, "root action");
+
+ err = kobject_init_and_add(root, &xe_sriov_dev_ktype, parent, "sriov_admin");
+ if (err)
+ return pf_sysfs_error(xe, err, "root init");
+
+ xe_assert(xe, IS_SRIOV_PF(xe));
+ xe_assert(xe, !xe->sriov.pf.sysfs.root);
+ xe->sriov.pf.sysfs.root = root;
+ return 0;
+}
+
+static int pf_setup_tree(struct xe_device *xe)
+{
+ unsigned int totalvfs = xe_sriov_pf_get_totalvfs(xe);
+ struct kobject *root, *kobj;
+ unsigned int n;
+ int err;
+
+ xe_assert(xe, IS_SRIOV_PF(xe));
+ root = xe->sriov.pf.sysfs.root;
+
+ for (n = 0; n <= totalvfs; n++) {
+ kobj = new_xe_sriov_kobj(xe, VFID(n));
+ if (!kobj)
+ return pf_sysfs_error(xe, -ENOMEM, "tree obj");
+
+ err = devm_add_action_or_reset(xe->drm.dev, action_put_kobject, root);
+ if (err)
+ return pf_sysfs_error(xe, err, "tree action");
+
+ if (n)
+ err = kobject_init_and_add(kobj, &xe_sriov_vf_ktype,
+ root, "vf%u", n);
+ else
+ err = kobject_init_and_add(kobj, &xe_sriov_vf_ktype,
+ root, "pf");
+ if (err)
+ return pf_sysfs_error(xe, err, "tree init");
+
+ xe_assert(xe, !xe->sriov.pf.vfs[n].kobj);
+ xe->sriov.pf.vfs[n].kobj = kobj;
+ }
+
+ return 0;
+}
+
+/**
+ * xe_sriov_pf_sysfs_init() - Setup PF's SR-IOV sysfs tree.
+ * @xe: the PF &xe_device to setup sysfs
+ *
+ * This function will create additional nodes that will represent PF and VFs
+ * devices, each populated with SR-IOV Xe specific attributes.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_sysfs_init(struct xe_device *xe)
+{
+ int err;
+
+ err = pf_setup_root(xe);
+ if (err)
+ return err;
+
+ err = pf_setup_tree(xe);
+ if (err)
+ return err;
+
+ return 0;
+}
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
new file mode 100644
index 000000000000..1e6698cc29d3
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#ifndef _XE_SRIOV_PF_SYSFS_H_
+#define _XE_SRIOV_PF_SYSFS_H_
+
+struct xe_device;
+
+int xe_sriov_pf_sysfs_init(struct xe_device *xe);
+
+#endif
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_types.h b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
index c753cd59aed2..b3cd9797194b 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_types.h
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
@@ -12,10 +12,15 @@
#include "xe_sriov_pf_provision_types.h"
#include "xe_sriov_pf_service_types.h"
+struct kobject;
+
/**
* struct xe_sriov_metadata - per-VF device level metadata
*/
struct xe_sriov_metadata {
+ /** @kobj: kobject representing VF in PF's SR-IOV sysfs tree. */
+ struct kobject *kobj;
+
/** @version: negotiated VF/PF ABI version */
struct xe_sriov_pf_service_version version;
};
@@ -42,6 +47,12 @@ struct xe_device_pf {
/** @service: device level service data. */
struct xe_sriov_pf_service service;
+ /** @sysfs: device level sysfs data. */
+ struct {
+ /** @sysfs.root: the root kobject for all SR-IOV entries in sysfs. */
+ struct kobject *root;
+ } sysfs;
+
/** @vfs: metadata for all VFs. */
struct xe_sriov_metadata *vfs;
};
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
2025-10-20 18:24 ` [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes Michal Wajdeczko
@ 2025-10-24 19:43 ` Rodrigo Vivi
2025-10-27 17:11 ` Lucas De Marchi
1 sibling, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:43 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:01PM +0200, Michal Wajdeczko wrote:
> We already have some SR-IOV specific knobs exposed as debugfs
> files to allow low level tuning of the SR-IOV configurations,
> but those files are mainly for the use by the developers and
> debugfs might not be available on the production builds.
>
> Start building dedicated sysfs sub-tree under xe device, where
> in upcoming patches we will add selected attributes that will
> help provision and manage PF and all VFs:
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── pf/
> ├── vf1/
> ├── vf2/
> :
> └── vfN/
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Add all required data types and helper macros that will be used
> by upcoming patches to define actual attributes.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/Makefile | 1 +
> drivers/gpu/drm/xe/xe_sriov_pf.c | 5 +
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 295 +++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h | 13 ++
> drivers/gpu/drm/xe/xe_sriov_pf_types.h | 11 +
> 5 files changed, 325 insertions(+)
> create mode 100644 drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> create mode 100644 drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
>
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index 82c6b3d29676..e84811783115 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -178,6 +178,7 @@ xe-$(CONFIG_PCI_IOV) += \
> xe_sriov_pf_debugfs.o \
> xe_sriov_pf_provision.o \
> xe_sriov_pf_service.o \
> + xe_sriov_pf_sysfs.o \
> xe_tile_sriov_pf_debugfs.o
>
> # include helpers for tests even when XE is built-in
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c
> index bc1ab9ee31d9..b8af93eb5b5f 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c
> @@ -16,6 +16,7 @@
> #include "xe_sriov_pf.h"
> #include "xe_sriov_pf_helpers.h"
> #include "xe_sriov_pf_service.h"
> +#include "xe_sriov_pf_sysfs.h"
> #include "xe_sriov_printk.h"
>
> static unsigned int wanted_max_vfs(struct xe_device *xe)
> @@ -128,6 +129,10 @@ int xe_sriov_pf_init_late(struct xe_device *xe)
> return err;
> }
>
> + err = xe_sriov_pf_sysfs_init(xe);
> + if (err)
> + return err;
> +
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> new file mode 100644
> index 000000000000..91962155f80b
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -0,0 +1,295 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2025 Intel Corporation
> + */
> +
> +#include <linux/kobject.h>
> +#include <linux/sysfs.h>
> +
> +#include <drm/drm_managed.h>
> +
> +#include "xe_assert.h"
> +#include "xe_sriov.h"
> +#include "xe_sriov_pf_helpers.h"
> +#include "xe_sriov_pf_sysfs.h"
> +#include "xe_sriov_printk.h"
> +
> +/*
> + * /sys/bus/pci/drivers/xe/BDF/
> + * :
> + * ├── sriov_admin/
> + * ├── ...
> + * ├── pf/
> + * │ ├── ...
> + * │ └── ...
> + * ├── vf1/
> + * │ ├── ...
> + * │ └── ...
> + * ├── vf2/
> + * :
> + * └── vfN/
> + */
> +
> +struct xe_sriov_kobj {
> + struct kobject base;
> + struct xe_device *xe;
> + unsigned int vfid;
> +};
> +#define to_xe_sriov_kobj(p) container_of_const((p), struct xe_sriov_kobj, base)
> +
> +struct xe_sriov_dev_attr {
> + struct attribute attr;
> + ssize_t (*show)(struct xe_device *xe, char *buf);
> + ssize_t (*store)(struct xe_device *xe, const char *buf, size_t count);
> +};
> +#define to_xe_sriov_dev_attr(p) container_of_const((p), struct xe_sriov_dev_attr, attr)
> +
> +#define XE_SRIOV_DEV_ATTR(NAME) \
> +struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
> + __ATTR(NAME, 0644, xe_sriov_dev_attr_##NAME##_show, xe_sriov_dev_attr_##NAME##_store)
> +
> +#define XE_SRIOV_DEV_ATTR_RO(NAME) \
> +struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
> + __ATTR(NAME, 0444, xe_sriov_dev_attr_##NAME##_show, NULL)
> +
> +#define XE_SRIOV_DEV_ATTR_WO(NAME) \
> +struct xe_sriov_dev_attr xe_sriov_dev_attr_##NAME = \
> + __ATTR(NAME, 0200, NULL, xe_sriov_dev_attr_##NAME##_store)
> +
> +struct xe_sriov_vf_attr {
> + struct attribute attr;
> + ssize_t (*show)(struct xe_device *xe, unsigned int vfid, char *buf);
> + ssize_t (*store)(struct xe_device *xe, unsigned int vfid, const char *buf, size_t count);
> +};
> +#define to_xe_sriov_vf_attr(p) container_of_const((p), struct xe_sriov_vf_attr, attr)
> +
> +#define XE_SRIOV_VF_ATTR(NAME) \
> +struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
> + __ATTR(NAME, 0644, xe_sriov_vf_attr_##NAME##_show, xe_sriov_vf_attr_##NAME##_store)
> +
> +#define XE_SRIOV_VF_ATTR_RO(NAME) \
> +struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
> + __ATTR(NAME, 0444, xe_sriov_vf_attr_##NAME##_show, NULL)
> +
> +#define XE_SRIOV_VF_ATTR_WO(NAME) \
> +struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
> + __ATTR(NAME, 0200, NULL, xe_sriov_vf_attr_##NAME##_store)
> +
> +/* device level attributes go here */
> +
> +static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
> + NULL
> +};
> +
> +/* and VF-level attributes go here */
> +
> +static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
> + NULL
> +};
> +
> +/* no user serviceable parts below */
> +
> +static struct kobject *new_xe_sriov_kobj(struct xe_device *xe, unsigned int vfid)
> +{
> + struct xe_sriov_kobj *vkobj;
> +
> + xe_sriov_pf_assert_vfid(xe, vfid);
> +
> + vkobj = kzalloc(sizeof(*vkobj), GFP_KERNEL);
> + if (!vkobj)
> + return NULL;
> +
> + vkobj->xe = xe;
> + vkobj->vfid = vfid;
> + return &vkobj->base;
> +}
> +
> +static void release_xe_sriov_kobj(struct kobject *kobj)
> +{
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> +
> + kfree(vkobj);
> +}
> +
> +static ssize_t xe_sriov_dev_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
> +{
> + struct xe_sriov_dev_attr *vattr = to_xe_sriov_dev_attr(attr);
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> + struct xe_device *xe = vkobj->xe;
> +
> + if (!vattr->show) {
> + xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
> + attr->name, "readable");
> + return -EPERM;
> + }
> + return vattr->show(xe, buf);
> +}
> +
> +static ssize_t xe_sriov_dev_attr_store(struct kobject *kobj, struct attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct xe_sriov_dev_attr *vattr = to_xe_sriov_dev_attr(attr);
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> + struct xe_device *xe = vkobj->xe;
> +
> + if (!vattr->store) {
> + xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
> + attr->name, "writable");
> + return -EPERM;
> + }
> + return vattr->store(xe, buf, count);
> +}
> +
> +static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
> +{
> + struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> + struct xe_device *xe = vkobj->xe;
> + unsigned int vfid = vkobj->vfid;
> +
> + xe_sriov_pf_assert_vfid(xe, vfid);
> +
> + if (!vattr->show) {
> + xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
> + attr->name, "readable");
> + return -EPERM;
> + }
> + return vattr->show(xe, vfid, buf);
> +}
> +
> +static ssize_t xe_sriov_vf_attr_store(struct kobject *kobj, struct attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> + struct xe_device *xe = vkobj->xe;
> + unsigned int vfid = vkobj->vfid;
> +
> + xe_sriov_pf_assert_vfid(xe, vfid);
> +
> + if (!vattr->store) {
> + xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
> + attr->name, "writable");
> + return -EPERM;
> + }
> + return vattr->store(xe, vfid, buf, count);
> +}
> +
> +static const struct sysfs_ops xe_sriov_dev_sysfs_ops = {
> + .show = xe_sriov_dev_attr_show,
> + .store = xe_sriov_dev_attr_store,
> +};
> +
> +static const struct sysfs_ops xe_sriov_vf_sysfs_ops = {
> + .show = xe_sriov_vf_attr_show,
> + .store = xe_sriov_vf_attr_store,
> +};
> +
> +static const struct kobj_type xe_sriov_dev_ktype = {
> + .release = release_xe_sriov_kobj,
> + .sysfs_ops = &xe_sriov_dev_sysfs_ops,
> + .default_groups = xe_sriov_dev_attr_groups,
> +};
> +
> +static const struct kobj_type xe_sriov_vf_ktype = {
> + .release = release_xe_sriov_kobj,
> + .sysfs_ops = &xe_sriov_vf_sysfs_ops,
> + .default_groups = xe_sriov_vf_attr_groups,
> +};
> +
> +static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
> +{
> + if (IS_ENABLED(CONFIG_DRM_XE_DEBUG))
> + xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
> + return err;
> +}
> +
> +static void action_put_kobject(void *arg)
> +{
> + struct kobject *kobj = arg;
> +
> + kobject_put(kobj);
> +}
> +
> +static int pf_setup_root(struct xe_device *xe)
> +{
> + struct kobject *parent = &xe->drm.dev->kobj;
> + struct kobject *root;
> + int err;
> +
> + root = new_xe_sriov_kobj(xe, PFID);
> + if (!root)
> + return pf_sysfs_error(xe, -ENOMEM, "root obj");
> +
> + err = devm_add_action_or_reset(xe->drm.dev, action_put_kobject, root);
> + if (err)
> + return pf_sysfs_error(xe, err, "root action");
> +
> + err = kobject_init_and_add(root, &xe_sriov_dev_ktype, parent, "sriov_admin");
> + if (err)
> + return pf_sysfs_error(xe, err, "root init");
> +
> + xe_assert(xe, IS_SRIOV_PF(xe));
> + xe_assert(xe, !xe->sriov.pf.sysfs.root);
> + xe->sriov.pf.sysfs.root = root;
> + return 0;
> +}
> +
> +static int pf_setup_tree(struct xe_device *xe)
> +{
> + unsigned int totalvfs = xe_sriov_pf_get_totalvfs(xe);
> + struct kobject *root, *kobj;
> + unsigned int n;
> + int err;
> +
> + xe_assert(xe, IS_SRIOV_PF(xe));
> + root = xe->sriov.pf.sysfs.root;
> +
> + for (n = 0; n <= totalvfs; n++) {
> + kobj = new_xe_sriov_kobj(xe, VFID(n));
> + if (!kobj)
> + return pf_sysfs_error(xe, -ENOMEM, "tree obj");
> +
> + err = devm_add_action_or_reset(xe->drm.dev, action_put_kobject, root);
> + if (err)
> + return pf_sysfs_error(xe, err, "tree action");
> +
> + if (n)
> + err = kobject_init_and_add(kobj, &xe_sriov_vf_ktype,
> + root, "vf%u", n);
> + else
> + err = kobject_init_and_add(kobj, &xe_sriov_vf_ktype,
> + root, "pf");
> + if (err)
> + return pf_sysfs_error(xe, err, "tree init");
> +
> + xe_assert(xe, !xe->sriov.pf.vfs[n].kobj);
> + xe->sriov.pf.vfs[n].kobj = kobj;
> + }
> +
> + return 0;
> +}
> +
> +/**
> + * xe_sriov_pf_sysfs_init() - Setup PF's SR-IOV sysfs tree.
> + * @xe: the PF &xe_device to setup sysfs
> + *
> + * This function will create additional nodes that will represent PF and VFs
> + * devices, each populated with SR-IOV Xe specific attributes.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_sysfs_init(struct xe_device *xe)
> +{
> + int err;
> +
> + err = pf_setup_root(xe);
> + if (err)
> + return err;
> +
> + err = pf_setup_tree(xe);
> + if (err)
> + return err;
> +
> + return 0;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
> new file mode 100644
> index 000000000000..1e6698cc29d3
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2025 Intel Corporation
> + */
> +
> +#ifndef _XE_SRIOV_PF_SYSFS_H_
> +#define _XE_SRIOV_PF_SYSFS_H_
> +
> +struct xe_device;
> +
> +int xe_sriov_pf_sysfs_init(struct xe_device *xe);
> +
> +#endif
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_types.h b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> index c753cd59aed2..b3cd9797194b 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> @@ -12,10 +12,15 @@
> #include "xe_sriov_pf_provision_types.h"
> #include "xe_sriov_pf_service_types.h"
>
> +struct kobject;
> +
> /**
> * struct xe_sriov_metadata - per-VF device level metadata
> */
> struct xe_sriov_metadata {
> + /** @kobj: kobject representing VF in PF's SR-IOV sysfs tree. */
> + struct kobject *kobj;
> +
> /** @version: negotiated VF/PF ABI version */
> struct xe_sriov_pf_service_version version;
> };
> @@ -42,6 +47,12 @@ struct xe_device_pf {
> /** @service: device level service data. */
> struct xe_sriov_pf_service service;
>
> + /** @sysfs: device level sysfs data. */
> + struct {
> + /** @sysfs.root: the root kobject for all SR-IOV entries in sysfs. */
> + struct kobject *root;
> + } sysfs;
> +
> /** @vfs: metadata for all VFs. */
> struct xe_sriov_metadata *vfs;
> };
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
2025-10-20 18:24 ` [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes Michal Wajdeczko
2025-10-24 19:43 ` Rodrigo Vivi
@ 2025-10-27 17:11 ` Lucas De Marchi
2025-10-27 17:59 ` Michal Wajdeczko
1 sibling, 1 reply; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 17:11 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Rodrigo Vivi
On Mon, Oct 20, 2025 at 08:24:01PM +0200, Michal Wajdeczko wrote:
>+static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
>+{
>+ struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
>+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
>+ struct xe_device *xe = vkobj->xe;
>+ unsigned int vfid = vkobj->vfid;
>+
>+ xe_sriov_pf_assert_vfid(xe, vfid);
>+
>+ if (!vattr->show) {
nit: I don't like hiding this programmer error behind a dbg. If the perm
was set to read, the attribute was supposed to be defined with a show
method.
>+static const struct kobj_type xe_sriov_dev_ktype = {
>+ .release = release_xe_sriov_kobj,
>+ .sysfs_ops = &xe_sriov_dev_sysfs_ops,
(general comment, feel free to ignore): I wonder if we could inline the
ops definition since it was not supposed to be used outside.
>+ .default_groups = xe_sriov_dev_attr_groups,
>+};
>+
>+static const struct kobj_type xe_sriov_vf_ktype = {
>+ .release = release_xe_sriov_kobj,
>+ .sysfs_ops = &xe_sriov_vf_sysfs_ops,
>+ .default_groups = xe_sriov_vf_attr_groups,
>+};
>+
>+static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
>+{
>+ if (IS_ENABLED(CONFIG_DRM_XE_DEBUG))
>+ xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
>+ return err;
>+}
>+
>+static void action_put_kobject(void *arg)
>+{
>+ struct kobject *kobj = arg;
>+
>+ kobject_put(kobj);
>+}
>+
>+static int pf_setup_root(struct xe_device *xe)
>+{
>+ struct kobject *parent = &xe->drm.dev->kobj;
>+ struct kobject *root;
>+ int err;
>+
>+ root = new_xe_sriov_kobj(xe, PFID);
Slight preference to follow the _create() name convention in xe, so this
would be:
root = xe_sriov_kobj_create(xe, PFID);
but won't block on it.
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
thanks,
Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
2025-10-27 17:11 ` Lucas De Marchi
@ 2025-10-27 17:59 ` Michal Wajdeczko
2025-10-27 18:30 ` Lucas De Marchi
0 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-27 17:59 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: intel-xe, Rodrigo Vivi
On 10/27/2025 6:11 PM, Lucas De Marchi wrote:
> On Mon, Oct 20, 2025 at 08:24:01PM +0200, Michal Wajdeczko wrote:
>> +static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
>> +{
>> + struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
>> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
>> + struct xe_device *xe = vkobj->xe;
>> + unsigned int vfid = vkobj->vfid;
>> +
>> + xe_sriov_pf_assert_vfid(xe, vfid);
>> +
>> + if (!vattr->show) {
>
> nit: I don't like hiding this programmer error behind a dbg. If the perm
> was set to read, the attribute was supposed to be defined with a show
> method.
it is not trying to hide programmer error, it is trying to protect kernel
if bad admin will change perm of the attribute using chmod a+rw and then
will try to read this we will get NPD here
>
>> +static const struct kobj_type xe_sriov_dev_ktype = {
>> + .release = release_xe_sriov_kobj,
>> + .sysfs_ops = &xe_sriov_dev_sysfs_ops,
>
> (general comment, feel free to ignore): I wonder if we could inline the
> ops definition since it was not supposed to be used outside.
it's all static already, or I get your comment wrong?
>
>> + .default_groups = xe_sriov_dev_attr_groups,
>> +};
>> +
>> +static const struct kobj_type xe_sriov_vf_ktype = {
>> + .release = release_xe_sriov_kobj,
>> + .sysfs_ops = &xe_sriov_vf_sysfs_ops,
>> + .default_groups = xe_sriov_vf_attr_groups,
>> +};
>> +
>> +static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
>> +{
>> + if (IS_ENABLED(CONFIG_DRM_XE_DEBUG))
>> + xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
>> + return err;
>> +}
>> +
>> +static void action_put_kobject(void *arg)
>> +{
>> + struct kobject *kobj = arg;
>> +
>> + kobject_put(kobj);
>> +}
>> +
>> +static int pf_setup_root(struct xe_device *xe)
>> +{
>> + struct kobject *parent = &xe->drm.dev->kobj;
>> + struct kobject *root;
>> + int err;
>> +
>> + root = new_xe_sriov_kobj(xe, PFID);
>
> Slight preference to follow the _create() name convention in xe, so this
hmm, I just didn't want to break the other rule, that function name should
start with or match the first param name ;)
in this case it is a factory style, that takes xe, so started with a verb,
also somehow matches release_xe_sriov_kobj() that takes plain kobj
would create_xe_sriov_kobj() work for you any better?
> would be:
>
> root = xe_sriov_kobj_create(xe, PFID);
>
> but won't block on it.
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
thanks!
>
> thanks,
> Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
2025-10-27 17:59 ` Michal Wajdeczko
@ 2025-10-27 18:30 ` Lucas De Marchi
0 siblings, 0 replies; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 18:30 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Rodrigo Vivi
On Mon, Oct 27, 2025 at 06:59:21PM +0100, Michal Wajdeczko wrote:
>
>
>On 10/27/2025 6:11 PM, Lucas De Marchi wrote:
>> On Mon, Oct 20, 2025 at 08:24:01PM +0200, Michal Wajdeczko wrote:
>>> +static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
>>> +{
>>> + struct xe_sriov_vf_attr *vattr = to_xe_sriov_vf_attr(attr);
>>> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
>>> + struct xe_device *xe = vkobj->xe;
>>> + unsigned int vfid = vkobj->vfid;
>>> +
>>> + xe_sriov_pf_assert_vfid(xe, vfid);
>>> +
>>> + if (!vattr->show) {
>>
>> nit: I don't like hiding this programmer error behind a dbg. If the perm
>> was set to read, the attribute was supposed to be defined with a show
>> method.
>
>it is not trying to hide programmer error, it is trying to protect kernel
>
>if bad admin will change perm of the attribute using chmod a+rw and then
>will try to read this we will get NPD here
humn... right, I was thinking that the show would be NULL and kobj
already checks for that. But yes, with the sysfs_ops define below we
do need it.
However samples/kobject/kset-example.c uses the following style and
return code:
if (!attribute->show)
return -EIO;
return attribute->show(foo, attribute, buf);
>
>>
>>> +static const struct kobj_type xe_sriov_dev_ktype = {
>>> + .release = release_xe_sriov_kobj,
>>> + .sysfs_ops = &xe_sriov_dev_sysfs_ops,
>>
>> (general comment, feel free to ignore): I wonder if we could inline the
>> ops definition since it was not supposed to be used outside.
>
>it's all static already, or I get your comment wrong?
since it's only to be used here, I was thinking on inlining the
definition like .sysfs_ops = &(struct ...){ };
let's ignore that.
>
>>
>>> + .default_groups = xe_sriov_dev_attr_groups,
>>> +};
>>> +
>>> +static const struct kobj_type xe_sriov_vf_ktype = {
>>> + .release = release_xe_sriov_kobj,
>>> + .sysfs_ops = &xe_sriov_vf_sysfs_ops,
>>> + .default_groups = xe_sriov_vf_attr_groups,
>>> +};
>>> +
>>> +static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
>>> +{
>>> + if (IS_ENABLED(CONFIG_DRM_XE_DEBUG))
>>> + xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
>>> + return err;
>>> +}
>>> +
>>> +static void action_put_kobject(void *arg)
>>> +{
>>> + struct kobject *kobj = arg;
>>> +
>>> + kobject_put(kobj);
>>> +}
>>> +
>>> +static int pf_setup_root(struct xe_device *xe)
>>> +{
>>> + struct kobject *parent = &xe->drm.dev->kobj;
>>> + struct kobject *root;
>>> + int err;
>>> +
>>> + root = new_xe_sriov_kobj(xe, PFID);
>>
>> Slight preference to follow the _create() name convention in xe, so this
>
>hmm, I just didn't want to break the other rule, that function name should
>start with or match the first param name ;)
>
>in this case it is a factory style, that takes xe, so started with a verb,
>also somehow matches release_xe_sriov_kobj() that takes plain kobj
ok
>
>would create_xe_sriov_kobj() work for you any better?
yes
Lucas De Marchi
>
>> would be:
>>
>> root = xe_sriov_kobj_create(xe, PFID);
>>
>> but won't block on it.
>>
>> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
>thanks!
>
>>
>> thanks,
>> Lucas De Marchi
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 02/14] drm/xe/pf: Take RPM during calls to SR-IOV attr.store()
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
2025-10-20 18:24 ` [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-27 17:14 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs Michal Wajdeczko
` (14 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
We expect that all SR-IOV attr.store() handlers will require active
runtime PM reference. To simplify implementation of those handlers,
take an implicit RPM reference on their behalf. Also wait until PF
completes its restart.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index 91962155f80b..15072779be7d 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -9,7 +9,9 @@
#include <drm/drm_managed.h>
#include "xe_assert.h"
+#include "xe_pm.h"
#include "xe_sriov.h"
+#include "xe_sriov_pf.h"
#include "xe_sriov_pf_helpers.h"
#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
@@ -131,13 +133,19 @@ static ssize_t xe_sriov_dev_attr_store(struct kobject *kobj, struct attribute *a
struct xe_sriov_dev_attr *vattr = to_xe_sriov_dev_attr(attr);
struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
struct xe_device *xe = vkobj->xe;
+ ssize_t ret;
if (!vattr->store) {
xe_sriov_dbg(xe, "attribute '%s' was not intended to be %s\n",
attr->name, "writable");
return -EPERM;
}
- return vattr->store(xe, buf, count);
+
+ xe_pm_runtime_get(xe);
+ ret = xe_sriov_pf_wait_ready(xe) ?: vattr->store(xe, buf, count);
+ xe_pm_runtime_put(xe);
+
+ return ret;
}
static ssize_t xe_sriov_vf_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
@@ -164,6 +172,7 @@ static ssize_t xe_sriov_vf_attr_store(struct kobject *kobj, struct attribute *at
struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
struct xe_device *xe = vkobj->xe;
unsigned int vfid = vkobj->vfid;
+ ssize_t ret;
xe_sriov_pf_assert_vfid(xe, vfid);
@@ -172,7 +181,12 @@ static ssize_t xe_sriov_vf_attr_store(struct kobject *kobj, struct attribute *at
attr->name, "writable");
return -EPERM;
}
- return vattr->store(xe, vfid, buf, count);
+
+ xe_pm_runtime_get(xe);
+ ret = xe_sriov_pf_wait_ready(xe) ?: vattr->store(xe, vfid, buf, count);
+ xe_pm_runtime_get(xe);
+
+ return ret;
}
static const struct sysfs_ops xe_sriov_dev_sysfs_ops = {
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
2025-10-20 18:24 ` [PATCH 01/14] drm/xe/pf: Prepare sysfs for SR-IOV admin attributes Michal Wajdeczko
2025-10-20 18:24 ` [PATCH 02/14] drm/xe/pf: Take RPM during calls to SR-IOV attr.store() Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:45 ` Rodrigo Vivi
2025-10-27 17:27 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 04/14] drm/xe/pf: Relax report helper to accept PF in bulk configs Michal Wajdeczko
` (13 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
On current platforms, in SR-IOV virtualization, the GPU is shared
between VFs on the time-slice basis. The 'execution quantum' (EQ)
and 'preemption timeout' (PT) are two main scheduling parameters
that could be set individually per each VF.
Add EQ/PT read-write attributes for the PF and all VFs.
By exposing those two parameters over sysfs, the admin can change
their default values (infinity) and let the GuC scheduler enforce
that settings.
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── pf/
│ └── profile
│ ├── exec_quantum_ms [RW] unsigned integer
│ └── preempt_timeout_us [RW] unsigned integer
├── vf1/
│ └── profile
│ ├── exec_quantum_ms [RW] unsigned integer
│ └── preempt_timeout_us [RW] unsigned integer
Writing 0 to these files will set infinity EQ/PT for the VF on all
tiles/GTs. This is a default value. Writing non-zero integers to
these files will change EQ/PT to new value (in their respective
units: msec or usec).
Reading from these files will return EQ/PT as previously set on
all tiles/GTs. In case of inconsistent values detected, due to
errors or low-level configuration done using debugfs, -EUCLEAN
error will be returned.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 116 +++++++++++++++++++++
drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 8 ++
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 54 +++++++++-
3 files changed, 176 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
index 663fb0c045e9..f2e14103c9aa 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
@@ -152,3 +152,119 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
xe->sriov.pf.provision.mode = mode;
return 0;
}
+
+/**
+ * xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @eq: execution quantum in [ms] to set
+ *
+ * Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_config_set_exec_quantum(gt, vfid, eq);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
+/**
+ * xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @eq: placeholder for the returned execution quantum in [ms]
+ *
+ * Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
+ * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int count = 0;
+ u32 value;
+
+ for_each_gt(gt, xe, id) {
+ value = xe_gt_sriov_pf_config_get_exec_quantum(gt, vfid);
+ if (!count++)
+ *eq = value;
+ else if (value != *eq)
+ return -EUCLEAN;
+ }
+
+ return !count ? -ENODATA : 0;
+}
+
+/**
+ * xe_sriov_pf_provision_apply_vf_pt() - Change VF's preemption timeout.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @pt: preemption timeout in [us] to set
+ *
+ * Change VF's preemption timeout (PT) provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_config_set_preempt_timeout(gt, vfid, pt);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
+/**
+ * xe_sriov_pf_provision_query_vf_pt() - Query VF's preemption timeout.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @pt: placeholder for the returned preemption timeout in [us]
+ *
+ * Query VF's preemption timeout (PT) provisioning from all tiles/GTs.
+ * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int count = 0;
+ u32 value;
+
+ for_each_gt(gt, xe, id) {
+ value = xe_gt_sriov_pf_config_get_preempt_timeout(gt, vfid);
+ if (!count++)
+ *pt = value;
+ else if (value != *pt)
+ return -EUCLEAN;
+ }
+
+ return !count ? -ENODATA : 0;
+}
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
index cf3657a32e90..cb81b5880930 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
@@ -6,10 +6,18 @@
#ifndef _XE_SRIOV_PF_PROVISION_H_
#define _XE_SRIOV_PF_PROVISION_H_
+#include <linux/types.h>
+
#include "xe_sriov_pf_provision_types.h"
struct xe_device;
+int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq);
+int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq);
+
+int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt);
+int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt);
+
int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs);
int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs);
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index 15072779be7d..d5ad7aa7a899 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -13,6 +13,7 @@
#include "xe_sriov.h"
#include "xe_sriov_pf.h"
#include "xe_sriov_pf_helpers.h"
+#include "xe_sriov_pf_provision.h"
#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
@@ -23,10 +24,14 @@
* ├── ...
* ├── pf/
* │ ├── ...
- * │ └── ...
+ * │ └── profile
+ * │ ├── exec_quantum_ms
+ * │ └── preempt_timeout_us
* ├── vf1/
* │ ├── ...
- * │ └── ...
+ * │ └── profile
+ * │ ├── exec_quantum_ms
+ * │ └── preempt_timeout_us
* ├── vf2/
* :
* └── vfN/
@@ -85,7 +90,52 @@ static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
/* and VF-level attributes go here */
+#define DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(NAME, ITEM, TYPE, FORMAT) \
+static ssize_t xe_sriov_vf_attr_##NAME##_show(struct xe_device *xe, unsigned int vfid, \
+ char *buf) \
+{ \
+ TYPE value = 0; \
+ int err; \
+ \
+ err = xe_sriov_pf_provision_query_vf_##ITEM(xe, vfid, &value); \
+ if (err) \
+ return err; \
+ \
+ return sysfs_emit(buf, FORMAT, value); \
+} \
+ \
+static ssize_t xe_sriov_vf_attr_##NAME##_store(struct xe_device *xe, unsigned int vfid, \
+ const char *buf, size_t count) \
+{ \
+ TYPE value; \
+ int err; \
+ \
+ err = kstrto##TYPE(buf, 0, &value); \
+ if (err) \
+ return err; \
+ \
+ err = xe_sriov_pf_provision_apply_vf_##ITEM(xe, vfid, value); \
+ return err ?: count; \
+} \
+ \
+static XE_SRIOV_VF_ATTR(NAME)
+
+DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(exec_quantum_ms, eq, u32, "%u\n");
+DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(preempt_timeout_us, pt, u32, "%u\n");
+
+static struct attribute *profile_vf_attrs[] = {
+ &xe_sriov_vf_attr_exec_quantum_ms.attr,
+ &xe_sriov_vf_attr_preempt_timeout_us.attr,
+ NULL
+};
+
+static const struct attribute_group profile_vf_attr_group = {
+ .name = "profile",
+ .attrs = profile_vf_attrs,
+};
+
static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
+ &profile_vf_attr_group,
NULL
};
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
2025-10-20 18:24 ` [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs Michal Wajdeczko
@ 2025-10-24 19:45 ` Rodrigo Vivi
2025-10-27 17:27 ` Lucas De Marchi
1 sibling, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:45 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:03PM +0200, Michal Wajdeczko wrote:
> On current platforms, in SR-IOV virtualization, the GPU is shared
> between VFs on the time-slice basis. The 'execution quantum' (EQ)
> and 'preemption timeout' (PT) are two main scheduling parameters
> that could be set individually per each VF.
>
> Add EQ/PT read-write attributes for the PF and all VFs.
>
> By exposing those two parameters over sysfs, the admin can change
> their default values (infinity) and let the GuC scheduler enforce
> that settings.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── pf/
> │ └── profile
> │ ├── exec_quantum_ms [RW] unsigned integer
> │ └── preempt_timeout_us [RW] unsigned integer
> ├── vf1/
> │ └── profile
> │ ├── exec_quantum_ms [RW] unsigned integer
> │ └── preempt_timeout_us [RW] unsigned integer
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Writing 0 to these files will set infinity EQ/PT for the VF on all
> tiles/GTs. This is a default value. Writing non-zero integers to
> these files will change EQ/PT to new value (in their respective
> units: msec or usec).
>
> Reading from these files will return EQ/PT as previously set on
> all tiles/GTs. In case of inconsistent values detected, due to
> errors or low-level configuration done using debugfs, -EUCLEAN
> error will be returned.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 116 +++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 8 ++
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 54 +++++++++-
> 3 files changed, 176 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> index 663fb0c045e9..f2e14103c9aa 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> @@ -152,3 +152,119 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
> xe->sriov.pf.provision.mode = mode;
> return 0;
> }
> +
> +/**
> + * xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @eq: execution quantum in [ms] to set
> + *
> + * Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int result = 0;
> + int err;
> +
> + for_each_gt(gt, xe, id) {
> + err = xe_gt_sriov_pf_config_set_exec_quantum(gt, vfid, eq);
> + result = result ?: err;
> + }
> +
> + return result;
> +}
> +
> +/**
> + * xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @eq: placeholder for the returned execution quantum in [ms]
> + *
> + * Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
> + * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int count = 0;
> + u32 value;
> +
> + for_each_gt(gt, xe, id) {
> + value = xe_gt_sriov_pf_config_get_exec_quantum(gt, vfid);
> + if (!count++)
> + *eq = value;
> + else if (value != *eq)
> + return -EUCLEAN;
> + }
> +
> + return !count ? -ENODATA : 0;
> +}
> +
> +/**
> + * xe_sriov_pf_provision_apply_vf_pt() - Change VF's preemption timeout.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @pt: preemption timeout in [us] to set
> + *
> + * Change VF's preemption timeout (PT) provisioning on all tiles/GTs.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int result = 0;
> + int err;
> +
> + for_each_gt(gt, xe, id) {
> + err = xe_gt_sriov_pf_config_set_preempt_timeout(gt, vfid, pt);
> + result = result ?: err;
> + }
> +
> + return result;
> +}
> +
> +/**
> + * xe_sriov_pf_provision_query_vf_pt() - Query VF's preemption timeout.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @pt: placeholder for the returned preemption timeout in [us]
> + *
> + * Query VF's preemption timeout (PT) provisioning from all tiles/GTs.
> + * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int count = 0;
> + u32 value;
> +
> + for_each_gt(gt, xe, id) {
> + value = xe_gt_sriov_pf_config_get_preempt_timeout(gt, vfid);
> + if (!count++)
> + *pt = value;
> + else if (value != *pt)
> + return -EUCLEAN;
> + }
> +
> + return !count ? -ENODATA : 0;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> index cf3657a32e90..cb81b5880930 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> @@ -6,10 +6,18 @@
> #ifndef _XE_SRIOV_PF_PROVISION_H_
> #define _XE_SRIOV_PF_PROVISION_H_
>
> +#include <linux/types.h>
> +
> #include "xe_sriov_pf_provision_types.h"
>
> struct xe_device;
>
> +int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq);
> +int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq);
> +
> +int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt);
> +int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt);
> +
> int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs);
> int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs);
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index 15072779be7d..d5ad7aa7a899 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -13,6 +13,7 @@
> #include "xe_sriov.h"
> #include "xe_sriov_pf.h"
> #include "xe_sriov_pf_helpers.h"
> +#include "xe_sriov_pf_provision.h"
> #include "xe_sriov_pf_sysfs.h"
> #include "xe_sriov_printk.h"
>
> @@ -23,10 +24,14 @@
> * ├── ...
> * ├── pf/
> * │ ├── ...
> - * │ └── ...
> + * │ └── profile
> + * │ ├── exec_quantum_ms
> + * │ └── preempt_timeout_us
> * ├── vf1/
> * │ ├── ...
> - * │ └── ...
> + * │ └── profile
> + * │ ├── exec_quantum_ms
> + * │ └── preempt_timeout_us
> * ├── vf2/
> * :
> * └── vfN/
> @@ -85,7 +90,52 @@ static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
>
> /* and VF-level attributes go here */
>
> +#define DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(NAME, ITEM, TYPE, FORMAT) \
> +static ssize_t xe_sriov_vf_attr_##NAME##_show(struct xe_device *xe, unsigned int vfid, \
> + char *buf) \
> +{ \
> + TYPE value = 0; \
> + int err; \
> + \
> + err = xe_sriov_pf_provision_query_vf_##ITEM(xe, vfid, &value); \
> + if (err) \
> + return err; \
> + \
> + return sysfs_emit(buf, FORMAT, value); \
> +} \
> + \
> +static ssize_t xe_sriov_vf_attr_##NAME##_store(struct xe_device *xe, unsigned int vfid, \
> + const char *buf, size_t count) \
> +{ \
> + TYPE value; \
> + int err; \
> + \
> + err = kstrto##TYPE(buf, 0, &value); \
> + if (err) \
> + return err; \
> + \
> + err = xe_sriov_pf_provision_apply_vf_##ITEM(xe, vfid, value); \
> + return err ?: count; \
> +} \
> + \
> +static XE_SRIOV_VF_ATTR(NAME)
> +
> +DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(exec_quantum_ms, eq, u32, "%u\n");
> +DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(preempt_timeout_us, pt, u32, "%u\n");
> +
> +static struct attribute *profile_vf_attrs[] = {
> + &xe_sriov_vf_attr_exec_quantum_ms.attr,
> + &xe_sriov_vf_attr_preempt_timeout_us.attr,
> + NULL
> +};
> +
> +static const struct attribute_group profile_vf_attr_group = {
> + .name = "profile",
> + .attrs = profile_vf_attrs,
> +};
> +
> static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
> + &profile_vf_attr_group,
> NULL
> };
>
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
2025-10-20 18:24 ` [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs Michal Wajdeczko
2025-10-24 19:45 ` Rodrigo Vivi
@ 2025-10-27 17:27 ` Lucas De Marchi
2025-10-27 18:09 ` Michal Wajdeczko
1 sibling, 1 reply; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 17:27 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Rodrigo Vivi
On Mon, Oct 20, 2025 at 08:24:03PM +0200, Michal Wajdeczko wrote:
>On current platforms, in SR-IOV virtualization, the GPU is shared
>between VFs on the time-slice basis. The 'execution quantum' (EQ)
>and 'preemption timeout' (PT) are two main scheduling parameters
>that could be set individually per each VF.
>
>Add EQ/PT read-write attributes for the PF and all VFs.
>
>By exposing those two parameters over sysfs, the admin can change
>their default values (infinity) and let the GuC scheduler enforce
>that settings.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── pf/
> │ └── profile
> │ ├── exec_quantum_ms [RW] unsigned integer
> │ └── preempt_timeout_us [RW] unsigned integer
> ├── vf1/
> │ └── profile
> │ ├── exec_quantum_ms [RW] unsigned integer
> │ └── preempt_timeout_us [RW] unsigned integer
>
>Writing 0 to these files will set infinity EQ/PT for the VF on all
>tiles/GTs. This is a default value. Writing non-zero integers to
>these files will change EQ/PT to new value (in their respective
>units: msec or usec).
>
>Reading from these files will return EQ/PT as previously set on
>all tiles/GTs. In case of inconsistent values detected, due to
>errors or low-level configuration done using debugfs, -EUCLEAN
>error will be returned.
>
>Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>---
> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 116 +++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 8 ++
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 54 +++++++++-
> 3 files changed, 176 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>index 663fb0c045e9..f2e14103c9aa 100644
>--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>@@ -152,3 +152,119 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
> xe->sriov.pf.provision.mode = mode;
> return 0;
> }
>+
>+/**
>+ * xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
>+ * @xe: the PF &xe_device
>+ * @vfid: the VF identifier
>+ * @eq: execution quantum in [ms] to set
>+ *
>+ * Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
>+ *
>+ * This function can only be called on PF.
>+ *
>+ * Return: 0 on success or a negative error code on failure.
>+ */
>+int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
>+{
>+ struct xe_gt *gt;
>+ unsigned int id;
>+ int result = 0;
>+ int err;
>+
>+ for_each_gt(gt, xe, id) {
>+ err = xe_gt_sriov_pf_config_set_exec_quantum(gt, vfid, eq);
I find it weird that a race on multiple writes would basically give
undeterministic results for the device. We are locking/releaseing
xe_gt_sriov_pf_master_mutex on the gt, but shouldn't we syncronize
multiple writes at the device level?
>+ result = result ?: err;
>+ }
>+
>+ return result;
>+}
>+
>+/**
>+ * xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
>+ * @xe: the PF &xe_device
>+ * @vfid: the VF identifier
>+ * @eq: placeholder for the returned execution quantum in [ms]
>+ *
>+ * Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
>+ * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
or if you had multiple userspace components trying to set the value
creating the race above.
Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
2025-10-27 17:27 ` Lucas De Marchi
@ 2025-10-27 18:09 ` Michal Wajdeczko
2025-10-27 18:32 ` Lucas De Marchi
0 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-27 18:09 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: intel-xe, Rodrigo Vivi
On 10/27/2025 6:27 PM, Lucas De Marchi wrote:
> On Mon, Oct 20, 2025 at 08:24:03PM +0200, Michal Wajdeczko wrote:
>> On current platforms, in SR-IOV virtualization, the GPU is shared
>> between VFs on the time-slice basis. The 'execution quantum' (EQ)
>> and 'preemption timeout' (PT) are two main scheduling parameters
>> that could be set individually per each VF.
>>
>> Add EQ/PT read-write attributes for the PF and all VFs.
>>
>> By exposing those two parameters over sysfs, the admin can change
>> their default values (infinity) and let the GuC scheduler enforce
>> that settings.
>>
>> /sys/bus/pci/drivers/xe/BDF/
>> ├── sriov_admin/
>> ├── pf/
>> │ └── profile
>> │ ├── exec_quantum_ms [RW] unsigned integer
>> │ └── preempt_timeout_us [RW] unsigned integer
>> ├── vf1/
>> │ └── profile
>> │ ├── exec_quantum_ms [RW] unsigned integer
>> │ └── preempt_timeout_us [RW] unsigned integer
>>
>> Writing 0 to these files will set infinity EQ/PT for the VF on all
>> tiles/GTs. This is a default value. Writing non-zero integers to
>> these files will change EQ/PT to new value (in their respective
>> units: msec or usec).
>>
>> Reading from these files will return EQ/PT as previously set on
>> all tiles/GTs. In case of inconsistent values detected, due to
>> errors or low-level configuration done using debugfs, -EUCLEAN
>> error will be returned.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 116 +++++++++++++++++++++
>> drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 8 ++
>> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 54 +++++++++-
>> 3 files changed, 176 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>> index 663fb0c045e9..f2e14103c9aa 100644
>> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>> @@ -152,3 +152,119 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
>> xe->sriov.pf.provision.mode = mode;
>> return 0;
>> }
>> +
>> +/**
>> + * xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
>> + * @xe: the PF &xe_device
>> + * @vfid: the VF identifier
>> + * @eq: execution quantum in [ms] to set
>> + *
>> + * Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
>> + *
>> + * This function can only be called on PF.
>> + *
>> + * Return: 0 on success or a negative error code on failure.
>> + */
>> +int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
>> +{
>> + struct xe_gt *gt;
>> + unsigned int id;
>> + int result = 0;
>> + int err;
>> +
>> + for_each_gt(gt, xe, id) {
>> + err = xe_gt_sriov_pf_config_set_exec_quantum(gt, vfid, eq);
>
>
> I find it weird that a race on multiple writes would basically give
> undeterministic results for the device. We are locking/releaseing
> xe_gt_sriov_pf_master_mutex on the gt, but shouldn't we syncronize
> multiple writes at the device level?
but we still expose more granular attributes over debugfs, so even if
we would be successful in this protected round here, the actual
configuration could became "unclean" soon anyway, so I'm not sure there
is any benefit trying to add this extra protection
>
>> + result = result ?: err;
>> + }
>> +
>> + return result;
>> +}
>> +
>> +/**
>> + * xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
>> + * @xe: the PF &xe_device
>> + * @vfid: the VF identifier
>> + * @eq: placeholder for the returned execution quantum in [ms]
>> + *
>> + * Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
>> + * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
>
> or if you had multiple userspace components trying to set the value
> creating the race above.
yes, this "inconsistency" can be mostly introduced by the userspace and
concurrency / race is not only sysfs vs sysfs but also sysfs vs debugfs
>
> Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
2025-10-27 18:09 ` Michal Wajdeczko
@ 2025-10-27 18:32 ` Lucas De Marchi
0 siblings, 0 replies; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 18:32 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Rodrigo Vivi
On Mon, Oct 27, 2025 at 07:09:07PM +0100, Michal Wajdeczko wrote:
>
>
>On 10/27/2025 6:27 PM, Lucas De Marchi wrote:
>> On Mon, Oct 20, 2025 at 08:24:03PM +0200, Michal Wajdeczko wrote:
>>> On current platforms, in SR-IOV virtualization, the GPU is shared
>>> between VFs on the time-slice basis. The 'execution quantum' (EQ)
>>> and 'preemption timeout' (PT) are two main scheduling parameters
>>> that could be set individually per each VF.
>>>
>>> Add EQ/PT read-write attributes for the PF and all VFs.
>>>
>>> By exposing those two parameters over sysfs, the admin can change
>>> their default values (infinity) and let the GuC scheduler enforce
>>> that settings.
>>>
>>> /sys/bus/pci/drivers/xe/BDF/
>>> ├── sriov_admin/
>>> ├── pf/
>>> │ └── profile
>>> │ ├── exec_quantum_ms [RW] unsigned integer
>>> │ └── preempt_timeout_us [RW] unsigned integer
>>> ├── vf1/
>>> │ └── profile
>>> │ ├── exec_quantum_ms [RW] unsigned integer
>>> │ └── preempt_timeout_us [RW] unsigned integer
>>>
>>> Writing 0 to these files will set infinity EQ/PT for the VF on all
>>> tiles/GTs. This is a default value. Writing non-zero integers to
>>> these files will change EQ/PT to new value (in their respective
>>> units: msec or usec).
>>>
>>> Reading from these files will return EQ/PT as previously set on
>>> all tiles/GTs. In case of inconsistent values detected, due to
>>> errors or low-level configuration done using debugfs, -EUCLEAN
>>> error will be returned.
>>>
>>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> ---
>>> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 116 +++++++++++++++++++++
>>> drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 8 ++
>>> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 54 +++++++++-
>>> 3 files changed, 176 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>>> index 663fb0c045e9..f2e14103c9aa 100644
>>> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>>> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
>>> @@ -152,3 +152,119 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
>>> xe->sriov.pf.provision.mode = mode;
>>> return 0;
>>> }
>>> +
>>> +/**
>>> + * xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
>>> + * @xe: the PF &xe_device
>>> + * @vfid: the VF identifier
>>> + * @eq: execution quantum in [ms] to set
>>> + *
>>> + * Change VF's execution quantum (EQ) provisioning on all tiles/GTs.
>>> + *
>>> + * This function can only be called on PF.
>>> + *
>>> + * Return: 0 on success or a negative error code on failure.
>>> + */
>>> +int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq)
>>> +{
>>> + struct xe_gt *gt;
>>> + unsigned int id;
>>> + int result = 0;
>>> + int err;
>>> +
>>> + for_each_gt(gt, xe, id) {
>>> + err = xe_gt_sriov_pf_config_set_exec_quantum(gt, vfid, eq);
>>
>>
>> I find it weird that a race on multiple writes would basically give
>> undeterministic results for the device. We are locking/releaseing
>> xe_gt_sriov_pf_master_mutex on the gt, but shouldn't we syncronize
>> multiple writes at the device level?
>
>but we still expose more granular attributes over debugfs, so even if
>we would be successful in this protected round here, the actual
>configuration could became "unclean" soon anyway, so I'm not sure there
>is any benefit trying to add this extra protection
>
>>
>>> + result = result ?: err;
>>> + }
>>> +
>>> + return result;
>>> +}
>>> +
>>> +/**
>>> + * xe_sriov_pf_provision_query_vf_eq() - Query VF's execution quantum.
>>> + * @xe: the PF &xe_device
>>> + * @vfid: the VF identifier
>>> + * @eq: placeholder for the returned execution quantum in [ms]
>>> + *
>>> + * Query VF's execution quantum (EQ) provisioning from all tiles/GTs.
>>> + * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
>>
>> or if you had multiple userspace components trying to set the value
>> creating the race above.
>
>yes, this "inconsistency" can be mostly introduced by the userspace and
>concurrency / race is not only sysfs vs sysfs but also sysfs vs debugfs
right, but the point is that a normal (non-developer, production) user
shouldn't be messing with our debugfs. At that point, the only
concurrency is sysfs vs sysfs.
Lucas De Marchi
>
>>
>> Lucas De Marchi
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 04/14] drm/xe/pf: Relax report helper to accept PF in bulk configs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (2 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 03/14] drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-27 18:50 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT Michal Wajdeczko
` (12 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
Our current bulk configuration requests are only about VFs, but
we want to add new functions that will also include PF configs.
Update our bulk report helper to accept also PFID as first VFID.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
index c0c0215c0703..0a591b86d94e 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
@@ -924,7 +924,8 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
const char *what, const char *(*unit)(u32),
unsigned int last, int err)
{
- xe_gt_assert(gt, first);
+ char name[8];
+
xe_gt_assert(gt, num_vfs);
xe_gt_assert(gt, first <= last);
@@ -932,8 +933,9 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
return pf_config_set_u32_done(gt, first, value, get(gt, first), what, unit, err);
if (unlikely(err)) {
- xe_gt_sriov_notice(gt, "Failed to bulk provision VF%u..VF%u with %s\n",
- first, first + num_vfs - 1, what);
+ xe_gt_sriov_notice(gt, "Failed to bulk provision %s..VF%u with %s\n",
+ xe_sriov_function_name(first, name, sizeof(name)),
+ first + num_vfs - 1, what);
if (last > first)
pf_config_bulk_set_u32_done(gt, first, last - first, value,
get, what, unit, last, 0);
@@ -942,8 +944,9 @@ static int pf_config_bulk_set_u32_done(struct xe_gt *gt, unsigned int first, uns
/* pick actual value from first VF - bulk provisioning shall be equal across all VFs */
value = get(gt, first);
- xe_gt_sriov_info(gt, "VF%u..VF%u provisioned with %u%s %s\n",
- first, first + num_vfs - 1, value, unit(value), what);
+ xe_gt_sriov_info(gt, "%s..VF%u provisioned with %u%s %s\n",
+ xe_sriov_function_name(first, name, sizeof(name)),
+ first + num_vfs - 1, value, unit(value), what);
return 0;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (3 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 04/14] drm/xe/pf: Relax report helper to accept PF in bulk configs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-27 19:03 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 06/14] drm/xe/pf: Add functions to bulk provision EQ/PT Michal Wajdeczko
` (11 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
We already have functions to bulk configure 'hard' resources like
GGTT, LMEM or GuC context/doorbells IDs. Now add functions for the
'soft' scheduling parameters, as we will need them soon in the
upcoming patches.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 56 ++++++++++++++++++++++
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h | 2 +
2 files changed, 58 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
index 0a591b86d94e..99d5fb68174c 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
@@ -1778,6 +1778,34 @@ u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid)
return exec_quantum;
}
+/**
+ * xe_gt_sriov_pf_config_bulk_set_exec_quantum() - Configure execution quantum for PF and VFs.
+ * @gt: the &xe_gt to configure
+ * @exec_quantum: requested execution quantum in milliseconds (0 is infinity)
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_gt_sriov_pf_config_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum)
+{
+ unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
+ unsigned int n;
+ int err = 0;
+
+ mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
+ for (n = 0; n <= totalvfs; n++) {
+ err = pf_provision_exec_quantum(gt, VFID(n), exec_quantum);
+ if (err)
+ break;
+ }
+ mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
+
+ return pf_config_bulk_set_u32_done(gt, 0, 1 + totalvfs, exec_quantum,
+ xe_gt_sriov_pf_config_get_exec_quantum,
+ "execution quantum", exec_quantum_unit, n, err);
+}
+
static const char *preempt_timeout_unit(u32 preempt_timeout)
{
return preempt_timeout ? "us" : "(infinity)";
@@ -1849,6 +1877,34 @@ u32 xe_gt_sriov_pf_config_get_preempt_timeout(struct xe_gt *gt, unsigned int vfi
return preempt_timeout;
}
+/**
+ * xe_gt_sriov_pf_config_bulk_set_preempt_timeout() - Configure preemption timeout for PF and VFs.
+ * @gt: the &xe_gt to configure
+ * @preempt_timeout: requested preemption timeout in microseconds (0 is infinity)
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_gt_sriov_pf_config_bulk_set_preempt_timeout(struct xe_gt *gt, u32 preempt_timeout)
+{
+ unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
+ unsigned int n;
+ int err = 0;
+
+ mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
+ for (n = 0; n <= totalvfs; n++) {
+ err = pf_provision_preempt_timeout(gt, VFID(n), preempt_timeout);
+ if (err)
+ break;
+ }
+ mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
+
+ return pf_config_bulk_set_u32_done(gt, 0, 1 + totalvfs, preempt_timeout,
+ xe_gt_sriov_pf_config_get_preempt_timeout,
+ "preemption timeout", preempt_timeout_unit, n, err);
+}
+
static const char *sched_priority_unit(u32 priority)
{
return priority == GUC_SCHED_PRIORITY_LOW ? "(low)" :
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
index 513e6512a575..de1e31077c8e 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
@@ -39,10 +39,12 @@ int xe_gt_sriov_pf_config_bulk_set_lmem(struct xe_gt *gt, unsigned int vfid, uns
u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_config_set_exec_quantum(struct xe_gt *gt, unsigned int vfid, u32 exec_quantum);
+int xe_gt_sriov_pf_config_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum);
u32 xe_gt_sriov_pf_config_get_preempt_timeout(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_config_set_preempt_timeout(struct xe_gt *gt, unsigned int vfid,
u32 preempt_timeout);
+int xe_gt_sriov_pf_config_bulk_set_preempt_timeout(struct xe_gt *gt, u32 preempt_timeout);
u32 xe_gt_sriov_pf_config_get_sched_priority(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_config_set_sched_priority(struct xe_gt *gt, unsigned int vfid, u32 priority);
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT
2025-10-20 18:24 ` [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT Michal Wajdeczko
@ 2025-10-27 19:03 ` Lucas De Marchi
2025-10-27 20:12 ` Michal Wajdeczko
0 siblings, 1 reply; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 19:03 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
On Mon, Oct 20, 2025 at 08:24:05PM +0200, Michal Wajdeczko wrote:
>We already have functions to bulk configure 'hard' resources like
>GGTT, LMEM or GuC context/doorbells IDs. Now add functions for the
>'soft' scheduling parameters, as we will need them soon in the
>upcoming patches.
>
>Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>---
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 56 ++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h | 2 +
> 2 files changed, 58 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>index 0a591b86d94e..99d5fb68174c 100644
>--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>@@ -1778,6 +1778,34 @@ u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid)
> return exec_quantum;
> }
>
>+/**
>+ * xe_gt_sriov_pf_config_bulk_set_exec_quantum() - Configure execution quantum for PF and VFs.
>+ * @gt: the &xe_gt to configure
>+ * @exec_quantum: requested execution quantum in milliseconds (0 is infinity)
>+ *
>+ * This function can only be called on PF.
>+ *
>+ * Return: 0 on success or a negative error code on failure.
>+ */
>+int xe_gt_sriov_pf_config_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum)
>+{
>+ unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
>+ unsigned int n;
>+ int err = 0;
>+
>+ mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
>+ for (n = 0; n <= totalvfs; n++) {
>+ err = pf_provision_exec_quantum(gt, VFID(n), exec_quantum);
Given now the function accepts PFID, it's weird to pass VFID(n).
Any advantage on using that nop macro?
Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT
2025-10-27 19:03 ` Lucas De Marchi
@ 2025-10-27 20:12 ` Michal Wajdeczko
0 siblings, 0 replies; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-27 20:12 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: intel-xe
On 10/27/2025 8:03 PM, Lucas De Marchi wrote:
> On Mon, Oct 20, 2025 at 08:24:05PM +0200, Michal Wajdeczko wrote:
>> We already have functions to bulk configure 'hard' resources like
>> GGTT, LMEM or GuC context/doorbells IDs. Now add functions for the
>> 'soft' scheduling parameters, as we will need them soon in the
>> upcoming patches.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 56 ++++++++++++++++++++++
>> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h | 2 +
>> 2 files changed, 58 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> index 0a591b86d94e..99d5fb68174c 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
>> @@ -1778,6 +1778,34 @@ u32 xe_gt_sriov_pf_config_get_exec_quantum(struct xe_gt *gt, unsigned int vfid)
>> return exec_quantum;
>> }
>>
>> +/**
>> + * xe_gt_sriov_pf_config_bulk_set_exec_quantum() - Configure execution quantum for PF and VFs.
>> + * @gt: the &xe_gt to configure
>> + * @exec_quantum: requested execution quantum in milliseconds (0 is infinity)
>> + *
>> + * This function can only be called on PF.
>> + *
>> + * Return: 0 on success or a negative error code on failure.
>> + */
>> +int xe_gt_sriov_pf_config_bulk_set_exec_quantum(struct xe_gt *gt, u32 exec_quantum)
>> +{
>> + unsigned int totalvfs = xe_gt_sriov_pf_get_totalvfs(gt);
>> + unsigned int n;
>> + int err = 0;
>> +
>> + mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
>> + for (n = 0; n <= totalvfs; n++) {
>> + err = pf_provision_exec_quantum(gt, VFID(n), exec_quantum);
>
> Given now the function accepts PFID, it's weird to pass VFID(n).
PFID is still VFID(0)
> Any advantage on using that nop macro?
the function pf_provision_exec_quantum() expects "vfid" anyway
so use of the macro was supposed to be self-documenting that
we are not passing any random integer here
but I can drop this macro here if you want
>
>
> Lucas De Marchi
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 06/14] drm/xe/pf: Add functions to bulk provision EQ/PT
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (4 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 05/14] drm/xe/pf: Add functions to bulk configure EQ/PT on GT Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-27 19:18 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs Michal Wajdeczko
` (10 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
We already have functions to configure EQ/PT for single VF across
all tiles/GTs. Now add helper functions that will do that for all
VFs (and the PF) at once.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 52 ++++++++++++++++++++++
drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 2 +
2 files changed, 54 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
index f2e14103c9aa..44c52c7e241f 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
@@ -153,6 +153,32 @@ int xe_sriov_pf_provision_set_mode(struct xe_device *xe, enum xe_sriov_provision
return 0;
}
+/**
+ * xe_sriov_pf_provision_bulk_apply_eq() - Change execution quantum for all VFs and PF.
+ * @xe: the PF &xe_device
+ * @eq: execution quantum in [ms] to set
+ *
+ * Change execution quantum (EQ) provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_bulk_apply_eq(struct xe_device *xe, u32 eq)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_config_bulk_set_exec_quantum(gt, eq);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
/**
* xe_sriov_pf_provision_apply_vf_eq() - Change VF's execution quantum.
* @xe: the PF &xe_device
@@ -211,6 +237,32 @@ int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u
return !count ? -ENODATA : 0;
}
+/**
+ * xe_sriov_pf_provision_bulk_apply_pt() - Change preemption timeout for all VFs and PF.
+ * @xe: the PF &xe_device
+ * @pt: preemption timeout in [us] to set
+ *
+ * Change preemption timeout (PT) provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_bulk_apply_pt(struct xe_device *xe, u32 pt)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_config_bulk_set_preempt_timeout(gt, pt);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
/**
* xe_sriov_pf_provision_apply_vf_pt() - Change VF's preemption timeout.
* @xe: the PF &xe_device
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
index cb81b5880930..aa8a95b1c0be 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
@@ -12,9 +12,11 @@
struct xe_device;
+int xe_sriov_pf_provision_bulk_apply_eq(struct xe_device *xe, u32 eq);
int xe_sriov_pf_provision_apply_vf_eq(struct xe_device *xe, unsigned int vfid, u32 eq);
int xe_sriov_pf_provision_query_vf_eq(struct xe_device *xe, unsigned int vfid, u32 *eq);
+int xe_sriov_pf_provision_bulk_apply_pt(struct xe_device *xe, u32 pt);
int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt);
int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt);
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (5 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 06/14] drm/xe/pf: Add functions to bulk provision EQ/PT Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:46 ` Rodrigo Vivi
2025-10-27 19:28 ` Lucas De Marchi
2025-10-20 18:24 ` [PATCH 08/14] drm/xe/pf: Add functions to provision scheduling priority Michal Wajdeczko
` (9 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
It is expected to be a common practice to configure the same values
of execution quantum and preemption timeout parameters across all VFs.
Add write-only sysfs attributes that will apply required EQ/PT values
globally, without forcing admin to update PF and each VF separately.
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── .bulk_profile
│ ├── exec_quantum_ms [WO] unsigned integer
│ └── preempt_timeout_us [WO] unsigned integer
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 36 ++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index d5ad7aa7a899..5c445094e223 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -22,6 +22,9 @@
* :
* ├── sriov_admin/
* ├── ...
+ * ├── .bulk_profile
+ * │ ├── exec_quantum_ms
+ * │ └── preempt_timeout_us
* ├── pf/
* │ ├── ...
* │ └── profile
@@ -84,7 +87,40 @@ struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
/* device level attributes go here */
+#define DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(NAME, ITEM, TYPE) \
+ \
+static ssize_t xe_sriov_dev_attr_##NAME##_store(struct xe_device *xe, \
+ const char *buf, size_t count) \
+{ \
+ TYPE value; \
+ int err; \
+ \
+ err = kstrto##TYPE(buf, 0, &value); \
+ if (err) \
+ return err; \
+ \
+ err = xe_sriov_pf_provision_bulk_apply_##ITEM(xe, value); \
+ return err ?: count; \
+} \
+ \
+static XE_SRIOV_DEV_ATTR_WO(NAME)
+
+DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
+DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
+
+static struct attribute *bulk_profile_dev_attrs[] = {
+ &xe_sriov_dev_attr_exec_quantum_ms.attr,
+ &xe_sriov_dev_attr_preempt_timeout_us.attr,
+ NULL
+};
+
+static const struct attribute_group bulk_profile_dev_attr_group = {
+ .name = ".bulk_profile",
+ .attrs = bulk_profile_dev_attrs,
+};
+
static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
+ &bulk_profile_dev_attr_group,
NULL
};
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs
2025-10-20 18:24 ` [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs Michal Wajdeczko
@ 2025-10-24 19:46 ` Rodrigo Vivi
2025-10-27 19:28 ` Lucas De Marchi
1 sibling, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:46 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:07PM +0200, Michal Wajdeczko wrote:
> It is expected to be a common practice to configure the same values
> of execution quantum and preemption timeout parameters across all VFs.
>
> Add write-only sysfs attributes that will apply required EQ/PT values
> globally, without forcing admin to update PF and each VF separately.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── .bulk_profile
> │ ├── exec_quantum_ms [WO] unsigned integer
> │ └── preempt_timeout_us [WO] unsigned integer
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 36 ++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index d5ad7aa7a899..5c445094e223 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -22,6 +22,9 @@
> * :
> * ├── sriov_admin/
> * ├── ...
> + * ├── .bulk_profile
> + * │ ├── exec_quantum_ms
> + * │ └── preempt_timeout_us
> * ├── pf/
> * │ ├── ...
> * │ └── profile
> @@ -84,7 +87,40 @@ struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
>
> /* device level attributes go here */
>
> +#define DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(NAME, ITEM, TYPE) \
> + \
> +static ssize_t xe_sriov_dev_attr_##NAME##_store(struct xe_device *xe, \
> + const char *buf, size_t count) \
> +{ \
> + TYPE value; \
> + int err; \
> + \
> + err = kstrto##TYPE(buf, 0, &value); \
> + if (err) \
> + return err; \
> + \
> + err = xe_sriov_pf_provision_bulk_apply_##ITEM(xe, value); \
> + return err ?: count; \
> +} \
> + \
> +static XE_SRIOV_DEV_ATTR_WO(NAME)
> +
> +DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
> +DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
> +
> +static struct attribute *bulk_profile_dev_attrs[] = {
> + &xe_sriov_dev_attr_exec_quantum_ms.attr,
> + &xe_sriov_dev_attr_preempt_timeout_us.attr,
> + NULL
> +};
> +
> +static const struct attribute_group bulk_profile_dev_attr_group = {
> + .name = ".bulk_profile",
> + .attrs = bulk_profile_dev_attrs,
> +};
> +
> static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
> + &bulk_profile_dev_attr_group,
> NULL
> };
>
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs
2025-10-20 18:24 ` [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs Michal Wajdeczko
2025-10-24 19:46 ` Rodrigo Vivi
@ 2025-10-27 19:28 ` Lucas De Marchi
2025-10-27 20:15 ` Michal Wajdeczko
1 sibling, 1 reply; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 19:28 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Rodrigo Vivi
On Mon, Oct 20, 2025 at 08:24:07PM +0200, Michal Wajdeczko wrote:
>It is expected to be a common practice to configure the same values
>of execution quantum and preemption timeout parameters across all VFs.
>
>Add write-only sysfs attributes that will apply required EQ/PT values
>globally, without forcing admin to update PF and each VF separately.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── .bulk_profile
> │ ├── exec_quantum_ms [WO] unsigned integer
> │ └── preempt_timeout_us [WO] unsigned integer
>
>Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Are there plans for a admin-oriented Documentation/gpu/xe/xe_sriov.rst?
Besides rendering the kernel-doc, we should give an overview of setting
these attributes, provisioning, etc.
Lucas De Marchi
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 36 ++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>index d5ad7aa7a899..5c445094e223 100644
>--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>@@ -22,6 +22,9 @@
> * :
> * ├── sriov_admin/
> * ├── ...
>+ * ├── .bulk_profile
>+ * │ ├── exec_quantum_ms
>+ * │ └── preempt_timeout_us
> * ├── pf/
> * │ ├── ...
> * │ └── profile
>@@ -84,7 +87,40 @@ struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
>
> /* device level attributes go here */
>
>+#define DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(NAME, ITEM, TYPE) \
>+ \
>+static ssize_t xe_sriov_dev_attr_##NAME##_store(struct xe_device *xe, \
>+ const char *buf, size_t count) \
>+{ \
>+ TYPE value; \
>+ int err; \
>+ \
>+ err = kstrto##TYPE(buf, 0, &value); \
>+ if (err) \
>+ return err; \
>+ \
>+ err = xe_sriov_pf_provision_bulk_apply_##ITEM(xe, value); \
>+ return err ?: count; \
>+} \
>+ \
>+static XE_SRIOV_DEV_ATTR_WO(NAME)
>+
>+DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
>+DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
>+
>+static struct attribute *bulk_profile_dev_attrs[] = {
>+ &xe_sriov_dev_attr_exec_quantum_ms.attr,
>+ &xe_sriov_dev_attr_preempt_timeout_us.attr,
>+ NULL
>+};
>+
>+static const struct attribute_group bulk_profile_dev_attr_group = {
>+ .name = ".bulk_profile",
>+ .attrs = bulk_profile_dev_attrs,
>+};
>+
> static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
>+ &bulk_profile_dev_attr_group,
> NULL
> };
>
>--
>2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs
2025-10-27 19:28 ` Lucas De Marchi
@ 2025-10-27 20:15 ` Michal Wajdeczko
0 siblings, 0 replies; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-27 20:15 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: intel-xe, Rodrigo Vivi
On 10/27/2025 8:28 PM, Lucas De Marchi wrote:
> On Mon, Oct 20, 2025 at 08:24:07PM +0200, Michal Wajdeczko wrote:
>> It is expected to be a common practice to configure the same values
>> of execution quantum and preemption timeout parameters across all VFs.
>>
>> Add write-only sysfs attributes that will apply required EQ/PT values
>> globally, without forcing admin to update PF and each VF separately.
>>
>> /sys/bus/pci/drivers/xe/BDF/
>> ├── sriov_admin/
>> ├── .bulk_profile
>> │ ├── exec_quantum_ms [WO] unsigned integer
>> │ └── preempt_timeout_us [WO] unsigned integer
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Are there plans for a admin-oriented Documentation/gpu/xe/xe_sriov.rst?
> Besides rendering the kernel-doc, we should give an overview of setting
> these attributes, provisioning, etc.
some initial draft was posted 2 years ago [1], I'm still waiting for some
more official white-paper, that hopefully will include suggested values
tailored for specific use-cases
[1] https://patchwork.freedesktop.org/patch/567127/?series=126289&rev=1
>
> Lucas De Marchi
>
>
>> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 36 ++++++++++++++++++++++++++
>> 1 file changed, 36 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> index d5ad7aa7a899..5c445094e223 100644
>> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> @@ -22,6 +22,9 @@
>> * :
>> * ├── sriov_admin/
>> * ├── ...
>> + * ├── .bulk_profile
>> + * │ ├── exec_quantum_ms
>> + * │ └── preempt_timeout_us
>> * ├── pf/
>> * │ ├── ...
>> * │ └── profile
>> @@ -84,7 +87,40 @@ struct xe_sriov_vf_attr xe_sriov_vf_attr_##NAME = \
>>
>> /* device level attributes go here */
>>
>> +#define DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(NAME, ITEM, TYPE) \
>> + \
>> +static ssize_t xe_sriov_dev_attr_##NAME##_store(struct xe_device *xe, \
>> + const char *buf, size_t count) \
>> +{ \
>> + TYPE value; \
>> + int err; \
>> + \
>> + err = kstrto##TYPE(buf, 0, &value); \
>> + if (err) \
>> + return err; \
>> + \
>> + err = xe_sriov_pf_provision_bulk_apply_##ITEM(xe, value); \
>> + return err ?: count; \
>> +} \
>> + \
>> +static XE_SRIOV_DEV_ATTR_WO(NAME)
>> +
>> +DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
>> +DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
>> +
>> +static struct attribute *bulk_profile_dev_attrs[] = {
>> + &xe_sriov_dev_attr_exec_quantum_ms.attr,
>> + &xe_sriov_dev_attr_preempt_timeout_us.attr,
>> + NULL
>> +};
>> +
>> +static const struct attribute_group bulk_profile_dev_attr_group = {
>> + .name = ".bulk_profile",
>> + .attrs = bulk_profile_dev_attrs,
>> +};
>> +
>> static const struct attribute_group *xe_sriov_dev_attr_groups[] = {
>> + &bulk_profile_dev_attr_group,
>> NULL
>> };
>>
>> --
>> 2.47.1
>>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 08/14] drm/xe/pf: Add functions to provision scheduling priority
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (6 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 07/14] drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-28 11:17 ` Piotr Piórkowski
2025-10-20 18:24 ` [PATCH 09/14] drm/xe/pf: Allow bulk change all VFs priority using sysfs Michal Wajdeczko
` (8 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
We already have function to configure PF (or VF) scheduling priority
on single GT, but we also need function that will cover all tiles/GTs.
However, due to the current GuC FW limitation, we can't always rely
on per-GT function as it actually only works for the PF case. The
only way to change VFs scheduling priority is to use 'sched_if_idle'
policy KLV that will change priorities for all VFs (and the PF).
We will all these new functions in the upcoming patches.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 92 ++++++++++++++++++++++
drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 4 +
2 files changed, 96 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
index 44c52c7e241f..3a3806055616 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
@@ -320,3 +320,95 @@ int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u
return !count ? -ENODATA : 0;
}
+
+/**
+ * xe_sriov_pf_provision_bulk_apply_priority() - Change scheduling priority of all VFs and PF.
+ * @xe: the PF &xe_device
+ * @prio: scheduling priority to set
+ *
+ * Change scheduling priority provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
+{
+ bool sched_if_idle;
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ /*
+ * Currently, priority changes that involves VFs are only allowed using
+ * the 'sched_if_idle' policy KLV, so only LOW and NORMAL are supported.
+ */
+ xe_assert(xe, prio < GUC_SCHED_PRIORITY_HIGH);
+ sched_if_idle = prio == GUC_SCHED_PRIORITY_NORMAL;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_policy_set_sched_if_idle(gt, sched_if_idle);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
+/**
+ * xe_sriov_pf_provision_apply_vf_priority() - Change VF's scheduling priority.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @prio: scheduling priority to set
+ *
+ * Change VF's scheduling priority provisioning on all tiles/GTs.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_apply_vf_priority(struct xe_device *xe, unsigned int vfid, u32 prio)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int result = 0;
+ int err;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_pf_config_set_sched_priority(gt, vfid, prio);
+ result = result ?: err;
+ }
+
+ return result;
+}
+
+/**
+ * xe_sriov_pf_provision_query_vf_priority() - Query VF's scheduling priority.
+ * @xe: the PF &xe_device
+ * @vfid: the VF identifier
+ * @prio: placeholder for the returned scheduling priority
+ *
+ * Query VF's scheduling priority provisioning from all tiles/GTs.
+ * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
+ *
+ * This function can only be called on PF.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_sriov_pf_provision_query_vf_priority(struct xe_device *xe, unsigned int vfid, u32 *prio)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int count = 0;
+ u32 value;
+
+ for_each_gt(gt, xe, id) {
+ value = xe_gt_sriov_pf_config_get_sched_priority(gt, vfid);
+ if (!count++)
+ *prio = value;
+ else if (value != *prio)
+ return -EUCLEAN;
+ }
+
+ return !count ? -ENODATA : 0;
+}
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
index aa8a95b1c0be..bccf23d51396 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
@@ -20,6 +20,10 @@ int xe_sriov_pf_provision_bulk_apply_pt(struct xe_device *xe, u32 pt);
int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt);
int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt);
+int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio);
+int xe_sriov_pf_provision_apply_vf_priority(struct xe_device *xe, unsigned int vfid, u32 prio);
+int xe_sriov_pf_provision_query_vf_priority(struct xe_device *xe, unsigned int vfid, u32 *prio);
+
int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs);
int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs);
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 08/14] drm/xe/pf: Add functions to provision scheduling priority
2025-10-20 18:24 ` [PATCH 08/14] drm/xe/pf: Add functions to provision scheduling priority Michal Wajdeczko
@ 2025-10-28 11:17 ` Piotr Piórkowski
0 siblings, 0 replies; 44+ messages in thread
From: Piotr Piórkowski @ 2025-10-28 11:17 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2025-paź-20 20:24:08 +0200]:
> We already have function to configure PF (or VF) scheduling priority
> on single GT, but we also need function that will cover all tiles/GTs.
... on a single GT ....
>
> However, due to the current GuC FW limitation, we can't always rely
> on per-GT function as it actually only works for the PF case. The
> only way to change VFs scheduling priority is to use 'sched_if_idle'
> policy KLV that will change priorities for all VFs (and the PF).
>
> We will all these new functions in the upcoming patches.
We will use these new functions in the upcoming patches.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 92 ++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_pf_provision.h | 4 +
> 2 files changed, 96 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> index 44c52c7e241f..3a3806055616 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> @@ -320,3 +320,95 @@ int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u
>
> return !count ? -ENODATA : 0;
> }
> +
> +/**
> + * xe_sriov_pf_provision_bulk_apply_priority() - Change scheduling priority of all VFs and PF.
> + * @xe: the PF &xe_device
> + * @prio: scheduling priority to set
> + *
> + * Change scheduling priority provisioning on all tiles/GTs.
Change the scheduling ...
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio)
> +{
> + bool sched_if_idle;
> + struct xe_gt *gt;
> + unsigned int id;
> + int result = 0;
> + int err;
> +
> + /*
> + * Currently, priority changes that involves VFs are only allowed using
> + * the 'sched_if_idle' policy KLV, so only LOW and NORMAL are supported.
> + */
> + xe_assert(xe, prio < GUC_SCHED_PRIORITY_HIGH);
> + sched_if_idle = prio == GUC_SCHED_PRIORITY_NORMAL;
> +
> + for_each_gt(gt, xe, id) {
> + err = xe_gt_sriov_pf_policy_set_sched_if_idle(gt, sched_if_idle);
> + result = result ?: err;
> + }
> +
> + return result;
> +}
> +
> +/**
> + * xe_sriov_pf_provision_apply_vf_priority() - Change VF's scheduling priority.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @prio: scheduling priority to set
> + *
> + * Change VF's scheduling priority provisioning on all tiles/GTs.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_apply_vf_priority(struct xe_device *xe, unsigned int vfid, u32 prio)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int result = 0;
> + int err;
> +
> + for_each_gt(gt, xe, id) {
> + err = xe_gt_sriov_pf_config_set_sched_priority(gt, vfid, prio);
> + result = result ?: err;
> + }
> +
> + return result;
> +}
> +
> +/**
> + * xe_sriov_pf_provision_query_vf_priority() - Query VF's scheduling priority.
> + * @xe: the PF &xe_device
> + * @vfid: the VF identifier
> + * @prio: placeholder for the returned scheduling priority
> + *
> + * Query VF's scheduling priority provisioning from all tiles/GTs.
> + * If values across tiles/GTs are inconsistent then -EUCLEAN error will be returned.
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_sriov_pf_provision_query_vf_priority(struct xe_device *xe, unsigned int vfid, u32 *prio)
> +{
> + struct xe_gt *gt;
> + unsigned int id;
> + int count = 0;
> + u32 value;
> +
> + for_each_gt(gt, xe, id) {
> + value = xe_gt_sriov_pf_config_get_sched_priority(gt, vfid);
> + if (!count++)
> + *prio = value;
> + else if (value != *prio)
> + return -EUCLEAN;
> + }
> +
> + return !count ? -ENODATA : 0;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> index aa8a95b1c0be..bccf23d51396 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.h
> @@ -20,6 +20,10 @@ int xe_sriov_pf_provision_bulk_apply_pt(struct xe_device *xe, u32 pt);
> int xe_sriov_pf_provision_apply_vf_pt(struct xe_device *xe, unsigned int vfid, u32 pt);
> int xe_sriov_pf_provision_query_vf_pt(struct xe_device *xe, unsigned int vfid, u32 *pt);
>
> +int xe_sriov_pf_provision_bulk_apply_priority(struct xe_device *xe, u32 prio);
> +int xe_sriov_pf_provision_apply_vf_priority(struct xe_device *xe, unsigned int vfid, u32 prio);
> +int xe_sriov_pf_provision_query_vf_priority(struct xe_device *xe, unsigned int vfid, u32 *prio);
> +
> int xe_sriov_pf_provision_vfs(struct xe_device *xe, unsigned int num_vfs);
> int xe_sriov_pf_unprovision_vfs(struct xe_device *xe, unsigned int num_vfs);
Some comments in commit massage and docs, but overall it looks okay:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
>
> --
> 2.47.1
>
--
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 09/14] drm/xe/pf: Allow bulk change all VFs priority using sysfs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (7 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 08/14] drm/xe/pf: Add functions to provision scheduling priority Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:47 ` Rodrigo Vivi
2025-10-20 18:24 ` [PATCH 10/14] drm/xe/pf: Allow change PF scheduling " Michal Wajdeczko
` (7 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
It is expected to be a common practice to configure the same level
of scheduling priority across all VFs and PF (at least as starting
point). Due to current GuC FW limitations it is also the only way
to change VFs priority.
Add write-only sysfs attribute that will apply required priority
level to all VFs and PF at once.
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── .bulk_profile
│ └── sched_priority [WO] low, normal
Writing "low" to this write-only attribute will change PF and
VFs scheduling priority on all tiles/GTs to LOW (function will
be scheduled only if it has work submitted). Similarly, writing
"normal" will change functions priority to NORMAL (functions will
be scheduled irrespective of whether there is a work or not).
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 1 +
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 42 +++++++++++++++++++++-
2 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
index 3a3806055616..89b2feb43b77 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
@@ -6,6 +6,7 @@
#include "xe_assert.h"
#include "xe_device.h"
#include "xe_gt_sriov_pf_config.h"
+#include "xe_gt_sriov_pf_policy.h"
#include "xe_sriov.h"
#include "xe_sriov_pf_helpers.h"
#include "xe_sriov_pf_provision.h"
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index 5c445094e223..26ba9a2efec9 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -24,7 +24,8 @@
* ├── ...
* ├── .bulk_profile
* │ ├── exec_quantum_ms
- * │ └── preempt_timeout_us
+ * │ ├── preempt_timeout_us
+ * │ └── sched_priority
* ├── pf/
* │ ├── ...
* │ └── profile
@@ -108,9 +109,48 @@ static XE_SRIOV_DEV_ATTR_WO(NAME)
DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
+static const char * const sched_priority_names[] = {
+ [GUC_SCHED_PRIORITY_LOW] = "low",
+ [GUC_SCHED_PRIORITY_NORMAL] = "normal",
+ [GUC_SCHED_PRIORITY_HIGH] = "high",
+};
+
+static bool sched_priority_high_allowed(unsigned int vfid)
+{
+ /* As of today GuC FW allows to select 'high' priority only for the PF. */
+ return vfid == PFID;
+}
+
+static bool sched_priority_bulk_high_allowed(struct xe_device *xe)
+{
+ /* all VFs are equal - it's sufficient to check VF1 only */
+ return sched_priority_high_allowed(VFID(1));
+}
+
+static ssize_t xe_sriov_dev_attr_sched_priority_store(struct xe_device *xe,
+ const char *buf, size_t count)
+{
+ size_t num_priorities = ARRAY_SIZE(sched_priority_names);
+ int match;
+ int err;
+
+ if (!sched_priority_bulk_high_allowed(xe))
+ num_priorities--;
+
+ match = __sysfs_match_string(sched_priority_names, num_priorities, buf);
+ if (match < 0)
+ return -EINVAL;
+
+ err = xe_sriov_pf_provision_bulk_apply_priority(xe, match);
+ return err ?: count;
+}
+
+static XE_SRIOV_DEV_ATTR_WO(sched_priority);
+
static struct attribute *bulk_profile_dev_attrs[] = {
&xe_sriov_dev_attr_exec_quantum_ms.attr,
&xe_sriov_dev_attr_preempt_timeout_us.attr,
+ &xe_sriov_dev_attr_sched_priority.attr,
NULL
};
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 09/14] drm/xe/pf: Allow bulk change all VFs priority using sysfs
2025-10-20 18:24 ` [PATCH 09/14] drm/xe/pf: Allow bulk change all VFs priority using sysfs Michal Wajdeczko
@ 2025-10-24 19:47 ` Rodrigo Vivi
0 siblings, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:47 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:09PM +0200, Michal Wajdeczko wrote:
> It is expected to be a common practice to configure the same level
> of scheduling priority across all VFs and PF (at least as starting
> point). Due to current GuC FW limitations it is also the only way
> to change VFs priority.
>
> Add write-only sysfs attribute that will apply required priority
> level to all VFs and PF at once.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── .bulk_profile
> │ └── sched_priority [WO] low, normal
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Writing "low" to this write-only attribute will change PF and
> VFs scheduling priority on all tiles/GTs to LOW (function will
> be scheduled only if it has work submitted). Similarly, writing
> "normal" will change functions priority to NORMAL (functions will
> be scheduled irrespective of whether there is a work or not).
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_provision.c | 1 +
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 42 +++++++++++++++++++++-
> 2 files changed, 42 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> index 3a3806055616..89b2feb43b77 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_provision.c
> @@ -6,6 +6,7 @@
> #include "xe_assert.h"
> #include "xe_device.h"
> #include "xe_gt_sriov_pf_config.h"
> +#include "xe_gt_sriov_pf_policy.h"
> #include "xe_sriov.h"
> #include "xe_sriov_pf_helpers.h"
> #include "xe_sriov_pf_provision.h"
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index 5c445094e223..26ba9a2efec9 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -24,7 +24,8 @@
> * ├── ...
> * ├── .bulk_profile
> * │ ├── exec_quantum_ms
> - * │ └── preempt_timeout_us
> + * │ ├── preempt_timeout_us
> + * │ └── sched_priority
> * ├── pf/
> * │ ├── ...
> * │ └── profile
> @@ -108,9 +109,48 @@ static XE_SRIOV_DEV_ATTR_WO(NAME)
> DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(exec_quantum_ms, eq, u32);
> DEFINE_SIMPLE_BULK_PROVISIONING_SRIOV_DEV_ATTR_WO(preempt_timeout_us, pt, u32);
>
> +static const char * const sched_priority_names[] = {
> + [GUC_SCHED_PRIORITY_LOW] = "low",
> + [GUC_SCHED_PRIORITY_NORMAL] = "normal",
> + [GUC_SCHED_PRIORITY_HIGH] = "high",
> +};
> +
> +static bool sched_priority_high_allowed(unsigned int vfid)
> +{
> + /* As of today GuC FW allows to select 'high' priority only for the PF. */
> + return vfid == PFID;
> +}
> +
> +static bool sched_priority_bulk_high_allowed(struct xe_device *xe)
> +{
> + /* all VFs are equal - it's sufficient to check VF1 only */
> + return sched_priority_high_allowed(VFID(1));
> +}
> +
> +static ssize_t xe_sriov_dev_attr_sched_priority_store(struct xe_device *xe,
> + const char *buf, size_t count)
> +{
> + size_t num_priorities = ARRAY_SIZE(sched_priority_names);
> + int match;
> + int err;
> +
> + if (!sched_priority_bulk_high_allowed(xe))
> + num_priorities--;
> +
> + match = __sysfs_match_string(sched_priority_names, num_priorities, buf);
> + if (match < 0)
> + return -EINVAL;
> +
> + err = xe_sriov_pf_provision_bulk_apply_priority(xe, match);
> + return err ?: count;
> +}
> +
> +static XE_SRIOV_DEV_ATTR_WO(sched_priority);
> +
> static struct attribute *bulk_profile_dev_attrs[] = {
> &xe_sriov_dev_attr_exec_quantum_ms.attr,
> &xe_sriov_dev_attr_preempt_timeout_us.attr,
> + &xe_sriov_dev_attr_sched_priority.attr,
> NULL
> };
>
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 10/14] drm/xe/pf: Allow change PF scheduling priority using sysfs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (8 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 09/14] drm/xe/pf: Allow bulk change all VFs priority using sysfs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:47 ` Rodrigo Vivi
2025-10-20 18:24 ` [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev Michal Wajdeczko
` (6 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
We have just added bulk change of the scheduling priority for all
VFs and PF, but that only allow to select LOW and NORMAL priority.
Add read-write attribute under PF to allow changing its priority
without impacting other VFs priority settings.
For completeness also add read-only attributes under VFs, to show
currently selected priority levels used by the VFs.
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── pf/
│ └── profile
│ └── sched_priority [RW] low, normal, high
├── vf1/
│ └── profile
│ └── sched_priority [RO] low, normal
Writing "high" to the PF read-write attribute will change PF
priority on all tiles/GTs to HIGH (schedule function in the next
time-slice after current one completes and it has work). Writing
"low" or "normal" to change priority to LOW/NORMAL is supported.
When read, those files will display the current and available
scheduling priorities. The currently active priority level will
be enclosed in square brackets, default output will be like:
$ grep . -h sriov_admin/{pf,vf1,vf2}/profile/sched_priority
[low] normal high
[low] normal
[low] normal
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 82 +++++++++++++++++++++++++-
1 file changed, 80 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index 26ba9a2efec9..a6be3c88fa4f 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -17,6 +17,21 @@
#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
+static int emit_choice(char *buf, int choice, const char * const *array, size_t size)
+{
+ int pos = 0;
+ int n;
+
+ for (n = 0; n < size; n++) {
+ pos += sysfs_emit_at(buf, pos, "%s%s%s%s",
+ n ? " " : "",
+ n == choice ? "[" : "",
+ array[n],
+ n == choice ? "]" : "");
+ }
+ return pos + sysfs_emit_at(buf, pos, "\n");
+}
+
/*
* /sys/bus/pci/drivers/xe/BDF/
* :
@@ -30,12 +45,14 @@
* │ ├── ...
* │ └── profile
* │ ├── exec_quantum_ms
- * │ └── preempt_timeout_us
+ * │ ├── preempt_timeout_us
+ * │ └── sched_priority
* ├── vf1/
* │ ├── ...
* │ └── profile
* │ ├── exec_quantum_ms
- * │ └── preempt_timeout_us
+ * │ ├── preempt_timeout_us
+ * │ └── sched_priority
* ├── vf2/
* :
* └── vfN/
@@ -115,6 +132,12 @@ static const char * const sched_priority_names[] = {
[GUC_SCHED_PRIORITY_HIGH] = "high",
};
+static bool sched_priority_change_allowed(unsigned int vfid)
+{
+ /* As of today GuC FW allows to selectively change only the PF priority. */
+ return vfid == PFID;
+}
+
static bool sched_priority_high_allowed(unsigned int vfid)
{
/* As of today GuC FW allows to select 'high' priority only for the PF. */
@@ -199,15 +222,70 @@ static XE_SRIOV_VF_ATTR(NAME)
DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(exec_quantum_ms, eq, u32, "%u\n");
DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(preempt_timeout_us, pt, u32, "%u\n");
+static ssize_t xe_sriov_vf_attr_sched_priority_show(struct xe_device *xe, unsigned int vfid,
+ char *buf)
+{
+ size_t num_priorities = ARRAY_SIZE(sched_priority_names);
+ u32 priority;
+ int err;
+
+ err = xe_sriov_pf_provision_query_vf_priority(xe, vfid, &priority);
+ if (err)
+ return err;
+
+ if (!sched_priority_high_allowed(vfid))
+ num_priorities--;
+
+ xe_assert(xe, priority < num_priorities);
+ return emit_choice(buf, priority, sched_priority_names, num_priorities);
+}
+
+static ssize_t xe_sriov_vf_attr_sched_priority_store(struct xe_device *xe, unsigned int vfid,
+ const char *buf, size_t count)
+{
+ size_t num_priorities = ARRAY_SIZE(sched_priority_names);
+ int match;
+ int err;
+
+ if (!sched_priority_change_allowed(vfid))
+ return -EOPNOTSUPP;
+
+ if (!sched_priority_high_allowed(vfid))
+ num_priorities--;
+
+ match = __sysfs_match_string(sched_priority_names, num_priorities, buf);
+ if (match < 0)
+ return -EINVAL;
+
+ err = xe_sriov_pf_provision_apply_vf_priority(xe, vfid, match);
+ return err ?: count;
+}
+
+static XE_SRIOV_VF_ATTR(sched_priority);
+
static struct attribute *profile_vf_attrs[] = {
&xe_sriov_vf_attr_exec_quantum_ms.attr,
&xe_sriov_vf_attr_preempt_timeout_us.attr,
+ &xe_sriov_vf_attr_sched_priority.attr,
NULL
};
+static umode_t profile_vf_attr_is_visible(struct kobject *kobj,
+ struct attribute *attr, int index)
+{
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+
+ if (attr == &xe_sriov_vf_attr_sched_priority.attr &&
+ !sched_priority_change_allowed(vkobj->vfid))
+ return attr->mode & 0444;
+
+ return attr->mode;
+}
+
static const struct attribute_group profile_vf_attr_group = {
.name = "profile",
.attrs = profile_vf_attrs,
+ .is_visible = profile_vf_attr_is_visible,
};
static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 10/14] drm/xe/pf: Allow change PF scheduling priority using sysfs
2025-10-20 18:24 ` [PATCH 10/14] drm/xe/pf: Allow change PF scheduling " Michal Wajdeczko
@ 2025-10-24 19:47 ` Rodrigo Vivi
0 siblings, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:47 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:10PM +0200, Michal Wajdeczko wrote:
> We have just added bulk change of the scheduling priority for all
> VFs and PF, but that only allow to select LOW and NORMAL priority.
>
> Add read-write attribute under PF to allow changing its priority
> without impacting other VFs priority settings.
>
> For completeness also add read-only attributes under VFs, to show
> currently selected priority levels used by the VFs.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── pf/
> │ └── profile
> │ └── sched_priority [RW] low, normal, high
> ├── vf1/
> │ └── profile
> │ └── sched_priority [RO] low, normal
>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Writing "high" to the PF read-write attribute will change PF
> priority on all tiles/GTs to HIGH (schedule function in the next
> time-slice after current one completes and it has work). Writing
> "low" or "normal" to change priority to LOW/NORMAL is supported.
>
> When read, those files will display the current and available
> scheduling priorities. The currently active priority level will
> be enclosed in square brackets, default output will be like:
>
> $ grep . -h sriov_admin/{pf,vf1,vf2}/profile/sched_priority
> [low] normal high
> [low] normal
> [low] normal
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 82 +++++++++++++++++++++++++-
> 1 file changed, 80 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index 26ba9a2efec9..a6be3c88fa4f 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -17,6 +17,21 @@
> #include "xe_sriov_pf_sysfs.h"
> #include "xe_sriov_printk.h"
>
> +static int emit_choice(char *buf, int choice, const char * const *array, size_t size)
> +{
> + int pos = 0;
> + int n;
> +
> + for (n = 0; n < size; n++) {
> + pos += sysfs_emit_at(buf, pos, "%s%s%s%s",
> + n ? " " : "",
> + n == choice ? "[" : "",
> + array[n],
> + n == choice ? "]" : "");
> + }
> + return pos + sysfs_emit_at(buf, pos, "\n");
> +}
> +
> /*
> * /sys/bus/pci/drivers/xe/BDF/
> * :
> @@ -30,12 +45,14 @@
> * │ ├── ...
> * │ └── profile
> * │ ├── exec_quantum_ms
> - * │ └── preempt_timeout_us
> + * │ ├── preempt_timeout_us
> + * │ └── sched_priority
> * ├── vf1/
> * │ ├── ...
> * │ └── profile
> * │ ├── exec_quantum_ms
> - * │ └── preempt_timeout_us
> + * │ ├── preempt_timeout_us
> + * │ └── sched_priority
> * ├── vf2/
> * :
> * └── vfN/
> @@ -115,6 +132,12 @@ static const char * const sched_priority_names[] = {
> [GUC_SCHED_PRIORITY_HIGH] = "high",
> };
>
> +static bool sched_priority_change_allowed(unsigned int vfid)
> +{
> + /* As of today GuC FW allows to selectively change only the PF priority. */
> + return vfid == PFID;
> +}
> +
> static bool sched_priority_high_allowed(unsigned int vfid)
> {
> /* As of today GuC FW allows to select 'high' priority only for the PF. */
> @@ -199,15 +222,70 @@ static XE_SRIOV_VF_ATTR(NAME)
> DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(exec_quantum_ms, eq, u32, "%u\n");
> DEFINE_SIMPLE_PROVISIONING_SRIOV_VF_ATTR(preempt_timeout_us, pt, u32, "%u\n");
>
> +static ssize_t xe_sriov_vf_attr_sched_priority_show(struct xe_device *xe, unsigned int vfid,
> + char *buf)
> +{
> + size_t num_priorities = ARRAY_SIZE(sched_priority_names);
> + u32 priority;
> + int err;
> +
> + err = xe_sriov_pf_provision_query_vf_priority(xe, vfid, &priority);
> + if (err)
> + return err;
> +
> + if (!sched_priority_high_allowed(vfid))
> + num_priorities--;
> +
> + xe_assert(xe, priority < num_priorities);
> + return emit_choice(buf, priority, sched_priority_names, num_priorities);
> +}
> +
> +static ssize_t xe_sriov_vf_attr_sched_priority_store(struct xe_device *xe, unsigned int vfid,
> + const char *buf, size_t count)
> +{
> + size_t num_priorities = ARRAY_SIZE(sched_priority_names);
> + int match;
> + int err;
> +
> + if (!sched_priority_change_allowed(vfid))
> + return -EOPNOTSUPP;
> +
> + if (!sched_priority_high_allowed(vfid))
> + num_priorities--;
> +
> + match = __sysfs_match_string(sched_priority_names, num_priorities, buf);
> + if (match < 0)
> + return -EINVAL;
> +
> + err = xe_sriov_pf_provision_apply_vf_priority(xe, vfid, match);
> + return err ?: count;
> +}
> +
> +static XE_SRIOV_VF_ATTR(sched_priority);
> +
> static struct attribute *profile_vf_attrs[] = {
> &xe_sriov_vf_attr_exec_quantum_ms.attr,
> &xe_sriov_vf_attr_preempt_timeout_us.attr,
> + &xe_sriov_vf_attr_sched_priority.attr,
> NULL
> };
>
> +static umode_t profile_vf_attr_is_visible(struct kobject *kobj,
> + struct attribute *attr, int index)
> +{
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> +
> + if (attr == &xe_sriov_vf_attr_sched_priority.attr &&
> + !sched_priority_change_allowed(vkobj->vfid))
> + return attr->mode & 0444;
> +
> + return attr->mode;
> +}
> +
> static const struct attribute_group profile_vf_attr_group = {
> .name = "profile",
> .attrs = profile_vf_attrs,
> + .is_visible = profile_vf_attr_is_visible,
> };
>
> static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (9 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 10/14] drm/xe/pf: Allow change PF scheduling " Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-28 9:57 ` Piotr Piórkowski
2025-10-20 18:24 ` [PATCH 12/14] drm/xe/pf: Add sysfs device symlinks to enabled VFs Michal Wajdeczko
` (5 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko
In the upcoming patch we would like to use this private helper
during preparation of the sysfs links. Promote it.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
drivers/gpu/drm/xe/xe_pci_sriov.c | 37 ++++++++++++++++++++-----------
drivers/gpu/drm/xe/xe_pci_sriov.h | 1 +
2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
index 735f51effc7a..678e76703cd8 100644
--- a/drivers/gpu/drm/xe/xe_pci_sriov.c
+++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
@@ -30,18 +30,6 @@ static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
xe_sriov_pf_control_reset_vf(xe, n);
}
-static struct pci_dev *xe_pci_pf_get_vf_dev(struct xe_device *xe, unsigned int vf_id)
-{
- struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
-
- xe_assert(xe, IS_SRIOV_PF(xe));
-
- /* caller must use pci_dev_put() */
- return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
- pdev->bus->number,
- pci_iov_virtfn_devfn(pdev, vf_id));
-}
-
static void pf_link_vfs(struct xe_device *xe, int num_vfs)
{
struct pci_dev *pdev_pf = to_pci_dev(xe->drm.dev);
@@ -60,7 +48,7 @@ static void pf_link_vfs(struct xe_device *xe, int num_vfs)
* enforce correct resume order.
*/
for (n = 1; n <= num_vfs; n++) {
- pdev_vf = xe_pci_pf_get_vf_dev(xe, n - 1);
+ pdev_vf = xe_pci_sriov_get_vf_pdev(pdev_pf, n);
/* unlikely, something weird is happening, abort */
if (!pdev_vf) {
@@ -228,3 +216,26 @@ int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
return ret;
}
+
+/**
+ * xe_pci_sriov_get_vf_pdev() - Lookup the VF's PCI device using the VF identifier.
+ * @pdev: the PF's &pci_dev
+ * @vfid: VF identifier (1-based)
+ *
+ * The caller must decrement the reference count by calling pci_dev_put().
+ *
+ * Return: the VF's &pci_dev or NULL if the VF device was not found.
+ */
+struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid)
+{
+ struct xe_device *xe = pdev_to_xe_device(pdev);
+
+ xe_assert(xe, dev_is_pf(&pdev->dev));
+ xe_assert(xe, vfid);
+ xe_assert(xe, vfid <= pci_sriov_get_totalvfs(pdev));
+
+ /* caller must use pci_dev_put() */
+ return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+ pdev->bus->number,
+ pci_iov_virtfn_devfn(pdev, vfid - 1));
+}
diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.h b/drivers/gpu/drm/xe/xe_pci_sriov.h
index c76dd0d90495..b9105d71dbb1 100644
--- a/drivers/gpu/drm/xe/xe_pci_sriov.h
+++ b/drivers/gpu/drm/xe/xe_pci_sriov.h
@@ -10,6 +10,7 @@ struct pci_dev;
#ifdef CONFIG_PCI_IOV
int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs);
+struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid);
#else
static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
{
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev
2025-10-20 18:24 ` [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev Michal Wajdeczko
@ 2025-10-28 9:57 ` Piotr Piórkowski
2025-10-28 12:22 ` Michal Wajdeczko
0 siblings, 1 reply; 44+ messages in thread
From: Piotr Piórkowski @ 2025-10-28 9:57 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2025-paź-20 20:24:11 +0200]:
> In the upcoming patch we would like to use this private helper
> during preparation of the sysfs links. Promote it.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_pci_sriov.c | 37 ++++++++++++++++++++-----------
> drivers/gpu/drm/xe/xe_pci_sriov.h | 1 +
> 2 files changed, 25 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
> index 735f51effc7a..678e76703cd8 100644
> --- a/drivers/gpu/drm/xe/xe_pci_sriov.c
> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
> @@ -30,18 +30,6 @@ static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
> xe_sriov_pf_control_reset_vf(xe, n);
> }
>
> -static struct pci_dev *xe_pci_pf_get_vf_dev(struct xe_device *xe, unsigned int vf_id)
> -{
> - struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> -
> - xe_assert(xe, IS_SRIOV_PF(xe));
> -
> - /* caller must use pci_dev_put() */
> - return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> - pdev->bus->number,
> - pci_iov_virtfn_devfn(pdev, vf_id));
> -}
> -
> static void pf_link_vfs(struct xe_device *xe, int num_vfs)
> {
> struct pci_dev *pdev_pf = to_pci_dev(xe->drm.dev);
> @@ -60,7 +48,7 @@ static void pf_link_vfs(struct xe_device *xe, int num_vfs)
> * enforce correct resume order.
> */
> for (n = 1; n <= num_vfs; n++) {
> - pdev_vf = xe_pci_pf_get_vf_dev(xe, n - 1);
> + pdev_vf = xe_pci_sriov_get_vf_pdev(pdev_pf, n);
>
> /* unlikely, something weird is happening, abort */
> if (!pdev_vf) {
> @@ -228,3 +216,26 @@ int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
>
> return ret;
> }
> +
> +/**
> + * xe_pci_sriov_get_vf_pdev() - Lookup the VF's PCI device using the VF identifier.
> + * @pdev: the PF's &pci_dev
> + * @vfid: VF identifier (1-based)
> + *
> + * The caller must decrement the reference count by calling pci_dev_put().
> + *
> + * Return: the VF's &pci_dev or NULL if the VF device was not found.
> + */
> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid)
> +{
> + struct xe_device *xe = pdev_to_xe_device(pdev);
> +
> + xe_assert(xe, dev_is_pf(&pdev->dev));
> + xe_assert(xe, vfid);
> + xe_assert(xe, vfid <= pci_sriov_get_totalvfs(pdev));
> +
NIT: You already mentioned this in the docs above. I don't see the point in repeating it here.
> + /* caller must use pci_dev_put() */
> + return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> + pdev->bus->number,
> + pci_iov_virtfn_devfn(pdev, vfid - 1));
> +}
> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.h b/drivers/gpu/drm/xe/xe_pci_sriov.h
> index c76dd0d90495..b9105d71dbb1 100644
> --- a/drivers/gpu/drm/xe/xe_pci_sriov.h
> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.h
> @@ -10,6 +10,7 @@ struct pci_dev;
>
> #ifdef CONFIG_PCI_IOV
> int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs);
> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid);
> #else
> static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
> {
Shouldn't you prepare a variant for case without CONFIG_PCI_IOV for the function
xe_pci_sriov_get_vf_pdev ?
Thanks
Piotr
> --
> 2.47.1
>
--
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev
2025-10-28 9:57 ` Piotr Piórkowski
@ 2025-10-28 12:22 ` Michal Wajdeczko
2025-10-28 16:03 ` Piotr Piórkowski
0 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-28 12:22 UTC (permalink / raw)
To: Piotr Piórkowski; +Cc: intel-xe
On 10/28/2025 10:57 AM, Piotr Piórkowski wrote:
> Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2025-paź-20 20:24:11 +0200]:
>> In the upcoming patch we would like to use this private helper
>> during preparation of the sysfs links. Promote it.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_pci_sriov.c | 37 ++++++++++++++++++++-----------
>> drivers/gpu/drm/xe/xe_pci_sriov.h | 1 +
>> 2 files changed, 25 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
>> index 735f51effc7a..678e76703cd8 100644
>> --- a/drivers/gpu/drm/xe/xe_pci_sriov.c
>> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
>> @@ -30,18 +30,6 @@ static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
>> xe_sriov_pf_control_reset_vf(xe, n);
>> }
>>
>> -static struct pci_dev *xe_pci_pf_get_vf_dev(struct xe_device *xe, unsigned int vf_id)
>> -{
>> - struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
>> -
>> - xe_assert(xe, IS_SRIOV_PF(xe));
>> -
>> - /* caller must use pci_dev_put() */
>> - return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
>> - pdev->bus->number,
>> - pci_iov_virtfn_devfn(pdev, vf_id));
>> -}
>> -
>> static void pf_link_vfs(struct xe_device *xe, int num_vfs)
>> {
>> struct pci_dev *pdev_pf = to_pci_dev(xe->drm.dev);
>> @@ -60,7 +48,7 @@ static void pf_link_vfs(struct xe_device *xe, int num_vfs)
>> * enforce correct resume order.
>> */
>> for (n = 1; n <= num_vfs; n++) {
>> - pdev_vf = xe_pci_pf_get_vf_dev(xe, n - 1);
>> + pdev_vf = xe_pci_sriov_get_vf_pdev(pdev_pf, n);
>>
>> /* unlikely, something weird is happening, abort */
>> if (!pdev_vf) {
>> @@ -228,3 +216,26 @@ int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
>>
>> return ret;
>> }
>> +
>> +/**
>> + * xe_pci_sriov_get_vf_pdev() - Lookup the VF's PCI device using the VF identifier.
>> + * @pdev: the PF's &pci_dev
>> + * @vfid: VF identifier (1-based)
>> + *
>> + * The caller must decrement the reference count by calling pci_dev_put().
>> + *
>> + * Return: the VF's &pci_dev or NULL if the VF device was not found.
>> + */
>> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid)
>> +{
>> + struct xe_device *xe = pdev_to_xe_device(pdev);
>> +
>> + xe_assert(xe, dev_is_pf(&pdev->dev));
>> + xe_assert(xe, vfid);
>> + xe_assert(xe, vfid <= pci_sriov_get_totalvfs(pdev));
>> +
> NIT: You already mentioned this in the docs above. I don't see the point in repeating it here.
>> + /* caller must use pci_dev_put() */
>> + return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
>> + pdev->bus->number,
>> + pci_iov_virtfn_devfn(pdev, vfid - 1));
>> +}
>> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.h b/drivers/gpu/drm/xe/xe_pci_sriov.h
>> index c76dd0d90495..b9105d71dbb1 100644
>> --- a/drivers/gpu/drm/xe/xe_pci_sriov.h
>> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.h
>> @@ -10,6 +10,7 @@ struct pci_dev;
>>
>> #ifdef CONFIG_PCI_IOV
>> int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs);
>> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid);
>> #else
>> static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
>> {
>
> Shouldn't you prepare a variant for case without CONFIG_PCI_IOV for the function
> xe_pci_sriov_get_vf_pdev ?
not really, as it will be only used by the PF code (which is already under
this config, and without PCI_IOV config this will not work anyway ;)
the only reason why xe_pci_sriov_configure() has it's stub is because
it is called from the core xe_pci.c (twice)
>
> Thanks
> Piotr
>> --
>> 2.47.1
>>
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev
2025-10-28 12:22 ` Michal Wajdeczko
@ 2025-10-28 16:03 ` Piotr Piórkowski
0 siblings, 0 replies; 44+ messages in thread
From: Piotr Piórkowski @ 2025-10-28 16:03 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on wto [2025-paź-28 13:22:08 +0100]:
>
>
> On 10/28/2025 10:57 AM, Piotr Piórkowski wrote:
> > Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2025-paź-20 20:24:11 +0200]:
> >> In the upcoming patch we would like to use this private helper
> >> during preparation of the sysfs links. Promote it.
> >>
> >> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> >> ---
> >> drivers/gpu/drm/xe/xe_pci_sriov.c | 37 ++++++++++++++++++++-----------
> >> drivers/gpu/drm/xe/xe_pci_sriov.h | 1 +
> >> 2 files changed, 25 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
> >> index 735f51effc7a..678e76703cd8 100644
> >> --- a/drivers/gpu/drm/xe/xe_pci_sriov.c
> >> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
> >> @@ -30,18 +30,6 @@ static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
> >> xe_sriov_pf_control_reset_vf(xe, n);
> >> }
> >>
> >> -static struct pci_dev *xe_pci_pf_get_vf_dev(struct xe_device *xe, unsigned int vf_id)
> >> -{
> >> - struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> >> -
> >> - xe_assert(xe, IS_SRIOV_PF(xe));
> >> -
> >> - /* caller must use pci_dev_put() */
> >> - return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> >> - pdev->bus->number,
> >> - pci_iov_virtfn_devfn(pdev, vf_id));
> >> -}
> >> -
> >> static void pf_link_vfs(struct xe_device *xe, int num_vfs)
> >> {
> >> struct pci_dev *pdev_pf = to_pci_dev(xe->drm.dev);
> >> @@ -60,7 +48,7 @@ static void pf_link_vfs(struct xe_device *xe, int num_vfs)
> >> * enforce correct resume order.
> >> */
> >> for (n = 1; n <= num_vfs; n++) {
> >> - pdev_vf = xe_pci_pf_get_vf_dev(xe, n - 1);
> >> + pdev_vf = xe_pci_sriov_get_vf_pdev(pdev_pf, n);
> >>
> >> /* unlikely, something weird is happening, abort */
> >> if (!pdev_vf) {
> >> @@ -228,3 +216,26 @@ int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
> >>
> >> return ret;
> >> }
> >> +
> >> +/**
> >> + * xe_pci_sriov_get_vf_pdev() - Lookup the VF's PCI device using the VF identifier.
> >> + * @pdev: the PF's &pci_dev
> >> + * @vfid: VF identifier (1-based)
> >> + *
> >> + * The caller must decrement the reference count by calling pci_dev_put().
> >> + *
> >> + * Return: the VF's &pci_dev or NULL if the VF device was not found.
> >> + */
> >> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid)
> >> +{
> >> + struct xe_device *xe = pdev_to_xe_device(pdev);
> >> +
> >> + xe_assert(xe, dev_is_pf(&pdev->dev));
> >> + xe_assert(xe, vfid);
> >> + xe_assert(xe, vfid <= pci_sriov_get_totalvfs(pdev));
> >> +
> > NIT: You already mentioned this in the docs above. I don't see the point in repeating it here.
> >> + /* caller must use pci_dev_put() */
> >> + return pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> >> + pdev->bus->number,
> >> + pci_iov_virtfn_devfn(pdev, vfid - 1));
> >> +}
> >> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.h b/drivers/gpu/drm/xe/xe_pci_sriov.h
> >> index c76dd0d90495..b9105d71dbb1 100644
> >> --- a/drivers/gpu/drm/xe/xe_pci_sriov.h
> >> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.h
> >> @@ -10,6 +10,7 @@ struct pci_dev;
> >>
> >> #ifdef CONFIG_PCI_IOV
> >> int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs);
> >> +struct pci_dev *xe_pci_sriov_get_vf_pdev(struct pci_dev *pdev, unsigned int vfid);
> >> #else
> >> static inline int xe_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
> >> {
> >
> > Shouldn't you prepare a variant for case without CONFIG_PCI_IOV for the function
> > xe_pci_sriov_get_vf_pdev ?
>
> not really, as it will be only used by the PF code (which is already under
> this config, and without PCI_IOV config this will not work anyway ;)
>
> the only reason why xe_pci_sriov_configure() has it's stub is because
> it is called from the core xe_pci.c (twice)
>
ok
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> >
> > Thanks
> > Piotr
> >> --
> >> 2.47.1
> >>
> >
>
--
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 12/14] drm/xe/pf: Add sysfs device symlinks to enabled VFs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (10 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 11/14] drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:47 ` Rodrigo Vivi
2025-10-20 18:24 ` [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs Michal Wajdeczko
` (4 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
For convenience, for every enabled VF add 'device' symlink from
our SR-IOV admin VF folder to enabled sysfs PCI VF device entry.
Remove all those links when disabling PCI VFs.
For completeness, add static 'device' symlink for the PF itself.
/sys/bus/pci/drivers/xe/BDF/sriov_admin/
├── pf
│ └── device -> ../../../BDF # PF BDF
├── vf1
│ └── device -> ../../../BDF' # VF1 BDF
├── vf2
│ └── device -> ../../../BDF" # VF2 BDF
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_pci_sriov.c | 5 ++
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 93 ++++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h | 3 +
3 files changed, 101 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
index 678e76703cd8..fb2fd1d9066d 100644
--- a/drivers/gpu/drm/xe/xe_pci_sriov.c
+++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
@@ -20,6 +20,7 @@
#include "xe_sriov_pf_control.h"
#include "xe_sriov_pf_helpers.h"
#include "xe_sriov_pf_provision.h"
+#include "xe_sriov_pf_sysfs.h"
#include "xe_sriov_printk.h"
static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
@@ -138,6 +139,8 @@ static int pf_enable_vfs(struct xe_device *xe, int num_vfs)
xe_sriov_info(xe, "Enabled %u of %u VF%s\n",
num_vfs, total_vfs, str_plural(total_vfs));
+ xe_sriov_pf_sysfs_link_vfs(xe, num_vfs);
+
pf_engine_activity_stats(xe, num_vfs, true);
return num_vfs;
@@ -165,6 +168,8 @@ static int pf_disable_vfs(struct xe_device *xe)
pf_engine_activity_stats(xe, num_vfs, false);
+ xe_sriov_pf_sysfs_unlink_vfs(xe, num_vfs);
+
pci_disable_sriov(pdev);
pf_reset_vfs(xe, num_vfs);
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index a6be3c88fa4f..c68acf6cd34f 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -9,6 +9,7 @@
#include <drm/drm_managed.h>
#include "xe_assert.h"
+#include "xe_pci_sriov.h"
#include "xe_pm.h"
#include "xe_sriov.h"
#include "xe_sriov_pf.h"
@@ -43,12 +44,14 @@ static int emit_choice(char *buf, int choice, const char * const *array, size_t
* │ └── sched_priority
* ├── pf/
* │ ├── ...
+ * │ ├── device -> ../../../BDF
* │ └── profile
* │ ├── exec_quantum_ms
* │ ├── preempt_timeout_us
* │ └── sched_priority
* ├── vf1/
* │ ├── ...
+ * │ ├── device -> ../../../BDF.1
* │ └── profile
* │ ├── exec_quantum_ms
* │ ├── preempt_timeout_us
@@ -422,6 +425,11 @@ static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
return err;
}
+static void pf_sysfs_note(struct xe_device *xe, int err, const char *what)
+{
+ xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
+}
+
static void action_put_kobject(void *arg)
{
struct kobject *kobj = arg;
@@ -488,6 +496,29 @@ static int pf_setup_tree(struct xe_device *xe)
return 0;
}
+static void action_rm_device_link(void *arg)
+{
+ struct kobject *kobj = arg;
+
+ sysfs_remove_link(kobj, "device");
+}
+
+static int pf_link_pf_device(struct xe_device *xe)
+{
+ struct kobject *kobj = xe->sriov.pf.vfs[PFID].kobj;
+ int err;
+
+ err = sysfs_create_link(kobj, &xe->drm.dev->kobj, "device");
+ if (err)
+ return pf_sysfs_error(xe, err, "PF device link");
+
+ err = devm_add_action_or_reset(xe->drm.dev, action_rm_device_link, kobj);
+ if (err)
+ return pf_sysfs_error(xe, err, "PF unlink action");
+
+ return 0;
+}
+
/**
* xe_sriov_pf_sysfs_init() - Setup PF's SR-IOV sysfs tree.
* @xe: the PF &xe_device to setup sysfs
@@ -509,5 +540,67 @@ int xe_sriov_pf_sysfs_init(struct xe_device *xe)
if (err)
return err;
+ err = pf_link_pf_device(xe);
+ if (err)
+ return err;
+
return 0;
}
+
+/**
+ * xe_sriov_pf_sysfs_link_vfs() - Add VF's links in SR-IOV sysfs tree.
+ * @xe: the &xe_device where to update sysfs
+ * @num_vfs: number of enabled VFs to link
+ *
+ * This function is specific for the PF driver.
+ *
+ * This function will add symbolic links between VFs represented in the SR-IOV
+ * sysfs tree maintained by the PF and enabled VF PCI devices.
+ *
+ * The @xe_sriov_pf_sysfs_unlink_vfs() shall be used to remove those links.
+ */
+void xe_sriov_pf_sysfs_link_vfs(struct xe_device *xe, unsigned int num_vfs)
+{
+ unsigned int totalvfs = xe_sriov_pf_get_totalvfs(xe);
+ struct pci_dev *pf_pdev = to_pci_dev(xe->drm.dev);
+ struct pci_dev *vf_pdev = NULL;
+ unsigned int n;
+ int err;
+
+ xe_assert(xe, IS_SRIOV_PF(xe));
+ xe_assert(xe, num_vfs <= totalvfs);
+
+ for (n = 1; n <= num_vfs; n++) {
+ vf_pdev = xe_pci_sriov_get_vf_pdev(pf_pdev, VFID(n));
+ if (!vf_pdev)
+ return pf_sysfs_note(xe, -ENOENT, "VF link");
+
+ err = sysfs_create_link(xe->sriov.pf.vfs[VFID(n)].kobj,
+ &vf_pdev->dev.kobj, "device");
+
+ /* must balance xe_pci_sriov_get_vf_pdev() */
+ pci_dev_put(vf_pdev);
+
+ if (err)
+ return pf_sysfs_note(xe, err, "VF link");
+ }
+}
+
+/**
+ * xe_sriov_pf_sysfs_unlink_vfs() - Remove VF's links from SR-IOV sysfs tree.
+ * @xe: the &xe_device where to update sysfs
+ * @num_vfs: number of VFs to unlink
+ *
+ * This function shall be called only on the PF.
+ * This function will remove "device" links added by @xe_sriov_sysfs_link_vfs().
+ */
+void xe_sriov_pf_sysfs_unlink_vfs(struct xe_device *xe, unsigned int num_vfs)
+{
+ unsigned int n;
+
+ xe_assert(xe, IS_SRIOV_PF(xe));
+ xe_assert(xe, num_vfs <= xe_sriov_pf_get_totalvfs(xe));
+
+ for (n = 1; n <= num_vfs; n++)
+ sysfs_remove_link(xe->sriov.pf.vfs[VFID(n)].kobj, "device");
+}
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
index 1e6698cc29d3..ae92ed1766e7 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
@@ -10,4 +10,7 @@ struct xe_device;
int xe_sriov_pf_sysfs_init(struct xe_device *xe);
+void xe_sriov_pf_sysfs_link_vfs(struct xe_device *xe, unsigned int num_vfs);
+void xe_sriov_pf_sysfs_unlink_vfs(struct xe_device *xe, unsigned int num_vfs);
+
#endif
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 12/14] drm/xe/pf: Add sysfs device symlinks to enabled VFs
2025-10-20 18:24 ` [PATCH 12/14] drm/xe/pf: Add sysfs device symlinks to enabled VFs Michal Wajdeczko
@ 2025-10-24 19:47 ` Rodrigo Vivi
0 siblings, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:47 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:12PM +0200, Michal Wajdeczko wrote:
> For convenience, for every enabled VF add 'device' symlink from
> our SR-IOV admin VF folder to enabled sysfs PCI VF device entry.
> Remove all those links when disabling PCI VFs.
>
> For completeness, add static 'device' symlink for the PF itself.
>
> /sys/bus/pci/drivers/xe/BDF/sriov_admin/
> ├── pf
> │ └── device -> ../../../BDF # PF BDF
> ├── vf1
> │ └── device -> ../../../BDF' # VF1 BDF
> ├── vf2
> │ └── device -> ../../../BDF" # VF2 BDF
>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_pci_sriov.c | 5 ++
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 93 ++++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h | 3 +
> 3 files changed, 101 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci_sriov.c b/drivers/gpu/drm/xe/xe_pci_sriov.c
> index 678e76703cd8..fb2fd1d9066d 100644
> --- a/drivers/gpu/drm/xe/xe_pci_sriov.c
> +++ b/drivers/gpu/drm/xe/xe_pci_sriov.c
> @@ -20,6 +20,7 @@
> #include "xe_sriov_pf_control.h"
> #include "xe_sriov_pf_helpers.h"
> #include "xe_sriov_pf_provision.h"
> +#include "xe_sriov_pf_sysfs.h"
> #include "xe_sriov_printk.h"
>
> static void pf_reset_vfs(struct xe_device *xe, unsigned int num_vfs)
> @@ -138,6 +139,8 @@ static int pf_enable_vfs(struct xe_device *xe, int num_vfs)
> xe_sriov_info(xe, "Enabled %u of %u VF%s\n",
> num_vfs, total_vfs, str_plural(total_vfs));
>
> + xe_sriov_pf_sysfs_link_vfs(xe, num_vfs);
> +
> pf_engine_activity_stats(xe, num_vfs, true);
>
> return num_vfs;
> @@ -165,6 +168,8 @@ static int pf_disable_vfs(struct xe_device *xe)
>
> pf_engine_activity_stats(xe, num_vfs, false);
>
> + xe_sriov_pf_sysfs_unlink_vfs(xe, num_vfs);
> +
> pci_disable_sriov(pdev);
>
> pf_reset_vfs(xe, num_vfs);
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index a6be3c88fa4f..c68acf6cd34f 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -9,6 +9,7 @@
> #include <drm/drm_managed.h>
>
> #include "xe_assert.h"
> +#include "xe_pci_sriov.h"
> #include "xe_pm.h"
> #include "xe_sriov.h"
> #include "xe_sriov_pf.h"
> @@ -43,12 +44,14 @@ static int emit_choice(char *buf, int choice, const char * const *array, size_t
> * │ └── sched_priority
> * ├── pf/
> * │ ├── ...
> + * │ ├── device -> ../../../BDF
> * │ └── profile
> * │ ├── exec_quantum_ms
> * │ ├── preempt_timeout_us
> * │ └── sched_priority
> * ├── vf1/
> * │ ├── ...
> + * │ ├── device -> ../../../BDF.1
> * │ └── profile
> * │ ├── exec_quantum_ms
> * │ ├── preempt_timeout_us
> @@ -422,6 +425,11 @@ static int pf_sysfs_error(struct xe_device *xe, int err, const char *what)
> return err;
> }
>
> +static void pf_sysfs_note(struct xe_device *xe, int err, const char *what)
> +{
> + xe_sriov_dbg(xe, "Failed to setup sysfs %s (%pe)\n", what, ERR_PTR(err));
> +}
> +
> static void action_put_kobject(void *arg)
> {
> struct kobject *kobj = arg;
> @@ -488,6 +496,29 @@ static int pf_setup_tree(struct xe_device *xe)
> return 0;
> }
>
> +static void action_rm_device_link(void *arg)
> +{
> + struct kobject *kobj = arg;
> +
> + sysfs_remove_link(kobj, "device");
> +}
> +
> +static int pf_link_pf_device(struct xe_device *xe)
> +{
> + struct kobject *kobj = xe->sriov.pf.vfs[PFID].kobj;
> + int err;
> +
> + err = sysfs_create_link(kobj, &xe->drm.dev->kobj, "device");
> + if (err)
> + return pf_sysfs_error(xe, err, "PF device link");
> +
> + err = devm_add_action_or_reset(xe->drm.dev, action_rm_device_link, kobj);
> + if (err)
> + return pf_sysfs_error(xe, err, "PF unlink action");
> +
> + return 0;
> +}
> +
> /**
> * xe_sriov_pf_sysfs_init() - Setup PF's SR-IOV sysfs tree.
> * @xe: the PF &xe_device to setup sysfs
> @@ -509,5 +540,67 @@ int xe_sriov_pf_sysfs_init(struct xe_device *xe)
> if (err)
> return err;
>
> + err = pf_link_pf_device(xe);
> + if (err)
> + return err;
> +
> return 0;
> }
> +
> +/**
> + * xe_sriov_pf_sysfs_link_vfs() - Add VF's links in SR-IOV sysfs tree.
> + * @xe: the &xe_device where to update sysfs
> + * @num_vfs: number of enabled VFs to link
> + *
> + * This function is specific for the PF driver.
> + *
> + * This function will add symbolic links between VFs represented in the SR-IOV
> + * sysfs tree maintained by the PF and enabled VF PCI devices.
> + *
> + * The @xe_sriov_pf_sysfs_unlink_vfs() shall be used to remove those links.
> + */
> +void xe_sriov_pf_sysfs_link_vfs(struct xe_device *xe, unsigned int num_vfs)
> +{
> + unsigned int totalvfs = xe_sriov_pf_get_totalvfs(xe);
> + struct pci_dev *pf_pdev = to_pci_dev(xe->drm.dev);
> + struct pci_dev *vf_pdev = NULL;
> + unsigned int n;
> + int err;
> +
> + xe_assert(xe, IS_SRIOV_PF(xe));
> + xe_assert(xe, num_vfs <= totalvfs);
> +
> + for (n = 1; n <= num_vfs; n++) {
> + vf_pdev = xe_pci_sriov_get_vf_pdev(pf_pdev, VFID(n));
> + if (!vf_pdev)
> + return pf_sysfs_note(xe, -ENOENT, "VF link");
> +
> + err = sysfs_create_link(xe->sriov.pf.vfs[VFID(n)].kobj,
> + &vf_pdev->dev.kobj, "device");
> +
> + /* must balance xe_pci_sriov_get_vf_pdev() */
> + pci_dev_put(vf_pdev);
> +
> + if (err)
> + return pf_sysfs_note(xe, err, "VF link");
> + }
> +}
> +
> +/**
> + * xe_sriov_pf_sysfs_unlink_vfs() - Remove VF's links from SR-IOV sysfs tree.
> + * @xe: the &xe_device where to update sysfs
> + * @num_vfs: number of VFs to unlink
> + *
> + * This function shall be called only on the PF.
> + * This function will remove "device" links added by @xe_sriov_sysfs_link_vfs().
> + */
> +void xe_sriov_pf_sysfs_unlink_vfs(struct xe_device *xe, unsigned int num_vfs)
> +{
> + unsigned int n;
> +
> + xe_assert(xe, IS_SRIOV_PF(xe));
> + xe_assert(xe, num_vfs <= xe_sriov_pf_get_totalvfs(xe));
> +
> + for (n = 1; n <= num_vfs; n++)
> + sysfs_remove_link(xe->sriov.pf.vfs[VFID(n)].kobj, "device");
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
> index 1e6698cc29d3..ae92ed1766e7 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.h
> @@ -10,4 +10,7 @@ struct xe_device;
>
> int xe_sriov_pf_sysfs_init(struct xe_device *xe);
>
> +void xe_sriov_pf_sysfs_link_vfs(struct xe_device *xe, unsigned int num_vfs);
> +void xe_sriov_pf_sysfs_unlink_vfs(struct xe_device *xe, unsigned int num_vfs);
> +
> #endif
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (11 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 12/14] drm/xe/pf: Add sysfs device symlinks to enabled VFs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-24 19:51 ` Rodrigo Vivi
2025-10-20 18:24 ` [PATCH 14/14] drm/xe/pf: Add documentation for sriov_admin attributes Michal Wajdeczko
` (3 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
It is expected that VFs activity will be monitored and in some
cases admin might want to silence specific VF without killing
the VM where it was attached.
Add write-only attributes to control GuC scheduling at VF level.
/sys/bus/pci/drivers/xe/BDF/
├── sriov_admin/
├── vf1/
│ ├── reset [WO] bool
│ └── stop [WO] bool
├── vf2/
│ ├── reset [WO] bool
│ └── stop [WO] bool
Writing "1" or "y" (or whatever is recognized by the strtobool()
function) to these files will trigger the change of the VF state
to STOP (GuC will stop servicing the VF) or back to READY (GuC
will start servicing this VF again but after completing the full
sequence of the software initiated VF FLR).
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 52 ++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
index c68acf6cd34f..f872013313c1 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
@@ -13,6 +13,7 @@
#include "xe_pm.h"
#include "xe_sriov.h"
#include "xe_sriov_pf.h"
+#include "xe_sriov_pf_control.h"
#include "xe_sriov_pf_helpers.h"
#include "xe_sriov_pf_provision.h"
#include "xe_sriov_pf_sysfs.h"
@@ -52,6 +53,8 @@ static int emit_choice(char *buf, int choice, const char * const *array, size_t
* ├── vf1/
* │ ├── ...
* │ ├── device -> ../../../BDF.1
+ * │ ├── reset
+ * │ ├── stop
* │ └── profile
* │ ├── exec_quantum_ms
* │ ├── preempt_timeout_us
@@ -291,8 +294,57 @@ static const struct attribute_group profile_vf_attr_group = {
.is_visible = profile_vf_attr_is_visible,
};
+#define DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(NAME) \
+ \
+static ssize_t xe_sriov_vf_attr_##NAME##_store(struct xe_device *xe, unsigned int vfid, \
+ const char *buf, size_t count) \
+{ \
+ bool yes; \
+ int err; \
+ \
+ if (!vfid) \
+ return -EPERM; \
+ \
+ err = kstrtobool(buf, &yes); \
+ if (err) \
+ return err; \
+ if (!yes) \
+ return count; \
+ \
+ err = xe_sriov_pf_control_##NAME##_vf(xe, vfid); \
+ return err ?: count; \
+} \
+ \
+static XE_SRIOV_VF_ATTR_WO(NAME)
+
+DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(stop);
+DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(reset);
+
+static struct attribute *control_vf_attrs[] = {
+ &xe_sriov_vf_attr_stop.attr,
+ &xe_sriov_vf_attr_reset.attr,
+ NULL
+};
+
+static umode_t control_vf_attr_is_visible(struct kobject *kobj,
+ struct attribute *attr, int index)
+{
+ struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
+
+ if (vkobj->vfid == PFID)
+ return 0;
+
+ return attr->mode;
+}
+
+static const struct attribute_group control_vf_attr_group = {
+ .attrs = control_vf_attrs,
+ .is_visible = control_vf_attr_is_visible,
+};
+
static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
&profile_vf_attr_group,
+ &control_vf_attr_group,
NULL
};
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs
2025-10-20 18:24 ` [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs Michal Wajdeczko
@ 2025-10-24 19:51 ` Rodrigo Vivi
2025-10-27 20:58 ` Lucas De Marchi
0 siblings, 1 reply; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-24 19:51 UTC (permalink / raw)
To: Michal Wajdeczko, Thomas Hellström, Lucas De Marchi
Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:13PM +0200, Michal Wajdeczko wrote:
> It is expected that VFs activity will be monitored and in some
> cases admin might want to silence specific VF without killing
> the VM where it was attached.
>
> Add write-only attributes to control GuC scheduling at VF level.
>
> /sys/bus/pci/drivers/xe/BDF/
> ├── sriov_admin/
> ├── vf1/
> │ ├── reset [WO] bool
This reset is the only thing in this series that I'm not 100% comfortable.
in the device symlink you already have the reset that does the right thing.
If I understood correctly this one here has the same behavior, but with
slightly different path... bypassing the pci subsystem.
I understand that your goal is to have it near the stop since you have to
stop and then reset. But It is still a bit strange.
If you get our only PF FLR supported case, we do need to unbind the driver
before echo 1 > /sys/../device/reset and still the unbind is not a file
near the the reset.
So we can perhaps live without this double reset here.
Although not a big blocker from my side....
Lucas, Thomas, thoughts?
> │ └── stop [WO] bool
> ├── vf2/
> │ ├── reset [WO] bool
> │ └── stop [WO] bool
>
> Writing "1" or "y" (or whatever is recognized by the strtobool()
> function) to these files will trigger the change of the VF state
> to STOP (GuC will stop servicing the VF) or back to READY (GuC
> will start servicing this VF again but after completing the full
> sequence of the software initiated VF FLR).
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 52 ++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> index c68acf6cd34f..f872013313c1 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
> @@ -13,6 +13,7 @@
> #include "xe_pm.h"
> #include "xe_sriov.h"
> #include "xe_sriov_pf.h"
> +#include "xe_sriov_pf_control.h"
> #include "xe_sriov_pf_helpers.h"
> #include "xe_sriov_pf_provision.h"
> #include "xe_sriov_pf_sysfs.h"
> @@ -52,6 +53,8 @@ static int emit_choice(char *buf, int choice, const char * const *array, size_t
> * ├── vf1/
> * │ ├── ...
> * │ ├── device -> ../../../BDF.1
> + * │ ├── reset
> + * │ ├── stop
> * │ └── profile
> * │ ├── exec_quantum_ms
> * │ ├── preempt_timeout_us
> @@ -291,8 +294,57 @@ static const struct attribute_group profile_vf_attr_group = {
> .is_visible = profile_vf_attr_is_visible,
> };
>
> +#define DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(NAME) \
> + \
> +static ssize_t xe_sriov_vf_attr_##NAME##_store(struct xe_device *xe, unsigned int vfid, \
> + const char *buf, size_t count) \
> +{ \
> + bool yes; \
> + int err; \
> + \
> + if (!vfid) \
> + return -EPERM; \
> + \
> + err = kstrtobool(buf, &yes); \
> + if (err) \
> + return err; \
> + if (!yes) \
> + return count; \
> + \
> + err = xe_sriov_pf_control_##NAME##_vf(xe, vfid); \
> + return err ?: count; \
> +} \
> + \
> +static XE_SRIOV_VF_ATTR_WO(NAME)
> +
> +DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(stop);
> +DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(reset);
> +
> +static struct attribute *control_vf_attrs[] = {
> + &xe_sriov_vf_attr_stop.attr,
> + &xe_sriov_vf_attr_reset.attr,
> + NULL
> +};
> +
> +static umode_t control_vf_attr_is_visible(struct kobject *kobj,
> + struct attribute *attr, int index)
> +{
> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
> +
> + if (vkobj->vfid == PFID)
> + return 0;
> +
> + return attr->mode;
> +}
> +
> +static const struct attribute_group control_vf_attr_group = {
> + .attrs = control_vf_attrs,
> + .is_visible = control_vf_attr_is_visible,
> +};
> +
> static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
> &profile_vf_attr_group,
> + &control_vf_attr_group,
> NULL
> };
>
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread* Re: [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs
2025-10-24 19:51 ` Rodrigo Vivi
@ 2025-10-27 20:58 ` Lucas De Marchi
0 siblings, 0 replies; 44+ messages in thread
From: Lucas De Marchi @ 2025-10-27 20:58 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: Michal Wajdeczko, Thomas Hellström, intel-xe
On Fri, Oct 24, 2025 at 03:51:39PM -0400, Rodrigo Vivi wrote:
>On Mon, Oct 20, 2025 at 08:24:13PM +0200, Michal Wajdeczko wrote:
>> It is expected that VFs activity will be monitored and in some
>> cases admin might want to silence specific VF without killing
>> the VM where it was attached.
>>
>> Add write-only attributes to control GuC scheduling at VF level.
>>
>> /sys/bus/pci/drivers/xe/BDF/
>> ├── sriov_admin/
>> ├── vf1/
>> │ ├── reset [WO] bool
>
>This reset is the only thing in this series that I'm not 100% comfortable.
>in the device symlink you already have the reset that does the right thing.
is it really the same thing? This will end up doing a
xe_sriov_pf_control_reset_vf() and I don't see it being done via pci
subsystem.
>
>If I understood correctly this one here has the same behavior, but with
>slightly different path... bypassing the pci subsystem.
>
>I understand that your goal is to have it near the stop since you have to
>stop and then reset. But It is still a bit strange.
>
>If you get our only PF FLR supported case, we do need to unbind the driver
>before echo 1 > /sys/../device/reset and still the unbind is not a file
>near the the reset.
>
>So we can perhaps live without this double reset here.
>
>Although not a big blocker from my side....
>
>Lucas, Thomas, thoughts?
for a sysadmin what would be the alternative? This?
echo 1 > /sys/bus/pci/drivers/xe/<BDF>/sriov_admin/vf1/stop
echo 1 > /sys/bus/pci/drivers/xe/<BDF>/sriov_admin/vf1/device/reset
If it's the same thing (which I'm not sure, see above), then I'd drop
the reset attribute here and rely on the device symlink we are creating
in the previous patch.
Lucas De Marchi
>
>> │ └── stop [WO] bool
>> ├── vf2/
>> │ ├── reset [WO] bool
>> │ └── stop [WO] bool
>>
>> Writing "1" or "y" (or whatever is recognized by the strtobool()
>> function) to these files will trigger the change of the VF state
>> to STOP (GuC will stop servicing the VF) or back to READY (GuC
>> will start servicing this VF again but after completing the full
>> sequence of the software initiated VF FLR).
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c | 52 ++++++++++++++++++++++++++
>> 1 file changed, 52 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> index c68acf6cd34f..f872013313c1 100644
>> --- a/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c
>> @@ -13,6 +13,7 @@
>> #include "xe_pm.h"
>> #include "xe_sriov.h"
>> #include "xe_sriov_pf.h"
>> +#include "xe_sriov_pf_control.h"
>> #include "xe_sriov_pf_helpers.h"
>> #include "xe_sriov_pf_provision.h"
>> #include "xe_sriov_pf_sysfs.h"
>> @@ -52,6 +53,8 @@ static int emit_choice(char *buf, int choice, const char * const *array, size_t
>> * ├── vf1/
>> * │ ├── ...
>> * │ ├── device -> ../../../BDF.1
>> + * │ ├── reset
>> + * │ ├── stop
>> * │ └── profile
>> * │ ├── exec_quantum_ms
>> * │ ├── preempt_timeout_us
>> @@ -291,8 +294,57 @@ static const struct attribute_group profile_vf_attr_group = {
>> .is_visible = profile_vf_attr_is_visible,
>> };
>>
>> +#define DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(NAME) \
>> + \
>> +static ssize_t xe_sriov_vf_attr_##NAME##_store(struct xe_device *xe, unsigned int vfid, \
>> + const char *buf, size_t count) \
>> +{ \
>> + bool yes; \
>> + int err; \
>> + \
>> + if (!vfid) \
>> + return -EPERM; \
>> + \
>> + err = kstrtobool(buf, &yes); \
>> + if (err) \
>> + return err; \
>> + if (!yes) \
>> + return count; \
>> + \
>> + err = xe_sriov_pf_control_##NAME##_vf(xe, vfid); \
>> + return err ?: count; \
>> +} \
>> + \
>> +static XE_SRIOV_VF_ATTR_WO(NAME)
>> +
>> +DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(stop);
>> +DEFINE_SIMPLE_CONTROL_SRIOV_VF_ATTR(reset);
>> +
>> +static struct attribute *control_vf_attrs[] = {
>> + &xe_sriov_vf_attr_stop.attr,
>> + &xe_sriov_vf_attr_reset.attr,
>> + NULL
>> +};
>> +
>> +static umode_t control_vf_attr_is_visible(struct kobject *kobj,
>> + struct attribute *attr, int index)
>> +{
>> + struct xe_sriov_kobj *vkobj = to_xe_sriov_kobj(kobj);
>> +
>> + if (vkobj->vfid == PFID)
>> + return 0;
>> +
>> + return attr->mode;
>> +}
>> +
>> +static const struct attribute_group control_vf_attr_group = {
>> + .attrs = control_vf_attrs,
>> + .is_visible = control_vf_attr_is_visible,
>> +};
>> +
>> static const struct attribute_group *xe_sriov_vf_attr_groups[] = {
>> &profile_vf_attr_group,
>> + &control_vf_attr_group,
>> NULL
>> };
>>
>> --
>> 2.47.1
>>
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 14/14] drm/xe/pf: Add documentation for sriov_admin attributes
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (12 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 13/14] drm/xe/pf: Allow to stop and reset VF using sysfs Michal Wajdeczko
@ 2025-10-20 18:24 ` Michal Wajdeczko
2025-10-27 16:44 ` Rodrigo Vivi
2025-10-21 4:35 ` ✗ CI.checkpatch: warning for PF: Add sriov_admin sysfs tree Patchwork
` (2 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Michal Wajdeczko @ 2025-10-20 18:24 UTC (permalink / raw)
To: intel-xe; +Cc: Michal Wajdeczko, Lucas De Marchi, Rodrigo Vivi
Add initial documentation for all recently added Xe driver
specific SR-IOV sysfs files located under device/sriov_admin.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
.../ABI/testing/sysfs-driver-intel-xe-sriov | 164 ++++++++++++++++++
1 file changed, 164 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov b/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
new file mode 100644
index 000000000000..ac650b673270
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
@@ -0,0 +1,164 @@
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ This directory appears for the particular Intel Xe device when:
+
+ - device supports SR-IOV, and
+ - device is a Physical Function (PF), and
+ - driver support for the SR-IOV PF is enabled on given device.
+
+ This directory is used as a root for all attributes required to
+ manage both Physical Function (PF) and Virtual Functions (VFs).
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ This directory holds attributes related to the SR-IOV Physical
+ Function (PF).
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf1/
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf2/
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<N>/
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ These directories hold attributes related to the SR-IOV Virtual
+ Functions (VFs).
+
+ Note that the VF number <N> is 1-based as described in PCI SR-IOV
+ specification as the Xe driver follows that naming schema.
+
+ There could be "vf1", "vf2" and so on, up to "vf<N>", where <N>
+ matches value of the "sriov_totalvfs" attribute.
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/exec_quantum_ms
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/preempt_timeout_us
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/sched_priority
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/exec_quantum_ms
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/preempt_timeout_us
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/sched_priority
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ These files represent scheduling parameters of the PF or VFs and
+ are available only for Intel Xe platforms with GPU sharing based
+ on the time-slice basis. These scheduling parameters can be changed
+ even if VFs are enabled and running. Those parameters reflects
+ settings of all tiles/GTs assigned to the given function.
+
+ exec_quantum_ms: (RW) unsigned integer
+ The GT execution quantum (EQ) in [ms] of the given function.
+ Actual quantum value might be aligned per HW/FW requirements.
+
+ Default is 0 (unlimited).
+
+ preempt_timeout_us: (RW) unsigned integer
+ The GT preemption timeout in [us] of the given function.
+ Actual timeout value might be aligned per HW/FW requirements.
+
+ Default is 0 (unlimited).
+
+ sched_priority: (RW/RO) string
+ The GT scheduling priority of the given function.
+
+ "low" - function will be scheduled on the GPU for its EQ/PT
+ only if function has any work already submitted.
+
+ "normal" - functions will be scheduled on the GPU for its EQ/PT
+ irrespective of whether it has submitted a work or not.
+
+ "high" - function will be scheduled on the GPU for its EQ/PT
+ in the next time-slice after the current one completes
+ and function has a work submitted.
+
+ Default is "low".
+
+ When read, this file will display the current and available
+ scheduling priorities. The currently active priority level will
+ be enclosed in square brackets, like:
+
+ [low] normal high
+
+ This file can be read-only if changing is currently not supported
+ for given function due to any known HW/FW limitations.
+
+ Writes to these attributes may fail with errors like:
+ -EINVAL if provided input is malformed or not recognized,
+ -EPERM if change is not applicable on given HW/FW,
+ -EIO if GuC refuses to change provisioning.
+
+ Reads from these attributes may fail with:
+ -EUCLEAN if value is not consistent across all tiles/GTs.
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/exec_quantum_ms
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/preempt_timeout_us
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/sched_priority
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ These files allows bulk reconfiguration of the scheduling parameters
+ of the PF or VFs and are available only for Intel Xe platforms with
+ GPU sharing based on the time-slice basis. These scheduling parameters
+ can be changed even if VFs are enabled and running.
+
+ exec_quantum_ms: (WO) unsigned integer
+ The GT execution quantum (EQ) in [ms] to be applied to all functions.
+ See sriov_admin/{pf,vf<N>}/profile/exec_quantum_ms for more details.
+
+ preempt_timeout_us: (WO) unsigned integer
+ The GT preemption timeout (PT) in [us] to be applied to all functions.
+ See sriov_admin/{pf,vf<N>}/profile/preempt_timeout_us for more details.
+
+ sched_priority: (RW/RO) string
+ The GT scheduling priority to be applied for all functions.
+ See sriov_admin/{pf,vf<N>}/profile/sched_priority for more details.
+
+ Writes to these attributes may fail with errors like:
+ -EINVAL if provided input is malformed or not recognized,
+ -EPERM if change is not applicable on given HW/FW,
+ -EIO if GuC refuses to change provisioning.
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/stop
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/reset
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ These files allow to control scheduling of the VF on the Intel Xe GPU
+ platforms. They allow to implement custom policy mechanism in case VFs
+ are misbehaving or triggering adverse events above defined thresholds.
+
+ stop: (WO) bool
+ All GT executions of given function shall be immediately stopped.
+
+ reset: (WO) bool
+ The GT executions of the given function shall be reset after
+ completing software-initiated VF FLR.
+
+ Writes to these attributes may fail with errors like:
+ -EINVAL if provided input is malformed or not recognized,
+ -EPERM if change is not applicable on given HW/FW,
+ -EIO if GuC refuses to change provisioning.
+
+
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/device
+What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/device
+Date: October 2025
+KernelVersion: 6.18
+Contact: intel-xe@lists.freedesktop.org
+Description:
+ These are symlinks to the underlying PCI device entry representing
+ given Xe SR-IOV function. For the PF, this link is always present.
+ For VFs, this link is present only for currently enabled VFs.
--
2.47.1
^ permalink raw reply related [flat|nested] 44+ messages in thread* Re: [PATCH 14/14] drm/xe/pf: Add documentation for sriov_admin attributes
2025-10-20 18:24 ` [PATCH 14/14] drm/xe/pf: Add documentation for sriov_admin attributes Michal Wajdeczko
@ 2025-10-27 16:44 ` Rodrigo Vivi
0 siblings, 0 replies; 44+ messages in thread
From: Rodrigo Vivi @ 2025-10-27 16:44 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe, Lucas De Marchi
On Mon, Oct 20, 2025 at 08:24:14PM +0200, Michal Wajdeczko wrote:
> Add initial documentation for all recently added Xe driver
> specific SR-IOV sysfs files located under device/sriov_admin.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> .../ABI/testing/sysfs-driver-intel-xe-sriov | 164 ++++++++++++++++++
> 1 file changed, 164 insertions(+)
> create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov b/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
> new file mode 100644
> index 000000000000..ac650b673270
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-sriov
> @@ -0,0 +1,164 @@
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + This directory appears for the particular Intel Xe device when:
> +
> + - device supports SR-IOV, and
> + - device is a Physical Function (PF), and
> + - driver support for the SR-IOV PF is enabled on given device.
> +
> + This directory is used as a root for all attributes required to
> + manage both Physical Function (PF) and Virtual Functions (VFs).
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + This directory holds attributes related to the SR-IOV Physical
> + Function (PF).
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf1/
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf2/
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<N>/
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + These directories hold attributes related to the SR-IOV Virtual
> + Functions (VFs).
> +
> + Note that the VF number <N> is 1-based as described in PCI SR-IOV
> + specification as the Xe driver follows that naming schema.
> +
> + There could be "vf1", "vf2" and so on, up to "vf<N>", where <N>
> + matches value of the "sriov_totalvfs" attribute.
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/exec_quantum_ms
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/preempt_timeout_us
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/sched_priority
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/exec_quantum_ms
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/preempt_timeout_us
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/sched_priority
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + These files represent scheduling parameters of the PF or VFs and
> + are available only for Intel Xe platforms with GPU sharing based
> + on the time-slice basis. These scheduling parameters can be changed
> + even if VFs are enabled and running. Those parameters reflects
> + settings of all tiles/GTs assigned to the given function.
> +
> + exec_quantum_ms: (RW) unsigned integer
> + The GT execution quantum (EQ) in [ms] of the given function.
> + Actual quantum value might be aligned per HW/FW requirements.
> +
> + Default is 0 (unlimited).
> +
> + preempt_timeout_us: (RW) unsigned integer
> + The GT preemption timeout in [us] of the given function.
> + Actual timeout value might be aligned per HW/FW requirements.
> +
> + Default is 0 (unlimited).
> +
> + sched_priority: (RW/RO) string
> + The GT scheduling priority of the given function.
> +
> + "low" - function will be scheduled on the GPU for its EQ/PT
> + only if function has any work already submitted.
> +
> + "normal" - functions will be scheduled on the GPU for its EQ/PT
> + irrespective of whether it has submitted a work or not.
> +
> + "high" - function will be scheduled on the GPU for its EQ/PT
> + in the next time-slice after the current one completes
> + and function has a work submitted.
> +
> + Default is "low".
> +
> + When read, this file will display the current and available
> + scheduling priorities. The currently active priority level will
> + be enclosed in square brackets, like:
> +
> + [low] normal high
> +
> + This file can be read-only if changing is currently not supported
> + for given function due to any known HW/FW limitations.
> +
> + Writes to these attributes may fail with errors like:
> + -EINVAL if provided input is malformed or not recognized,
> + -EPERM if change is not applicable on given HW/FW,
> + -EIO if GuC refuses to change provisioning.
> +
> + Reads from these attributes may fail with:
> + -EUCLEAN if value is not consistent across all tiles/GTs.
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/exec_quantum_ms
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/preempt_timeout_us
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/sched_priority
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + These files allows bulk reconfiguration of the scheduling parameters
> + of the PF or VFs and are available only for Intel Xe platforms with
> + GPU sharing based on the time-slice basis. These scheduling parameters
> + can be changed even if VFs are enabled and running.
> +
> + exec_quantum_ms: (WO) unsigned integer
> + The GT execution quantum (EQ) in [ms] to be applied to all functions.
> + See sriov_admin/{pf,vf<N>}/profile/exec_quantum_ms for more details.
> +
> + preempt_timeout_us: (WO) unsigned integer
> + The GT preemption timeout (PT) in [us] to be applied to all functions.
> + See sriov_admin/{pf,vf<N>}/profile/preempt_timeout_us for more details.
> +
> + sched_priority: (RW/RO) string
> + The GT scheduling priority to be applied for all functions.
> + See sriov_admin/{pf,vf<N>}/profile/sched_priority for more details.
> +
> + Writes to these attributes may fail with errors like:
> + -EINVAL if provided input is malformed or not recognized,
> + -EPERM if change is not applicable on given HW/FW,
> + -EIO if GuC refuses to change provisioning.
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/stop
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/reset
> +Date: October 2025
> +KernelVersion: 6.18
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + These files allow to control scheduling of the VF on the Intel Xe GPU
> + platforms. They allow to implement custom policy mechanism in case VFs
> + are misbehaving or triggering adverse events above defined thresholds.
> +
> + stop: (WO) bool
> + All GT executions of given function shall be immediately stopped.
> +
> + reset: (WO) bool
> + The GT executions of the given function shall be reset after
> + completing software-initiated VF FLR.
> +
> + Writes to these attributes may fail with errors like:
> + -EINVAL if provided input is malformed or not recognized,
> + -EPERM if change is not applicable on given HW/FW,
> + -EIO if GuC refuses to change provisioning.
> +
> +
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/device
> +What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/device
> +Date: October 2025
> +KernelVersion: 6.18
6.19
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> +Contact: intel-xe@lists.freedesktop.org
> +Description:
> + These are symlinks to the underlying PCI device entry representing
> + given Xe SR-IOV function. For the PF, this link is always present.
> + For VFs, this link is present only for currently enabled VFs.
> --
> 2.47.1
>
^ permalink raw reply [flat|nested] 44+ messages in thread
* ✗ CI.checkpatch: warning for PF: Add sriov_admin sysfs tree
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (13 preceding siblings ...)
2025-10-20 18:24 ` [PATCH 14/14] drm/xe/pf: Add documentation for sriov_admin attributes Michal Wajdeczko
@ 2025-10-21 4:35 ` Patchwork
2025-10-21 4:36 ` ✓ CI.KUnit: success " Patchwork
2025-10-21 10:19 ` ✗ Xe.CI.Full: failure " Patchwork
16 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2025-10-21 4:35 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
== Series Details ==
Series: PF: Add sriov_admin sysfs tree
URL : https://patchwork.freedesktop.org/series/156220/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
fbd08a78c3a3bb17964db2a326514c69c1dca660
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 13f05e6c26216162a6efd86b0dc79bbaf0ebde65
Author: Michal Wajdeczko <michal.wajdeczko@intel.com>
Date: Mon Oct 20 20:24:14 2025 +0200
drm/xe/pf: Add documentation for sriov_admin attributes
Add initial documentation for all recently added Xe driver
specific SR-IOV sysfs files located under device/sriov_admin.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
+ /mt/dim checkpatch fb865fb539163448d03b35681ea275805a556b96 drm-intel
9aecdc1ff3c9 drm/xe/pf: Prepare sysfs for SR-IOV admin attributes
-:69: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#69:
new file mode 100644
-:111: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations
#111: FILE: drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c:38:
+};
+#define to_xe_sriov_kobj(p) container_of_const((p), struct xe_sriov_kobj, base)
-:118: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations
#118: FILE: drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c:45:
+};
+#define to_xe_sriov_dev_attr(p) container_of_const((p), struct xe_sriov_dev_attr, attr)
-:137: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations
#137: FILE: drivers/gpu/drm/xe/xe_sriov_pf_sysfs.c:64:
+};
+#define to_xe_sriov_vf_attr(p) container_of_const((p), struct xe_sriov_vf_attr, attr)
total: 0 errors, 1 warnings, 3 checks, 359 lines checked
679489b3549b drm/xe/pf: Take RPM during calls to SR-IOV attr.store()
c625cd9787c0 drm/xe/pf: Allow change PF and VFs EQ/PT using sysfs
0053259320e8 drm/xe/pf: Relax report helper to accept PF in bulk configs
4d89963f07e1 drm/xe/pf: Add functions to bulk configure EQ/PT on GT
b274b73d482c drm/xe/pf: Add functions to bulk provision EQ/PT
4ce8b6446285 drm/xe/pf: Allow bulk change all VFs EQ/PT using sysfs
4fe594eac1eb drm/xe/pf: Add functions to provision scheduling priority
47c88211fdb8 drm/xe/pf: Allow bulk change all VFs priority using sysfs
0cab92b9e72f drm/xe/pf: Allow change PF scheduling priority using sysfs
b06bdf8e7e91 drm/xe/pf: Promote xe_pci_sriov_get_vf_pdev
0893681ba45e drm/xe/pf: Add sysfs device symlinks to enabled VFs
2b7f0e0c6567 drm/xe/pf: Allow to stop and reset VF using sysfs
13f05e6c2621 drm/xe/pf: Add documentation for sriov_admin attributes
-:14: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#14:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 164 lines checked
^ permalink raw reply [flat|nested] 44+ messages in thread* ✓ CI.KUnit: success for PF: Add sriov_admin sysfs tree
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (14 preceding siblings ...)
2025-10-21 4:35 ` ✗ CI.checkpatch: warning for PF: Add sriov_admin sysfs tree Patchwork
@ 2025-10-21 4:36 ` Patchwork
2025-10-21 10:19 ` ✗ Xe.CI.Full: failure " Patchwork
16 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2025-10-21 4:36 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
== Series Details ==
Series: PF: Add sriov_admin sysfs tree
URL : https://patchwork.freedesktop.org/series/156220/
State : success
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[04:35:30] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[04:35:35] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
[04:36:12] Starting KUnit Kernel (1/1)...
[04:36:12] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[04:36:12] ================== guc_buf (11 subtests) ===================
[04:36:12] [PASSED] test_smallest
[04:36:12] [PASSED] test_largest
[04:36:12] [PASSED] test_granular
[04:36:12] [PASSED] test_unique
[04:36:12] [PASSED] test_overlap
[04:36:12] [PASSED] test_reusable
[04:36:12] [PASSED] test_too_big
[04:36:12] [PASSED] test_flush
[04:36:12] [PASSED] test_lookup
[04:36:12] [PASSED] test_data
[04:36:12] [PASSED] test_class
[04:36:12] ===================== [PASSED] guc_buf =====================
[04:36:12] =================== guc_dbm (7 subtests) ===================
[04:36:12] [PASSED] test_empty
[04:36:12] [PASSED] test_default
[04:36:12] ======================== test_size ========================
[04:36:12] [PASSED] 4
[04:36:12] [PASSED] 8
[04:36:12] [PASSED] 32
[04:36:12] [PASSED] 256
[04:36:12] ==================== [PASSED] test_size ====================
[04:36:12] ======================= test_reuse ========================
[04:36:12] [PASSED] 4
[04:36:12] [PASSED] 8
[04:36:12] [PASSED] 32
[04:36:12] [PASSED] 256
[04:36:12] =================== [PASSED] test_reuse ====================
[04:36:12] =================== test_range_overlap ====================
[04:36:12] [PASSED] 4
[04:36:12] [PASSED] 8
[04:36:12] [PASSED] 32
[04:36:12] [PASSED] 256
[04:36:12] =============== [PASSED] test_range_overlap ================
[04:36:12] =================== test_range_compact ====================
[04:36:12] [PASSED] 4
[04:36:12] [PASSED] 8
[04:36:12] [PASSED] 32
[04:36:12] [PASSED] 256
[04:36:12] =============== [PASSED] test_range_compact ================
[04:36:12] ==================== test_range_spare =====================
[04:36:12] [PASSED] 4
[04:36:12] [PASSED] 8
[04:36:12] [PASSED] 32
[04:36:12] [PASSED] 256
[04:36:12] ================ [PASSED] test_range_spare =================
[04:36:12] ===================== [PASSED] guc_dbm =====================
[04:36:12] =================== guc_idm (6 subtests) ===================
[04:36:12] [PASSED] bad_init
[04:36:12] [PASSED] no_init
[04:36:12] [PASSED] init_fini
[04:36:12] [PASSED] check_used
[04:36:12] [PASSED] check_quota
[04:36:12] [PASSED] check_all
[04:36:12] ===================== [PASSED] guc_idm =====================
[04:36:12] ================== no_relay (3 subtests) ===================
[04:36:12] [PASSED] xe_drops_guc2pf_if_not_ready
[04:36:12] [PASSED] xe_drops_guc2vf_if_not_ready
[04:36:12] [PASSED] xe_rejects_send_if_not_ready
[04:36:12] ==================== [PASSED] no_relay =====================
[04:36:12] ================== pf_relay (14 subtests) ==================
[04:36:12] [PASSED] pf_rejects_guc2pf_too_short
[04:36:12] [PASSED] pf_rejects_guc2pf_too_long
[04:36:12] [PASSED] pf_rejects_guc2pf_no_payload
[04:36:12] [PASSED] pf_fails_no_payload
[04:36:12] [PASSED] pf_fails_bad_origin
[04:36:12] [PASSED] pf_fails_bad_type
[04:36:12] [PASSED] pf_txn_reports_error
[04:36:12] [PASSED] pf_txn_sends_pf2guc
[04:36:12] [PASSED] pf_sends_pf2guc
[04:36:12] [SKIPPED] pf_loopback_nop
[04:36:12] [SKIPPED] pf_loopback_echo
[04:36:12] [SKIPPED] pf_loopback_fail
[04:36:12] [SKIPPED] pf_loopback_busy
[04:36:12] [SKIPPED] pf_loopback_retry
[04:36:12] ==================== [PASSED] pf_relay =====================
[04:36:12] ================== vf_relay (3 subtests) ===================
[04:36:12] [PASSED] vf_rejects_guc2vf_too_short
[04:36:12] [PASSED] vf_rejects_guc2vf_too_long
[04:36:12] [PASSED] vf_rejects_guc2vf_no_payload
[04:36:12] ==================== [PASSED] vf_relay =====================
[04:36:12] ===================== lmtt (1 subtest) =====================
[04:36:12] ======================== test_ops =========================
[04:36:12] [PASSED] 2-level
[04:36:12] [PASSED] multi-level
[04:36:12] ==================== [PASSED] test_ops =====================
[04:36:12] ====================== [PASSED] lmtt =======================
[04:36:12] ================= pf_service (11 subtests) =================
[04:36:12] [PASSED] pf_negotiate_any
[04:36:12] [PASSED] pf_negotiate_base_match
[04:36:12] [PASSED] pf_negotiate_base_newer
[04:36:12] [PASSED] pf_negotiate_base_next
[04:36:12] [SKIPPED] pf_negotiate_base_older
[04:36:12] [PASSED] pf_negotiate_base_prev
[04:36:12] [PASSED] pf_negotiate_latest_match
[04:36:12] [PASSED] pf_negotiate_latest_newer
[04:36:12] [PASSED] pf_negotiate_latest_next
[04:36:12] [SKIPPED] pf_negotiate_latest_older
[04:36:12] [SKIPPED] pf_negotiate_latest_prev
[04:36:12] =================== [PASSED] pf_service ====================
[04:36:12] ================= xe_guc_g2g (2 subtests) ==================
[04:36:12] ============== xe_live_guc_g2g_kunit_default ==============
[04:36:12] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[04:36:12] ============== xe_live_guc_g2g_kunit_allmem ===============
[04:36:12] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[04:36:12] =================== [SKIPPED] xe_guc_g2g ===================
[04:36:12] =================== xe_mocs (2 subtests) ===================
[04:36:12] ================ xe_live_mocs_kernel_kunit ================
[04:36:12] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[04:36:12] ================ xe_live_mocs_reset_kunit =================
[04:36:12] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[04:36:12] ==================== [SKIPPED] xe_mocs =====================
[04:36:12] ================= xe_migrate (2 subtests) ==================
[04:36:12] ================= xe_migrate_sanity_kunit =================
[04:36:12] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[04:36:12] ================== xe_validate_ccs_kunit ==================
[04:36:12] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[04:36:12] =================== [SKIPPED] xe_migrate ===================
[04:36:12] ================== xe_dma_buf (1 subtest) ==================
[04:36:12] ==================== xe_dma_buf_kunit =====================
[04:36:12] ================ [SKIPPED] xe_dma_buf_kunit ================
[04:36:12] =================== [SKIPPED] xe_dma_buf ===================
[04:36:12] ================= xe_bo_shrink (1 subtest) =================
[04:36:12] =================== xe_bo_shrink_kunit ====================
[04:36:12] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[04:36:12] ================== [SKIPPED] xe_bo_shrink ==================
[04:36:12] ==================== xe_bo (2 subtests) ====================
[04:36:12] ================== xe_ccs_migrate_kunit ===================
[04:36:12] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[04:36:12] ==================== xe_bo_evict_kunit ====================
[04:36:12] =============== [SKIPPED] xe_bo_evict_kunit ================
[04:36:12] ===================== [SKIPPED] xe_bo ======================
[04:36:12] ==================== args (11 subtests) ====================
[04:36:12] [PASSED] count_args_test
[04:36:12] [PASSED] call_args_example
[04:36:12] [PASSED] call_args_test
[04:36:12] [PASSED] drop_first_arg_example
[04:36:12] [PASSED] drop_first_arg_test
[04:36:12] [PASSED] first_arg_example
[04:36:12] [PASSED] first_arg_test
[04:36:12] [PASSED] last_arg_example
[04:36:12] [PASSED] last_arg_test
[04:36:12] [PASSED] pick_arg_example
[04:36:12] [PASSED] sep_comma_example
[04:36:12] ====================== [PASSED] args =======================
[04:36:12] =================== xe_pci (3 subtests) ====================
[04:36:12] ==================== check_graphics_ip ====================
[04:36:12] [PASSED] 12.00 Xe_LP
[04:36:12] [PASSED] 12.10 Xe_LP+
[04:36:12] [PASSED] 12.55 Xe_HPG
[04:36:12] [PASSED] 12.60 Xe_HPC
[04:36:12] [PASSED] 12.70 Xe_LPG
[04:36:12] [PASSED] 12.71 Xe_LPG
[04:36:12] [PASSED] 12.74 Xe_LPG+
[04:36:12] [PASSED] 20.01 Xe2_HPG
[04:36:12] [PASSED] 20.02 Xe2_HPG
[04:36:12] [PASSED] 20.04 Xe2_LPG
[04:36:12] [PASSED] 30.00 Xe3_LPG
[04:36:12] [PASSED] 30.01 Xe3_LPG
[04:36:12] [PASSED] 30.03 Xe3_LPG
[04:36:12] [PASSED] 30.04 Xe3_LPG
[04:36:12] [PASSED] 30.05 Xe3_LPG
[04:36:12] [PASSED] 35.11 Xe3p_XPC
[04:36:12] ================ [PASSED] check_graphics_ip ================
[04:36:12] ===================== check_media_ip ======================
[04:36:12] [PASSED] 12.00 Xe_M
[04:36:12] [PASSED] 12.55 Xe_HPM
[04:36:12] [PASSED] 13.00 Xe_LPM+
[04:36:12] [PASSED] 13.01 Xe2_HPM
[04:36:12] [PASSED] 20.00 Xe2_LPM
[04:36:12] [PASSED] 30.00 Xe3_LPM
[04:36:12] [PASSED] 30.02 Xe3_LPM
[04:36:12] [PASSED] 35.00 Xe3p_LPM
[04:36:12] [PASSED] 35.03 Xe3p_HPM
[04:36:12] ================= [PASSED] check_media_ip ==================
[04:36:12] ================= check_platform_gt_count =================
[04:36:12] [PASSED] 0x9A60 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A68 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A70 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A40 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A49 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A59 (TIGERLAKE)
[04:36:12] [PASSED] 0x9A78 (TIGERLAKE)
[04:36:12] [PASSED] 0x9AC0 (TIGERLAKE)
[04:36:12] [PASSED] 0x9AC9 (TIGERLAKE)
[04:36:12] [PASSED] 0x9AD9 (TIGERLAKE)
[04:36:12] [PASSED] 0x9AF8 (TIGERLAKE)
[04:36:12] [PASSED] 0x4C80 (ROCKETLAKE)
[04:36:12] [PASSED] 0x4C8A (ROCKETLAKE)
[04:36:12] [PASSED] 0x4C8B (ROCKETLAKE)
[04:36:12] [PASSED] 0x4C8C (ROCKETLAKE)
[04:36:12] [PASSED] 0x4C90 (ROCKETLAKE)
[04:36:12] [PASSED] 0x4C9A (ROCKETLAKE)
[04:36:12] [PASSED] 0x4680 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4682 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4688 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x468A (ALDERLAKE_S)
[04:36:12] [PASSED] 0x468B (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4690 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4692 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4693 (ALDERLAKE_S)
[04:36:12] [PASSED] 0x46A0 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46A1 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46A2 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46A3 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46A6 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46A8 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46AA (ALDERLAKE_P)
[04:36:12] [PASSED] 0x462A (ALDERLAKE_P)
[04:36:12] [PASSED] 0x4626 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x4628 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46B0 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46B1 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46B2 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46B3 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46C0 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46C1 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46C2 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46C3 (ALDERLAKE_P)
[04:36:12] [PASSED] 0x46D0 (ALDERLAKE_N)
[04:36:12] [PASSED] 0x46D1 (ALDERLAKE_N)
[04:36:12] [PASSED] 0x46D2 (ALDERLAKE_N)
[04:36:12] [PASSED] 0x46D3 (ALDERLAKE_N)
[04:36:12] [PASSED] 0x46D4 (ALDERLAKE_N)
[04:36:12] [PASSED] 0xA721 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7A1 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7A9 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7AC (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7AD (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA720 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7A0 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7A8 (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7AA (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA7AB (ALDERLAKE_P)
[04:36:12] [PASSED] 0xA780 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA781 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA782 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA783 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA788 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA789 (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA78A (ALDERLAKE_S)
[04:36:12] [PASSED] 0xA78B (ALDERLAKE_S)
[04:36:12] [PASSED] 0x4905 (DG1)
[04:36:12] [PASSED] 0x4906 (DG1)
[04:36:12] [PASSED] 0x4907 (DG1)
[04:36:12] [PASSED] 0x4908 (DG1)
[04:36:12] [PASSED] 0x4909 (DG1)
[04:36:12] [PASSED] 0x56C0 (DG2)
[04:36:12] [PASSED] 0x56C2 (DG2)
[04:36:12] [PASSED] 0x56C1 (DG2)
[04:36:12] [PASSED] 0x7D51 (METEORLAKE)
[04:36:12] [PASSED] 0x7DD1 (METEORLAKE)
[04:36:12] [PASSED] 0x7D41 (METEORLAKE)
[04:36:12] [PASSED] 0x7D67 (METEORLAKE)
[04:36:12] [PASSED] 0xB640 (METEORLAKE)
[04:36:12] [PASSED] 0x56A0 (DG2)
[04:36:12] [PASSED] 0x56A1 (DG2)
[04:36:12] [PASSED] 0x56A2 (DG2)
[04:36:12] [PASSED] 0x56BE (DG2)
[04:36:12] [PASSED] 0x56BF (DG2)
[04:36:12] [PASSED] 0x5690 (DG2)
[04:36:12] [PASSED] 0x5691 (DG2)
[04:36:12] [PASSED] 0x5692 (DG2)
[04:36:12] [PASSED] 0x56A5 (DG2)
[04:36:12] [PASSED] 0x56A6 (DG2)
[04:36:12] [PASSED] 0x56B0 (DG2)
[04:36:12] [PASSED] 0x56B1 (DG2)
[04:36:12] [PASSED] 0x56BA (DG2)
[04:36:12] [PASSED] 0x56BB (DG2)
[04:36:12] [PASSED] 0x56BC (DG2)
[04:36:12] [PASSED] 0x56BD (DG2)
[04:36:12] [PASSED] 0x5693 (DG2)
[04:36:12] [PASSED] 0x5694 (DG2)
[04:36:12] [PASSED] 0x5695 (DG2)
[04:36:12] [PASSED] 0x56A3 (DG2)
[04:36:12] [PASSED] 0x56A4 (DG2)
[04:36:12] [PASSED] 0x56B2 (DG2)
[04:36:12] [PASSED] 0x56B3 (DG2)
[04:36:12] [PASSED] 0x5696 (DG2)
[04:36:12] [PASSED] 0x5697 (DG2)
[04:36:12] [PASSED] 0xB69 (PVC)
[04:36:12] [PASSED] 0xB6E (PVC)
[04:36:12] [PASSED] 0xBD4 (PVC)
[04:36:12] [PASSED] 0xBD5 (PVC)
[04:36:12] [PASSED] 0xBD6 (PVC)
[04:36:12] [PASSED] 0xBD7 (PVC)
[04:36:12] [PASSED] 0xBD8 (PVC)
[04:36:12] [PASSED] 0xBD9 (PVC)
[04:36:12] [PASSED] 0xBDA (PVC)
[04:36:12] [PASSED] 0xBDB (PVC)
[04:36:12] [PASSED] 0xBE0 (PVC)
[04:36:12] [PASSED] 0xBE1 (PVC)
[04:36:12] [PASSED] 0xBE5 (PVC)
[04:36:12] [PASSED] 0x7D40 (METEORLAKE)
[04:36:12] [PASSED] 0x7D45 (METEORLAKE)
[04:36:12] [PASSED] 0x7D55 (METEORLAKE)
[04:36:12] [PASSED] 0x7D60 (METEORLAKE)
[04:36:12] [PASSED] 0x7DD5 (METEORLAKE)
[04:36:12] [PASSED] 0x6420 (LUNARLAKE)
[04:36:12] [PASSED] 0x64A0 (LUNARLAKE)
[04:36:12] [PASSED] 0x64B0 (LUNARLAKE)
[04:36:12] [PASSED] 0xE202 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE209 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE20B (BATTLEMAGE)
[04:36:12] [PASSED] 0xE20C (BATTLEMAGE)
[04:36:12] [PASSED] 0xE20D (BATTLEMAGE)
[04:36:12] [PASSED] 0xE210 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE211 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE212 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE216 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE220 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE221 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE222 (BATTLEMAGE)
[04:36:12] [PASSED] 0xE223 (BATTLEMAGE)
[04:36:12] [PASSED] 0xB080 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB081 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB082 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB083 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB084 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB085 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB086 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB087 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB08F (PANTHERLAKE)
[04:36:12] [PASSED] 0xB090 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB0A0 (PANTHERLAKE)
[04:36:12] [PASSED] 0xB0B0 (PANTHERLAKE)
[04:36:12] [PASSED] 0xFD80 (PANTHERLAKE)
[04:36:12] [PASSED] 0xFD81 (PANTHERLAKE)
[04:36:12] [PASSED] 0xD740 (NOVALAKE_S)
[04:36:12] [PASSED] 0xD741 (NOVALAKE_S)
[04:36:12] [PASSED] 0xD742 (NOVALAKE_S)
[04:36:12] [PASSED] 0xD743 (NOVALAKE_S)
[04:36:12] [PASSED] 0xD744 (NOVALAKE_S)
[04:36:12] [PASSED] 0xD745 (NOVALAKE_S)
[04:36:12] ============= [PASSED] check_platform_gt_count =============
[04:36:12] ===================== [PASSED] xe_pci ======================
[04:36:12] =================== xe_rtp (2 subtests) ====================
[04:36:12] =============== xe_rtp_process_to_sr_tests ================
[04:36:12] [PASSED] coalesce-same-reg
[04:36:12] [PASSED] no-match-no-add
[04:36:12] [PASSED] match-or
[04:36:12] [PASSED] match-or-xfail
[04:36:12] [PASSED] no-match-no-add-multiple-rules
[04:36:12] [PASSED] two-regs-two-entries
[04:36:12] [PASSED] clr-one-set-other
[04:36:12] [PASSED] set-field
[04:36:12] [PASSED] conflict-duplicate
[04:36:12] [PASSED] conflict-not-disjoint
[04:36:12] [PASSED] conflict-reg-type
[04:36:12] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[04:36:12] ================== xe_rtp_process_tests ===================
[04:36:12] [PASSED] active1
[04:36:12] [PASSED] active2
[04:36:12] [PASSED] active-inactive
[04:36:12] [PASSED] inactive-active
[04:36:12] [PASSED] inactive-1st_or_active-inactive
[04:36:12] [PASSED] inactive-2nd_or_active-inactive
[04:36:12] [PASSED] inactive-last_or_active-inactive
[04:36:12] [PASSED] inactive-no_or_active-inactive
stty: 'standard input': Inappropriate ioctl for device
[04:36:12] ============== [PASSED] xe_rtp_process_tests ===============
[04:36:12] ===================== [PASSED] xe_rtp ======================
[04:36:12] ==================== xe_wa (1 subtest) =====================
[04:36:12] ======================== xe_wa_gt =========================
[04:36:12] [PASSED] TIGERLAKE B0
[04:36:12] [PASSED] DG1 A0
[04:36:12] [PASSED] DG1 B0
[04:36:12] [PASSED] ALDERLAKE_S A0
[04:36:12] [PASSED] ALDERLAKE_S B0
[04:36:12] [PASSED] ALDERLAKE_S C0
[04:36:12] [PASSED] ALDERLAKE_S D0
[04:36:12] [PASSED] ALDERLAKE_P A0
[04:36:12] [PASSED] ALDERLAKE_P B0
[04:36:12] [PASSED] ALDERLAKE_P C0
[04:36:12] [PASSED] ALDERLAKE_S RPLS D0
[04:36:12] [PASSED] ALDERLAKE_P RPLU E0
[04:36:12] [PASSED] DG2 G10 C0
[04:36:12] [PASSED] DG2 G11 B1
[04:36:12] [PASSED] DG2 G12 A1
[04:36:12] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[04:36:12] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[04:36:12] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[04:36:12] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[04:36:12] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[04:36:12] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[04:36:12] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[04:36:12] ==================== [PASSED] xe_wa_gt =====================
[04:36:12] ====================== [PASSED] xe_wa ======================
[04:36:12] ============================================================
[04:36:12] Testing complete. Ran 317 tests: passed: 299, skipped: 18
[04:36:12] Elapsed time: 42.083s total, 4.772s configuring, 36.944s building, 0.337s running
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig
[04:36:12] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[04:36:14] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
[04:36:43] Starting KUnit Kernel (1/1)...
[04:36:43] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[04:36:43] ============ drm_test_pick_cmdline (2 subtests) ============
[04:36:43] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[04:36:43] =============== drm_test_pick_cmdline_named ===============
[04:36:43] [PASSED] NTSC
[04:36:43] [PASSED] NTSC-J
[04:36:43] [PASSED] PAL
[04:36:43] [PASSED] PAL-M
[04:36:43] =========== [PASSED] drm_test_pick_cmdline_named ===========
[04:36:43] ============== [PASSED] drm_test_pick_cmdline ==============
[04:36:43] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[04:36:43] [PASSED] drm_test_drm_atomic_get_connector_for_encoder
[04:36:43] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ====
[04:36:43] =========== drm_validate_clone_mode (2 subtests) ===========
[04:36:43] ============== drm_test_check_in_clone_mode ===============
[04:36:43] [PASSED] in_clone_mode
[04:36:43] [PASSED] not_in_clone_mode
[04:36:43] ========== [PASSED] drm_test_check_in_clone_mode ===========
[04:36:43] =============== drm_test_check_valid_clones ===============
[04:36:43] [PASSED] not_in_clone_mode
[04:36:43] [PASSED] valid_clone
[04:36:43] [PASSED] invalid_clone
[04:36:43] =========== [PASSED] drm_test_check_valid_clones ===========
[04:36:43] ============= [PASSED] drm_validate_clone_mode =============
[04:36:43] ============= drm_validate_modeset (1 subtest) =============
[04:36:43] [PASSED] drm_test_check_connector_changed_modeset
[04:36:43] ============== [PASSED] drm_validate_modeset ===============
[04:36:43] ====== drm_test_bridge_get_current_state (2 subtests) ======
[04:36:43] [PASSED] drm_test_drm_bridge_get_current_state_atomic
[04:36:43] [PASSED] drm_test_drm_bridge_get_current_state_legacy
[04:36:43] ======== [PASSED] drm_test_bridge_get_current_state ========
[04:36:43] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ======
[04:36:43] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic
[04:36:43] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled
[04:36:43] [PASSED] drm_test_drm_bridge_helper_reset_crtc_legacy
[04:36:43] ======== [PASSED] drm_test_bridge_helper_reset_crtc ========
[04:36:43] ============== drm_bridge_alloc (2 subtests) ===============
[04:36:43] [PASSED] drm_test_drm_bridge_alloc_basic
[04:36:43] [PASSED] drm_test_drm_bridge_alloc_get_put
[04:36:43] ================ [PASSED] drm_bridge_alloc =================
[04:36:43] ================== drm_buddy (8 subtests) ==================
[04:36:43] [PASSED] drm_test_buddy_alloc_limit
[04:36:43] [PASSED] drm_test_buddy_alloc_optimistic
[04:36:43] [PASSED] drm_test_buddy_alloc_pessimistic
[04:36:43] [PASSED] drm_test_buddy_alloc_pathological
[04:36:43] [PASSED] drm_test_buddy_alloc_contiguous
[04:36:43] [PASSED] drm_test_buddy_alloc_clear
[04:36:43] [PASSED] drm_test_buddy_alloc_range_bias
[04:36:43] [PASSED] drm_test_buddy_fragmentation_performance
[04:36:43] ==================== [PASSED] drm_buddy ====================
[04:36:43] ============= drm_cmdline_parser (40 subtests) =============
[04:36:43] [PASSED] drm_test_cmdline_force_d_only
[04:36:43] [PASSED] drm_test_cmdline_force_D_only_dvi
[04:36:43] [PASSED] drm_test_cmdline_force_D_only_hdmi
[04:36:43] [PASSED] drm_test_cmdline_force_D_only_not_digital
[04:36:43] [PASSED] drm_test_cmdline_force_e_only
[04:36:43] [PASSED] drm_test_cmdline_res
[04:36:43] [PASSED] drm_test_cmdline_res_vesa
[04:36:43] [PASSED] drm_test_cmdline_res_vesa_rblank
[04:36:43] [PASSED] drm_test_cmdline_res_rblank
[04:36:43] [PASSED] drm_test_cmdline_res_bpp
[04:36:43] [PASSED] drm_test_cmdline_res_refresh
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[04:36:43] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[04:36:43] [PASSED] drm_test_cmdline_res_margins_force_on
[04:36:43] [PASSED] drm_test_cmdline_res_vesa_margins
[04:36:43] [PASSED] drm_test_cmdline_name
[04:36:43] [PASSED] drm_test_cmdline_name_bpp
[04:36:43] [PASSED] drm_test_cmdline_name_option
[04:36:43] [PASSED] drm_test_cmdline_name_bpp_option
[04:36:43] [PASSED] drm_test_cmdline_rotate_0
[04:36:43] [PASSED] drm_test_cmdline_rotate_90
[04:36:43] [PASSED] drm_test_cmdline_rotate_180
[04:36:43] [PASSED] drm_test_cmdline_rotate_270
[04:36:43] [PASSED] drm_test_cmdline_hmirror
[04:36:43] [PASSED] drm_test_cmdline_vmirror
[04:36:43] [PASSED] drm_test_cmdline_margin_options
[04:36:43] [PASSED] drm_test_cmdline_multiple_options
[04:36:43] [PASSED] drm_test_cmdline_bpp_extra_and_option
[04:36:43] [PASSED] drm_test_cmdline_extra_and_option
[04:36:43] [PASSED] drm_test_cmdline_freestanding_options
[04:36:43] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[04:36:43] [PASSED] drm_test_cmdline_panel_orientation
[04:36:43] ================ drm_test_cmdline_invalid =================
[04:36:43] [PASSED] margin_only
[04:36:43] [PASSED] interlace_only
[04:36:43] [PASSED] res_missing_x
[04:36:43] [PASSED] res_missing_y
[04:36:43] [PASSED] res_bad_y
[04:36:43] [PASSED] res_missing_y_bpp
[04:36:43] [PASSED] res_bad_bpp
[04:36:43] [PASSED] res_bad_refresh
[04:36:43] [PASSED] res_bpp_refresh_force_on_off
[04:36:43] [PASSED] res_invalid_mode
[04:36:43] [PASSED] res_bpp_wrong_place_mode
[04:36:43] [PASSED] name_bpp_refresh
[04:36:43] [PASSED] name_refresh
[04:36:43] [PASSED] name_refresh_wrong_mode
[04:36:43] [PASSED] name_refresh_invalid_mode
[04:36:43] [PASSED] rotate_multiple
[04:36:43] [PASSED] rotate_invalid_val
[04:36:43] [PASSED] rotate_truncated
[04:36:43] [PASSED] invalid_option
[04:36:43] [PASSED] invalid_tv_option
[04:36:43] [PASSED] truncated_tv_option
[04:36:43] ============ [PASSED] drm_test_cmdline_invalid =============
[04:36:43] =============== drm_test_cmdline_tv_options ===============
[04:36:43] [PASSED] NTSC
[04:36:43] [PASSED] NTSC_443
[04:36:43] [PASSED] NTSC_J
[04:36:43] [PASSED] PAL
[04:36:43] [PASSED] PAL_M
[04:36:43] [PASSED] PAL_N
[04:36:43] [PASSED] SECAM
[04:36:43] [PASSED] MONO_525
[04:36:43] [PASSED] MONO_625
[04:36:43] =========== [PASSED] drm_test_cmdline_tv_options ===========
[04:36:43] =============== [PASSED] drm_cmdline_parser ================
[04:36:43] ========== drmm_connector_hdmi_init (20 subtests) ==========
[04:36:43] [PASSED] drm_test_connector_hdmi_init_valid
[04:36:43] [PASSED] drm_test_connector_hdmi_init_bpc_8
[04:36:43] [PASSED] drm_test_connector_hdmi_init_bpc_10
[04:36:43] [PASSED] drm_test_connector_hdmi_init_bpc_12
[04:36:43] [PASSED] drm_test_connector_hdmi_init_bpc_invalid
[04:36:43] [PASSED] drm_test_connector_hdmi_init_bpc_null
[04:36:43] [PASSED] drm_test_connector_hdmi_init_formats_empty
[04:36:43] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb
[04:36:43] === drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[04:36:43] [PASSED] supported_formats=0x9 yuv420_allowed=1
[04:36:43] [PASSED] supported_formats=0x9 yuv420_allowed=0
[04:36:43] [PASSED] supported_formats=0x3 yuv420_allowed=1
[04:36:43] [PASSED] supported_formats=0x3 yuv420_allowed=0
[04:36:43] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[04:36:43] [PASSED] drm_test_connector_hdmi_init_null_ddc
[04:36:43] [PASSED] drm_test_connector_hdmi_init_null_product
[04:36:43] [PASSED] drm_test_connector_hdmi_init_null_vendor
[04:36:43] [PASSED] drm_test_connector_hdmi_init_product_length_exact
[04:36:43] [PASSED] drm_test_connector_hdmi_init_product_length_too_long
[04:36:43] [PASSED] drm_test_connector_hdmi_init_product_valid
[04:36:43] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact
[04:36:43] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long
[04:36:43] [PASSED] drm_test_connector_hdmi_init_vendor_valid
[04:36:43] ========= drm_test_connector_hdmi_init_type_valid =========
[04:36:43] [PASSED] HDMI-A
[04:36:43] [PASSED] HDMI-B
[04:36:43] ===== [PASSED] drm_test_connector_hdmi_init_type_valid =====
[04:36:43] ======== drm_test_connector_hdmi_init_type_invalid ========
[04:36:43] [PASSED] Unknown
[04:36:43] [PASSED] VGA
[04:36:43] [PASSED] DVI-I
[04:36:43] [PASSED] DVI-D
[04:36:43] [PASSED] DVI-A
[04:36:43] [PASSED] Composite
[04:36:43] [PASSED] SVIDEO
[04:36:43] [PASSED] LVDS
[04:36:43] [PASSED] Component
[04:36:43] [PASSED] DIN
[04:36:43] [PASSED] DP
[04:36:43] [PASSED] TV
[04:36:43] [PASSED] eDP
[04:36:43] [PASSED] Virtual
[04:36:43] [PASSED] DSI
[04:36:43] [PASSED] DPI
[04:36:43] [PASSED] Writeback
[04:36:43] [PASSED] SPI
[04:36:43] [PASSED] USB
[04:36:43] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ====
[04:36:43] ============ [PASSED] drmm_connector_hdmi_init =============
[04:36:43] ============= drmm_connector_init (3 subtests) =============
[04:36:43] [PASSED] drm_test_drmm_connector_init
[04:36:43] [PASSED] drm_test_drmm_connector_init_null_ddc
[04:36:43] ========= drm_test_drmm_connector_init_type_valid =========
[04:36:43] [PASSED] Unknown
[04:36:43] [PASSED] VGA
[04:36:43] [PASSED] DVI-I
[04:36:43] [PASSED] DVI-D
[04:36:43] [PASSED] DVI-A
[04:36:43] [PASSED] Composite
[04:36:43] [PASSED] SVIDEO
[04:36:43] [PASSED] LVDS
[04:36:43] [PASSED] Component
[04:36:43] [PASSED] DIN
[04:36:43] [PASSED] DP
[04:36:43] [PASSED] HDMI-A
[04:36:43] [PASSED] HDMI-B
[04:36:43] [PASSED] TV
[04:36:43] [PASSED] eDP
[04:36:43] [PASSED] Virtual
[04:36:43] [PASSED] DSI
[04:36:43] [PASSED] DPI
[04:36:43] [PASSED] Writeback
[04:36:43] [PASSED] SPI
[04:36:43] [PASSED] USB
[04:36:43] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[04:36:43] =============== [PASSED] drmm_connector_init ===============
[04:36:43] ========= drm_connector_dynamic_init (6 subtests) ==========
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_init
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_init_not_added
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_init_properties
[04:36:43] ===== drm_test_drm_connector_dynamic_init_type_valid ======
[04:36:43] [PASSED] Unknown
[04:36:43] [PASSED] VGA
[04:36:43] [PASSED] DVI-I
[04:36:43] [PASSED] DVI-D
[04:36:43] [PASSED] DVI-A
[04:36:43] [PASSED] Composite
[04:36:43] [PASSED] SVIDEO
[04:36:43] [PASSED] LVDS
[04:36:43] [PASSED] Component
[04:36:43] [PASSED] DIN
[04:36:43] [PASSED] DP
[04:36:43] [PASSED] HDMI-A
[04:36:43] [PASSED] HDMI-B
[04:36:43] [PASSED] TV
[04:36:43] [PASSED] eDP
[04:36:43] [PASSED] Virtual
[04:36:43] [PASSED] DSI
[04:36:43] [PASSED] DPI
[04:36:43] [PASSED] Writeback
[04:36:43] [PASSED] SPI
[04:36:43] [PASSED] USB
[04:36:43] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid ==
[04:36:43] ======== drm_test_drm_connector_dynamic_init_name =========
[04:36:43] [PASSED] Unknown
[04:36:43] [PASSED] VGA
[04:36:43] [PASSED] DVI-I
[04:36:43] [PASSED] DVI-D
[04:36:43] [PASSED] DVI-A
[04:36:43] [PASSED] Composite
[04:36:43] [PASSED] SVIDEO
[04:36:43] [PASSED] LVDS
[04:36:43] [PASSED] Component
[04:36:43] [PASSED] DIN
[04:36:43] [PASSED] DP
[04:36:43] [PASSED] HDMI-A
[04:36:43] [PASSED] HDMI-B
[04:36:43] [PASSED] TV
[04:36:43] [PASSED] eDP
[04:36:43] [PASSED] Virtual
[04:36:43] [PASSED] DSI
[04:36:43] [PASSED] DPI
[04:36:43] [PASSED] Writeback
[04:36:43] [PASSED] SPI
[04:36:43] [PASSED] USB
[04:36:43] ==== [PASSED] drm_test_drm_connector_dynamic_init_name =====
[04:36:43] =========== [PASSED] drm_connector_dynamic_init ============
[04:36:43] ==== drm_connector_dynamic_register_early (4 subtests) =====
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_early_defer
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object
[04:36:43] ====== [PASSED] drm_connector_dynamic_register_early =======
[04:36:43] ======= drm_connector_dynamic_register (7 subtests) ========
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_on_list
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_no_defer
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_no_init
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_mode_object
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_sysfs
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name
[04:36:43] [PASSED] drm_test_drm_connector_dynamic_register_debugfs
[04:36:43] ========= [PASSED] drm_connector_dynamic_register ==========
[04:36:43] = drm_connector_attach_broadcast_rgb_property (2 subtests) =
[04:36:43] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property
[04:36:43] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector
[04:36:43] === [PASSED] drm_connector_attach_broadcast_rgb_property ===
[04:36:43] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[04:36:43] ========== drm_test_get_tv_mode_from_name_valid ===========
[04:36:43] [PASSED] NTSC
[04:36:43] [PASSED] NTSC-443
[04:36:43] [PASSED] NTSC-J
[04:36:43] [PASSED] PAL
[04:36:43] [PASSED] PAL-M
[04:36:43] [PASSED] PAL-N
[04:36:43] [PASSED] SECAM
[04:36:43] [PASSED] Mono
[04:36:43] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[04:36:43] [PASSED] drm_test_get_tv_mode_from_name_truncated
[04:36:43] ============ [PASSED] drm_get_tv_mode_from_name ============
[04:36:43] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) =
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1
[04:36:43] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double
[04:36:43] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid =
[04:36:43] [PASSED] VIC 96
[04:36:43] [PASSED] VIC 97
[04:36:43] [PASSED] VIC 101
[04:36:43] [PASSED] VIC 102
[04:36:43] [PASSED] VIC 106
[04:36:43] [PASSED] VIC 107
[04:36:43] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid ===
[04:36:43] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc
[04:36:43] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc
[04:36:43] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc
[04:36:43] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc
[04:36:43] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc
[04:36:43] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ====
[04:36:43] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) ==
[04:36:43] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name ====
[04:36:43] [PASSED] Automatic
[04:36:43] [PASSED] Full
[04:36:43] [PASSED] Limited 16:235
[04:36:43] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name ===
[04:36:43] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid
[04:36:43] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ====
[04:36:43] == drm_hdmi_connector_get_output_format_name (2 subtests) ==
[04:36:43] === drm_test_drm_hdmi_connector_get_output_format_name ====
[04:36:43] [PASSED] RGB
[04:36:43] [PASSED] YUV 4:2:0
[04:36:43] [PASSED] YUV 4:2:2
[04:36:43] [PASSED] YUV 4:4:4
[04:36:43] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name ===
[04:36:43] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid
[04:36:43] ==== [PASSED] drm_hdmi_connector_get_output_format_name ====
[04:36:43] ============= drm_damage_helper (21 subtests) ==============
[04:36:43] [PASSED] drm_test_damage_iter_no_damage
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_src_moved
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_not_visible
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[04:36:43] [PASSED] drm_test_damage_iter_no_damage_no_fb
[04:36:43] [PASSED] drm_test_damage_iter_simple_damage
[04:36:43] [PASSED] drm_test_damage_iter_single_damage
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_outside_src
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_src_moved
[04:36:43] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[04:36:43] [PASSED] drm_test_damage_iter_damage
[04:36:43] [PASSED] drm_test_damage_iter_damage_one_intersect
[04:36:43] [PASSED] drm_test_damage_iter_damage_one_outside
[04:36:43] [PASSED] drm_test_damage_iter_damage_src_moved
[04:36:43] [PASSED] drm_test_damage_iter_damage_not_visible
[04:36:43] ================ [PASSED] drm_damage_helper ================
[04:36:43] ============== drm_dp_mst_helper (3 subtests) ==============
[04:36:43] ============== drm_test_dp_mst_calc_pbn_mode ==============
[04:36:43] [PASSED] Clock 154000 BPP 30 DSC disabled
[04:36:43] [PASSED] Clock 234000 BPP 30 DSC disabled
[04:36:43] [PASSED] Clock 297000 BPP 24 DSC disabled
[04:36:43] [PASSED] Clock 332880 BPP 24 DSC enabled
[04:36:43] [PASSED] Clock 324540 BPP 24 DSC enabled
[04:36:43] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[04:36:43] ============== drm_test_dp_mst_calc_pbn_div ===============
[04:36:43] [PASSED] Link rate 2000000 lane count 4
[04:36:43] [PASSED] Link rate 2000000 lane count 2
[04:36:43] [PASSED] Link rate 2000000 lane count 1
[04:36:43] [PASSED] Link rate 1350000 lane count 4
[04:36:43] [PASSED] Link rate 1350000 lane count 2
[04:36:43] [PASSED] Link rate 1350000 lane count 1
[04:36:43] [PASSED] Link rate 1000000 lane count 4
[04:36:43] [PASSED] Link rate 1000000 lane count 2
[04:36:43] [PASSED] Link rate 1000000 lane count 1
[04:36:43] [PASSED] Link rate 810000 lane count 4
[04:36:43] [PASSED] Link rate 810000 lane count 2
[04:36:43] [PASSED] Link rate 810000 lane count 1
[04:36:43] [PASSED] Link rate 540000 lane count 4
[04:36:43] [PASSED] Link rate 540000 lane count 2
[04:36:43] [PASSED] Link rate 540000 lane count 1
[04:36:43] [PASSED] Link rate 270000 lane count 4
[04:36:43] [PASSED] Link rate 270000 lane count 2
[04:36:43] [PASSED] Link rate 270000 lane count 1
[04:36:43] [PASSED] Link rate 162000 lane count 4
[04:36:43] [PASSED] Link rate 162000 lane count 2
[04:36:43] [PASSED] Link rate 162000 lane count 1
[04:36:43] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[04:36:43] ========= drm_test_dp_mst_sideband_msg_req_decode =========
[04:36:43] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[04:36:43] [PASSED] DP_POWER_UP_PHY with port number
[04:36:43] [PASSED] DP_POWER_DOWN_PHY with port number
[04:36:43] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[04:36:43] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[04:36:43] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[04:36:43] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[04:36:43] [PASSED] DP_QUERY_PAYLOAD with port number
[04:36:43] [PASSED] DP_QUERY_PAYLOAD with VCPI
[04:36:43] [PASSED] DP_REMOTE_DPCD_READ with port number
[04:36:43] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[04:36:43] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[04:36:43] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[04:36:43] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[04:36:43] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[04:36:43] [PASSED] DP_REMOTE_I2C_READ with port number
[04:36:43] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[04:36:43] [PASSED] DP_REMOTE_I2C_READ with transactions array
[04:36:43] [PASSED] DP_REMOTE_I2C_WRITE with port number
[04:36:43] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[04:36:43] [PASSED] DP_REMOTE_I2C_WRITE with data array
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[04:36:43] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[04:36:43] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[04:36:43] ================ [PASSED] drm_dp_mst_helper ================
[04:36:43] ================== drm_exec (7 subtests) ===================
[04:36:43] [PASSED] sanitycheck
[04:36:43] [PASSED] test_lock
[04:36:43] [PASSED] test_lock_unlock
[04:36:43] [PASSED] test_duplicates
[04:36:43] [PASSED] test_prepare
[04:36:43] [PASSED] test_prepare_array
[04:36:43] [PASSED] test_multiple_loops
[04:36:43] ==================== [PASSED] drm_exec =====================
[04:36:43] =========== drm_format_helper_test (17 subtests) ===========
[04:36:43] ============== drm_test_fb_xrgb8888_to_gray8 ==============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[04:36:43] ============= drm_test_fb_xrgb8888_to_rgb332 ==============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[04:36:43] ============= drm_test_fb_xrgb8888_to_rgb565 ==============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[04:36:43] ============ drm_test_fb_xrgb8888_to_xrgb1555 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[04:36:43] ============ drm_test_fb_xrgb8888_to_argb1555 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[04:36:43] ============ drm_test_fb_xrgb8888_to_rgba5551 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[04:36:43] ============= drm_test_fb_xrgb8888_to_rgb888 ==============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[04:36:43] ============= drm_test_fb_xrgb8888_to_bgr888 ==============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ==========
[04:36:43] ============ drm_test_fb_xrgb8888_to_argb8888 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[04:36:43] =========== drm_test_fb_xrgb8888_to_xrgb2101010 ===========
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[04:36:43] =========== drm_test_fb_xrgb8888_to_argb2101010 ===========
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[04:36:43] ============== drm_test_fb_xrgb8888_to_mono ===============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[04:36:43] ==================== drm_test_fb_swab =====================
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ================ [PASSED] drm_test_fb_swab =================
[04:36:43] ============ drm_test_fb_xrgb8888_to_xbgr8888 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[04:36:43] ============ drm_test_fb_xrgb8888_to_abgr8888 =============
[04:36:43] [PASSED] single_pixel_source_buffer
[04:36:43] [PASSED] single_pixel_clip_rectangle
[04:36:43] [PASSED] well_known_colors
[04:36:43] [PASSED] destination_pitch
[04:36:43] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[04:36:43] ================= drm_test_fb_clip_offset =================
[04:36:43] [PASSED] pass through
[04:36:43] [PASSED] horizontal offset
[04:36:43] [PASSED] vertical offset
[04:36:43] [PASSED] horizontal and vertical offset
[04:36:43] [PASSED] horizontal offset (custom pitch)
[04:36:43] [PASSED] vertical offset (custom pitch)
[04:36:43] [PASSED] horizontal and vertical offset (custom pitch)
[04:36:43] ============= [PASSED] drm_test_fb_clip_offset =============
[04:36:43] =================== drm_test_fb_memcpy ====================
[04:36:43] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[04:36:43] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[04:36:43] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[04:36:43] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[04:36:43] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[04:36:43] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[04:36:43] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[04:36:43] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[04:36:43] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[04:36:43] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[04:36:43] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[04:36:43] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[04:36:43] =============== [PASSED] drm_test_fb_memcpy ================
[04:36:43] ============= [PASSED] drm_format_helper_test ==============
[04:36:43] ================= drm_format (18 subtests) =================
[04:36:43] [PASSED] drm_test_format_block_width_invalid
[04:36:43] [PASSED] drm_test_format_block_width_one_plane
[04:36:43] [PASSED] drm_test_format_block_width_two_plane
[04:36:43] [PASSED] drm_test_format_block_width_three_plane
[04:36:43] [PASSED] drm_test_format_block_width_tiled
[04:36:43] [PASSED] drm_test_format_block_height_invalid
[04:36:43] [PASSED] drm_test_format_block_height_one_plane
[04:36:43] [PASSED] drm_test_format_block_height_two_plane
[04:36:43] [PASSED] drm_test_format_block_height_three_plane
[04:36:43] [PASSED] drm_test_format_block_height_tiled
[04:36:43] [PASSED] drm_test_format_min_pitch_invalid
[04:36:43] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[04:36:43] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[04:36:43] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[04:36:43] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[04:36:43] [PASSED] drm_test_format_min_pitch_two_plane
[04:36:43] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[04:36:43] [PASSED] drm_test_format_min_pitch_tiled
[04:36:43] =================== [PASSED] drm_format ====================
[04:36:43] ============== drm_framebuffer (10 subtests) ===============
[04:36:43] ========== drm_test_framebuffer_check_src_coords ==========
[04:36:43] [PASSED] Success: source fits into fb
[04:36:43] [PASSED] Fail: overflowing fb with x-axis coordinate
[04:36:43] [PASSED] Fail: overflowing fb with y-axis coordinate
[04:36:43] [PASSED] Fail: overflowing fb with source width
[04:36:43] [PASSED] Fail: overflowing fb with source height
[04:36:43] ====== [PASSED] drm_test_framebuffer_check_src_coords ======
[04:36:43] [PASSED] drm_test_framebuffer_cleanup
[04:36:43] =============== drm_test_framebuffer_create ===============
[04:36:43] [PASSED] ABGR8888 normal sizes
[04:36:43] [PASSED] ABGR8888 max sizes
[04:36:43] [PASSED] ABGR8888 pitch greater than min required
[04:36:43] [PASSED] ABGR8888 pitch less than min required
[04:36:43] [PASSED] ABGR8888 Invalid width
[04:36:43] [PASSED] ABGR8888 Invalid buffer handle
[04:36:43] [PASSED] No pixel format
[04:36:43] [PASSED] ABGR8888 Width 0
[04:36:43] [PASSED] ABGR8888 Height 0
[04:36:43] [PASSED] ABGR8888 Out of bound height * pitch combination
[04:36:43] [PASSED] ABGR8888 Large buffer offset
[04:36:43] [PASSED] ABGR8888 Buffer offset for inexistent plane
[04:36:43] [PASSED] ABGR8888 Invalid flag
[04:36:43] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[04:36:43] [PASSED] ABGR8888 Valid buffer modifier
[04:36:43] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[04:36:43] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] NV12 Normal sizes
[04:36:43] [PASSED] NV12 Max sizes
[04:36:43] [PASSED] NV12 Invalid pitch
[04:36:43] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[04:36:43] [PASSED] NV12 different modifier per-plane
[04:36:43] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[04:36:43] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] NV12 Modifier for inexistent plane
[04:36:43] [PASSED] NV12 Handle for inexistent plane
[04:36:43] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[04:36:43] [PASSED] YVU420 Normal sizes
[04:36:43] [PASSED] YVU420 Max sizes
[04:36:43] [PASSED] YVU420 Invalid pitch
[04:36:43] [PASSED] YVU420 Different pitches
[04:36:43] [PASSED] YVU420 Different buffer offsets/pitches
[04:36:43] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[04:36:43] [PASSED] YVU420 Valid modifier
[04:36:43] [PASSED] YVU420 Different modifiers per plane
[04:36:43] [PASSED] YVU420 Modifier for inexistent plane
[04:36:43] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)
[04:36:43] [PASSED] X0L2 Normal sizes
[04:36:43] [PASSED] X0L2 Max sizes
[04:36:43] [PASSED] X0L2 Invalid pitch
[04:36:43] [PASSED] X0L2 Pitch greater than minimum required
[04:36:43] [PASSED] X0L2 Handle for inexistent plane
[04:36:43] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[04:36:43] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[04:36:43] [PASSED] X0L2 Valid modifier
[04:36:43] [PASSED] X0L2 Modifier for inexistent plane
[04:36:43] =========== [PASSED] drm_test_framebuffer_create ===========
[04:36:43] [PASSED] drm_test_framebuffer_free
[04:36:43] [PASSED] drm_test_framebuffer_init
[04:36:43] [PASSED] drm_test_framebuffer_init_bad_format
[04:36:43] [PASSED] drm_test_framebuffer_init_dev_mismatch
[04:36:43] [PASSED] drm_test_framebuffer_lookup
[04:36:43] [PASSED] drm_test_framebuffer_lookup_inexistent
[04:36:43] [PASSED] drm_test_framebuffer_modifiers_not_supported
[04:36:43] ================= [PASSED] drm_framebuffer =================
[04:36:43] ================ drm_gem_shmem (8 subtests) ================
[04:36:43] [PASSED] drm_gem_shmem_test_obj_create
[04:36:43] [PASSED] drm_gem_shmem_test_obj_create_private
[04:36:43] [PASSED] drm_gem_shmem_test_pin_pages
[04:36:43] [PASSED] drm_gem_shmem_test_vmap
[04:36:43] [PASSED] drm_gem_shmem_test_get_pages_sgt
[04:36:43] [PASSED] drm_gem_shmem_test_get_sg_table
[04:36:43] [PASSED] drm_gem_shmem_test_madvise
[04:36:43] [PASSED] drm_gem_shmem_test_purge
[04:36:43] ================== [PASSED] drm_gem_shmem ==================
[04:36:43] === drm_atomic_helper_connector_hdmi_check (27 subtests) ===
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1
[04:36:43] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420 =======
[04:36:43] [PASSED] Automatic
[04:36:43] [PASSED] Full
[04:36:43] [PASSED] Limited 16:235
[04:36:43] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 ===
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed
[04:36:43] [PASSED] drm_test_check_disable_connector
[04:36:43] [PASSED] drm_test_check_hdmi_funcs_reject_rate
[04:36:43] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb
[04:36:43] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420
[04:36:43] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422
[04:36:43] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420
[04:36:43] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420
[04:36:43] [PASSED] drm_test_check_output_bpc_crtc_mode_changed
[04:36:43] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed
[04:36:43] [PASSED] drm_test_check_output_bpc_dvi
[04:36:43] [PASSED] drm_test_check_output_bpc_format_vic_1
[04:36:43] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only
[04:36:43] [PASSED] drm_test_check_output_bpc_format_display_rgb_only
[04:36:43] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only
[04:36:43] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only
[04:36:43] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc
[04:36:43] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc
[04:36:43] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc
[04:36:43] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ======
[04:36:43] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ====
[04:36:43] [PASSED] drm_test_check_broadcast_rgb_value
[04:36:43] [PASSED] drm_test_check_bpc_8_value
[04:36:43] [PASSED] drm_test_check_bpc_10_value
[04:36:43] [PASSED] drm_test_check_bpc_12_value
[04:36:43] [PASSED] drm_test_check_format_value
[04:36:43] [PASSED] drm_test_check_tmds_char_value
[04:36:43] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ======
[04:36:43] = drm_atomic_helper_connector_hdmi_mode_valid (4 subtests) =
[04:36:43] [PASSED] drm_test_check_mode_valid
[04:36:43] [PASSED] drm_test_check_mode_valid_reject
[04:36:43] [PASSED] drm_test_check_mode_valid_reject_rate
[04:36:43] [PASSED] drm_test_check_mode_valid_reject_max_clock
[04:36:43] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid ===
[04:36:43] ================= drm_managed (2 subtests) =================
[04:36:43] [PASSED] drm_test_managed_release_action
[04:36:43] [PASSED] drm_test_managed_run_action
[04:36:43] =================== [PASSED] drm_managed ===================
[04:36:43] =================== drm_mm (6 subtests) ====================
[04:36:43] [PASSED] drm_test_mm_init
[04:36:43] [PASSED] drm_test_mm_debug
[04:36:43] [PASSED] drm_test_mm_align32
[04:36:43] [PASSED] drm_test_mm_align64
[04:36:43] [PASSED] drm_test_mm_lowest
[04:36:43] [PASSED] drm_test_mm_highest
[04:36:43] ===================== [PASSED] drm_mm ======================
[04:36:43] ============= drm_modes_analog_tv (5 subtests) =============
[04:36:43] [PASSED] drm_test_modes_analog_tv_mono_576i
[04:36:43] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[04:36:43] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[04:36:43] [PASSED] drm_test_modes_analog_tv_pal_576i
[04:36:43] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[04:36:43] =============== [PASSED] drm_modes_analog_tv ===============
[04:36:43] ============== drm_plane_helper (2 subtests) ===============
[04:36:43] =============== drm_test_check_plane_state ================
[04:36:43] [PASSED] clipping_simple
[04:36:43] [PASSED] clipping_rotate_reflect
[04:36:43] [PASSED] positioning_simple
[04:36:43] [PASSED] upscaling
[04:36:43] [PASSED] downscaling
[04:36:43] [PASSED] rounding1
[04:36:43] [PASSED] rounding2
[04:36:43] [PASSED] rounding3
[04:36:43] [PASSED] rounding4
[04:36:43] =========== [PASSED] drm_test_check_plane_state ============
[04:36:43] =========== drm_test_check_invalid_plane_state ============
[04:36:43] [PASSED] positioning_invalid
[04:36:43] [PASSED] upscaling_invalid
[04:36:43] [PASSED] downscaling_invalid
[04:36:43] ======= [PASSED] drm_test_check_invalid_plane_state ========
[04:36:43] ================ [PASSED] drm_plane_helper =================
[04:36:43] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[04:36:43] ====== drm_test_connector_helper_tv_get_modes_check =======
[04:36:43] [PASSED] None
[04:36:43] [PASSED] PAL
[04:36:43] [PASSED] NTSC
[04:36:43] [PASSED] Both, NTSC Default
[04:36:43] [PASSED] Both, PAL Default
[04:36:43] [PASSED] Both, NTSC Default, with PAL on command-line
[04:36:43] [PASSED] Both, PAL Default, with NTSC on command-line
[04:36:43] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[04:36:43] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[04:36:43] ================== drm_rect (9 subtests) ===================
[04:36:43] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[04:36:43] [PASSED] drm_test_rect_clip_scaled_not_clipped
[04:36:43] [PASSED] drm_test_rect_clip_scaled_clipped
[04:36:43] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[04:36:43] ================= drm_test_rect_intersect =================
[04:36:43] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[04:36:43] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[04:36:43] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[04:36:43] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[04:36:43] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[04:36:43] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[04:36:43] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[04:36:43] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[04:36:43] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[04:36:43] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[04:36:43] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[04:36:43] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[04:36:43] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[04:36:43] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[04:36:43] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
[04:36:43] ============= [PASSED] drm_test_rect_intersect =============
[04:36:43] ================ drm_test_rect_calc_hscale ================
[04:36:43] [PASSED] normal use
[04:36:43] [PASSED] out of max range
[04:36:43] [PASSED] out of min range
[04:36:43] [PASSED] zero dst
[04:36:43] [PASSED] negative src
[04:36:43] [PASSED] negative dst
[04:36:43] ============ [PASSED] drm_test_rect_calc_hscale ============
[04:36:43] ================ drm_test_rect_calc_vscale ================
[04:36:43] [PASSED] normal use
stty: 'standard input': Inappropriate ioctl for device
[04:36:43] [PASSED] out of max range
[04:36:43] [PASSED] out of min range
[04:36:43] [PASSED] zero dst
[04:36:43] [PASSED] negative src
[04:36:43] [PASSED] negative dst
[04:36:43] ============ [PASSED] drm_test_rect_calc_vscale ============
[04:36:43] ================== drm_test_rect_rotate ===================
[04:36:43] [PASSED] reflect-x
[04:36:43] [PASSED] reflect-y
[04:36:43] [PASSED] rotate-0
[04:36:43] [PASSED] rotate-90
[04:36:43] [PASSED] rotate-180
[04:36:43] [PASSED] rotate-270
[04:36:43] ============== [PASSED] drm_test_rect_rotate ===============
[04:36:43] ================ drm_test_rect_rotate_inv =================
[04:36:43] [PASSED] reflect-x
[04:36:43] [PASSED] reflect-y
[04:36:43] [PASSED] rotate-0
[04:36:43] [PASSED] rotate-90
[04:36:43] [PASSED] rotate-180
[04:36:43] [PASSED] rotate-270
[04:36:43] ============ [PASSED] drm_test_rect_rotate_inv =============
[04:36:43] ==================== [PASSED] drm_rect =====================
[04:36:43] ============ drm_sysfb_modeset_test (1 subtest) ============
[04:36:43] ============ drm_test_sysfb_build_fourcc_list =============
[04:36:43] [PASSED] no native formats
[04:36:43] [PASSED] XRGB8888 as native format
[04:36:43] [PASSED] remove duplicates
[04:36:43] [PASSED] convert alpha formats
[04:36:43] [PASSED] random formats
[04:36:43] ======== [PASSED] drm_test_sysfb_build_fourcc_list =========
[04:36:43] ============= [PASSED] drm_sysfb_modeset_test ==============
[04:36:43] ============================================================
[04:36:43] Testing complete. Ran 622 tests: passed: 622
[04:36:44] Elapsed time: 31.318s total, 1.607s configuring, 29.193s building, 0.467s running
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig
[04:36:44] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[04:36:45] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
[04:36:54] Starting KUnit Kernel (1/1)...
[04:36:54] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[04:36:54] ================= ttm_device (5 subtests) ==================
[04:36:54] [PASSED] ttm_device_init_basic
[04:36:54] [PASSED] ttm_device_init_multiple
[04:36:54] [PASSED] ttm_device_fini_basic
[04:36:54] [PASSED] ttm_device_init_no_vma_man
[04:36:54] ================== ttm_device_init_pools ==================
[04:36:54] [PASSED] No DMA allocations, no DMA32 required
[04:36:54] [PASSED] DMA allocations, DMA32 required
[04:36:54] [PASSED] No DMA allocations, DMA32 required
[04:36:54] [PASSED] DMA allocations, no DMA32 required
[04:36:54] ============== [PASSED] ttm_device_init_pools ==============
[04:36:54] =================== [PASSED] ttm_device ====================
[04:36:54] ================== ttm_pool (8 subtests) ===================
[04:36:54] ================== ttm_pool_alloc_basic ===================
[04:36:54] [PASSED] One page
[04:36:54] [PASSED] More than one page
[04:36:54] [PASSED] Above the allocation limit
[04:36:54] [PASSED] One page, with coherent DMA mappings enabled
[04:36:54] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[04:36:54] ============== [PASSED] ttm_pool_alloc_basic ===============
[04:36:54] ============== ttm_pool_alloc_basic_dma_addr ==============
[04:36:54] [PASSED] One page
[04:36:54] [PASSED] More than one page
[04:36:54] [PASSED] Above the allocation limit
[04:36:54] [PASSED] One page, with coherent DMA mappings enabled
[04:36:54] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[04:36:54] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[04:36:54] [PASSED] ttm_pool_alloc_order_caching_match
[04:36:54] [PASSED] ttm_pool_alloc_caching_mismatch
[04:36:54] [PASSED] ttm_pool_alloc_order_mismatch
[04:36:54] [PASSED] ttm_pool_free_dma_alloc
[04:36:54] [PASSED] ttm_pool_free_no_dma_alloc
[04:36:54] [PASSED] ttm_pool_fini_basic
[04:36:54] ==================== [PASSED] ttm_pool =====================
[04:36:54] ================ ttm_resource (8 subtests) =================
[04:36:54] ================= ttm_resource_init_basic =================
[04:36:54] [PASSED] Init resource in TTM_PL_SYSTEM
[04:36:54] [PASSED] Init resource in TTM_PL_VRAM
[04:36:54] [PASSED] Init resource in a private placement
[04:36:54] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[04:36:54] ============= [PASSED] ttm_resource_init_basic =============
[04:36:54] [PASSED] ttm_resource_init_pinned
[04:36:54] [PASSED] ttm_resource_fini_basic
[04:36:54] [PASSED] ttm_resource_manager_init_basic
[04:36:54] [PASSED] ttm_resource_manager_usage_basic
[04:36:54] [PASSED] ttm_resource_manager_set_used_basic
[04:36:54] [PASSED] ttm_sys_man_alloc_basic
[04:36:54] [PASSED] ttm_sys_man_free_basic
[04:36:54] ================== [PASSED] ttm_resource ===================
[04:36:54] =================== ttm_tt (15 subtests) ===================
[04:36:54] ==================== ttm_tt_init_basic ====================
[04:36:54] [PASSED] Page-aligned size
[04:36:54] [PASSED] Extra pages requested
[04:36:54] ================ [PASSED] ttm_tt_init_basic ================
[04:36:54] [PASSED] ttm_tt_init_misaligned
[04:36:54] [PASSED] ttm_tt_fini_basic
[04:36:54] [PASSED] ttm_tt_fini_sg
[04:36:54] [PASSED] ttm_tt_fini_shmem
[04:36:54] [PASSED] ttm_tt_create_basic
[04:36:54] [PASSED] ttm_tt_create_invalid_bo_type
[04:36:54] [PASSED] ttm_tt_create_ttm_exists
[04:36:54] [PASSED] ttm_tt_create_failed
[04:36:54] [PASSED] ttm_tt_destroy_basic
[04:36:54] [PASSED] ttm_tt_populate_null_ttm
[04:36:54] [PASSED] ttm_tt_populate_populated_ttm
[04:36:54] [PASSED] ttm_tt_unpopulate_basic
[04:36:54] [PASSED] ttm_tt_unpopulate_empty_ttm
[04:36:54] [PASSED] ttm_tt_swapin_basic
[04:36:54] ===================== [PASSED] ttm_tt ======================
[04:36:54] =================== ttm_bo (14 subtests) ===================
[04:36:54] =========== ttm_bo_reserve_optimistic_no_ticket ===========
[04:36:54] [PASSED] Cannot be interrupted and sleeps
[04:36:54] [PASSED] Cannot be interrupted, locks straight away
[04:36:54] [PASSED] Can be interrupted, sleeps
[04:36:54] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[04:36:54] [PASSED] ttm_bo_reserve_locked_no_sleep
[04:36:54] [PASSED] ttm_bo_reserve_no_wait_ticket
[04:36:54] [PASSED] ttm_bo_reserve_double_resv
[04:36:54] [PASSED] ttm_bo_reserve_interrupted
[04:36:54] [PASSED] ttm_bo_reserve_deadlock
[04:36:54] [PASSED] ttm_bo_unreserve_basic
[04:36:54] [PASSED] ttm_bo_unreserve_pinned
[04:36:54] [PASSED] ttm_bo_unreserve_bulk
[04:36:54] [PASSED] ttm_bo_fini_basic
[04:36:54] [PASSED] ttm_bo_fini_shared_resv
[04:36:54] [PASSED] ttm_bo_pin_basic
[04:36:54] [PASSED] ttm_bo_pin_unpin_resource
[04:36:54] [PASSED] ttm_bo_multiple_pin_one_unpin
[04:36:54] ===================== [PASSED] ttm_bo ======================
[04:36:54] ============== ttm_bo_validate (21 subtests) ===============
[04:36:54] ============== ttm_bo_init_reserved_sys_man ===============
[04:36:54] [PASSED] Buffer object for userspace
[04:36:54] [PASSED] Kernel buffer object
[04:36:54] [PASSED] Shared buffer object
[04:36:54] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[04:36:54] ============== ttm_bo_init_reserved_mock_man ==============
[04:36:54] [PASSED] Buffer object for userspace
[04:36:54] [PASSED] Kernel buffer object
[04:36:54] [PASSED] Shared buffer object
[04:36:54] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[04:36:54] [PASSED] ttm_bo_init_reserved_resv
[04:36:54] ================== ttm_bo_validate_basic ==================
[04:36:54] [PASSED] Buffer object for userspace
[04:36:54] [PASSED] Kernel buffer object
[04:36:54] [PASSED] Shared buffer object
[04:36:54] ============== [PASSED] ttm_bo_validate_basic ==============
[04:36:54] [PASSED] ttm_bo_validate_invalid_placement
[04:36:54] ============= ttm_bo_validate_same_placement ==============
[04:36:54] [PASSED] System manager
[04:36:54] [PASSED] VRAM manager
[04:36:54] ========= [PASSED] ttm_bo_validate_same_placement ==========
[04:36:54] [PASSED] ttm_bo_validate_failed_alloc
[04:36:54] [PASSED] ttm_bo_validate_pinned
[04:36:54] [PASSED] ttm_bo_validate_busy_placement
[04:36:54] ================ ttm_bo_validate_multihop =================
[04:36:54] [PASSED] Buffer object for userspace
[04:36:54] [PASSED] Kernel buffer object
[04:36:54] [PASSED] Shared buffer object
[04:36:54] ============ [PASSED] ttm_bo_validate_multihop =============
[04:36:54] ========== ttm_bo_validate_no_placement_signaled ==========
[04:36:54] [PASSED] Buffer object in system domain, no page vector
[04:36:54] [PASSED] Buffer object in system domain with an existing page vector
[04:36:54] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[04:36:54] ======== ttm_bo_validate_no_placement_not_signaled ========
[04:36:54] [PASSED] Buffer object for userspace
[04:36:54] [PASSED] Kernel buffer object
[04:36:54] [PASSED] Shared buffer object
[04:36:54] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[04:36:54] [PASSED] ttm_bo_validate_move_fence_signaled
[04:36:54] ========= ttm_bo_validate_move_fence_not_signaled =========
[04:36:54] [PASSED] Waits for GPU
[04:36:54] [PASSED] Tries to lock straight away
[04:36:54] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[04:36:54] [PASSED] ttm_bo_validate_happy_evict
[04:36:54] [PASSED] ttm_bo_validate_all_pinned_evict
[04:36:54] [PASSED] ttm_bo_validate_allowed_only_evict
[04:36:54] [PASSED] ttm_bo_validate_deleted_evict
[04:36:54] [PASSED] ttm_bo_validate_busy_domain_evict
[04:36:54] [PASSED] ttm_bo_validate_evict_gutting
[04:36:54] [PASSED] ttm_bo_validate_recrusive_evict
stty: 'standard input': Inappropriate ioctl for device
[04:36:54] ================= [PASSED] ttm_bo_validate =================
[04:36:54] ============================================================
[04:36:54] Testing complete. Ran 101 tests: passed: 101
[04:36:54] Elapsed time: 10.872s total, 1.605s configuring, 9.050s building, 0.183s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
^ permalink raw reply [flat|nested] 44+ messages in thread* ✗ Xe.CI.Full: failure for PF: Add sriov_admin sysfs tree
2025-10-20 18:24 [PATCH 00/14] PF: Add sriov_admin sysfs tree Michal Wajdeczko
` (15 preceding siblings ...)
2025-10-21 4:36 ` ✓ CI.KUnit: success " Patchwork
@ 2025-10-21 10:19 ` Patchwork
16 siblings, 0 replies; 44+ messages in thread
From: Patchwork @ 2025-10-21 10:19 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-xe
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
== Series Details ==
Series: PF: Add sriov_admin sysfs tree
URL : https://patchwork.freedesktop.org/series/156220/
State : failure
== Summary ==
ERROR: The runconfig 'xe-3951-aae2e4df375e567f00c8d494004cf6a34a73d75a_FULL' does not exist in the database
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-156220v1/index.html
[-- Attachment #2: Type: text/html, Size: 926 bytes --]
^ permalink raw reply [flat|nested] 44+ messages in thread