Skip to content

Commit 61926c9

Browse files
committed
Merge tag 'drm-xe-next-2025-11-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
UAPI Changes: Limit number of jobs per exec queue (Shuicheng) Add sriov_admin sysfs tree (Michal) Driver Changes: Fix an uninitialized value (Thomas) Expose a residency counter through debugfs (Mohammed Thasleem) Workaround enabling and improvement (Tapani, Tangudu) More Crescent Island-specific support (Sk Anirban, Lucas) PAT entry dump imprement (Xin) Inline gt_reset in the worker (Lucas) Synchronize GT reset with device unbind (Balasubramani) Do clean shutdown also when using flr (Jouni) Fix serialization on burst of unbinds (Matt Brost) Pagefault Refactor (Matt Brost) Remove some unused code (Gwan-gyeong) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/aQuBECxNOhudc0Bz@fedora
2 parents 2a084f4 + 424e2cc commit 61926c9

55 files changed

Lines changed: 2719 additions & 1256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/
2+
Date: October 2025
3+
KernelVersion: 6.19
4+
Contact: intel-xe@lists.freedesktop.org
5+
Description:
6+
This directory appears for the particular Intel Xe device when:
7+
8+
- device supports SR-IOV, and
9+
- device is a Physical Function (PF), and
10+
- driver support for the SR-IOV PF is enabled on given device.
11+
12+
This directory is used as a root for all attributes required to
13+
manage both Physical Function (PF) and Virtual Functions (VFs).
14+
15+
16+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/
17+
Date: October 2025
18+
KernelVersion: 6.19
19+
Contact: intel-xe@lists.freedesktop.org
20+
Description:
21+
This directory holds attributes related to the SR-IOV Physical
22+
Function (PF).
23+
24+
25+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf1/
26+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf2/
27+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<N>/
28+
Date: October 2025
29+
KernelVersion: 6.19
30+
Contact: intel-xe@lists.freedesktop.org
31+
Description:
32+
These directories hold attributes related to the SR-IOV Virtual
33+
Functions (VFs).
34+
35+
Note that the VF number <N> is 1-based as described in PCI SR-IOV
36+
specification as the Xe driver follows that naming schema.
37+
38+
There could be "vf1", "vf2" and so on, up to "vf<N>", where <N>
39+
matches the value of the "sriov_totalvfs" attribute.
40+
41+
42+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/exec_quantum_ms
43+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/preempt_timeout_us
44+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/profile/sched_priority
45+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/exec_quantum_ms
46+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/preempt_timeout_us
47+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/profile/sched_priority
48+
Date: October 2025
49+
KernelVersion: 6.19
50+
Contact: intel-xe@lists.freedesktop.org
51+
Description:
52+
These files expose scheduling parameters for the PF and its VFs, and
53+
are visible only on Intel Xe platforms that use time-sliced GPU sharing.
54+
They can be changed even if VFs are enabled and running and reflect the
55+
settings of all tiles/GTs assigned to the given function.
56+
57+
exec_quantum_ms: (RW) unsigned integer
58+
The GT execution quantum (EQ) in [ms] for the given function.
59+
Actual quantum value might be aligned per HW/FW requirements.
60+
61+
Default is 0 (unlimited).
62+
63+
preempt_timeout_us: (RW) unsigned integer
64+
The GT preemption timeout in [us] of the given function.
65+
Actual timeout value might be aligned per HW/FW requirements.
66+
67+
Default is 0 (unlimited).
68+
69+
sched_priority: (RW/RO) string
70+
The GT scheduling priority of the given function.
71+
72+
"low" - function will be scheduled on the GPU for its EQ/PT
73+
only if function has any work already submitted.
74+
75+
"normal" - functions will be scheduled on the GPU for its EQ/PT
76+
irrespective of whether it has submitted a work or not.
77+
78+
"high" - function will be scheduled on the GPU for its EQ/PT
79+
in the next time-slice after the current one completes
80+
and function has a work submitted.
81+
82+
Default is "low".
83+
84+
When read, this file will display the current and available
85+
scheduling priorities. The currently active priority level will
86+
be enclosed in square brackets, like:
87+
88+
[low] normal high
89+
90+
This file can be read-only if changing the priority is not
91+
supported.
92+
93+
Writes to these attributes may fail with errors like:
94+
-EINVAL if provided input is malformed or not recognized,
95+
-EPERM if change is not applicable on given HW/FW,
96+
-EIO if FW refuses to change the provisioning.
97+
98+
Reads from these attributes may fail with:
99+
-EUCLEAN if value is not consistent across all tiles/GTs.
100+
101+
102+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/exec_quantum_ms
103+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/preempt_timeout_us
104+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/.bulk_profile/sched_priority
105+
Date: October 2025
106+
KernelVersion: 6.19
107+
Contact: intel-xe@lists.freedesktop.org
108+
Description:
109+
These files allows bulk reconfiguration of the scheduling parameters
110+
of the PF or VFs and are available only for Intel Xe platforms with
111+
GPU sharing based on the time-slice basis. These scheduling parameters
112+
can be changed even if VFs are enabled and running.
113+
114+
exec_quantum_ms: (WO) unsigned integer
115+
The GT execution quantum (EQ) in [ms] to be applied to all functions.
116+
See sriov_admin/{pf,vf<N>}/profile/exec_quantum_ms for more details.
117+
118+
preempt_timeout_us: (WO) unsigned integer
119+
The GT preemption timeout (PT) in [us] to be applied to all functions.
120+
See sriov_admin/{pf,vf<N>}/profile/preempt_timeout_us for more details.
121+
122+
sched_priority: (RW/RO) string
123+
The GT scheduling priority to be applied for all functions.
124+
See sriov_admin/{pf,vf<N>}/profile/sched_priority for more details.
125+
126+
Writes to these attributes may fail with errors like:
127+
-EINVAL if provided input is malformed or not recognized,
128+
-EPERM if change is not applicable on given HW/FW,
129+
-EIO if FW refuses to change the provisioning.
130+
131+
132+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/stop
133+
Date: October 2025
134+
KernelVersion: 6.19
135+
Contact: intel-xe@lists.freedesktop.org
136+
Description:
137+
This file allows to control scheduling of the VF on the Intel Xe GPU
138+
platforms. It allows to implement custom policy mechanism in case VFs
139+
are misbehaving or triggering adverse events above defined thresholds.
140+
141+
stop: (WO) bool
142+
All GT executions of given function shall be immediately stopped.
143+
To allow scheduling this VF again, the VF FLR must be triggered.
144+
145+
Writes to this attribute may fail with errors like:
146+
-EINVAL if provided input is malformed or not recognized,
147+
-EPERM if change is not applicable on given HW/FW,
148+
-EIO if FW refuses to change the scheduling.
149+
150+
151+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/pf/device
152+
What: /sys/bus/pci/drivers/xe/.../sriov_admin/vf<n>/device
153+
Date: October 2025
154+
KernelVersion: 6.19
155+
Contact: intel-xe@lists.freedesktop.org
156+
Description:
157+
These are symlinks to the underlying PCI device entry representing
158+
given Xe SR-IOV function. For the PF, this link is always present.
159+
For VFs, this link is present only for currently enabled VFs.

Documentation/gpu/xe/xe_gt_freq.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Xe GT Frequency Management
77
.. kernel-doc:: drivers/gpu/drm/xe/xe_gt_freq.c
88
:doc: Xe GT Frequency Management
99

10+
.. kernel-doc:: drivers/gpu/drm/xe/xe_gt_throttle.c
11+
:doc: Xe GT Throttle
12+
1013
Internal API
1114
============
1215

drivers/gpu/drm/xe/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ xe-y += xe_bb.o \
5858
xe_gt_freq.o \
5959
xe_gt_idle.o \
6060
xe_gt_mcr.o \
61-
xe_gt_pagefault.o \
6261
xe_gt_sysfs.o \
6362
xe_gt_throttle.o \
6463
xe_gt_topology.o \
@@ -73,6 +72,7 @@ xe-y += xe_bb.o \
7372
xe_guc_id_mgr.o \
7473
xe_guc_klv_helpers.o \
7574
xe_guc_log.o \
75+
xe_guc_pagefault.o \
7676
xe_guc_pc.o \
7777
xe_guc_submit.o \
7878
xe_guc_tlb_inval.o \
@@ -94,6 +94,7 @@ xe-y += xe_bb.o \
9494
xe_nvm.o \
9595
xe_oa.o \
9696
xe_observation.o \
97+
xe_pagefault.o \
9798
xe_pat.o \
9899
xe_pci.o \
99100
xe_pcode.o \
@@ -178,6 +179,7 @@ xe-$(CONFIG_PCI_IOV) += \
178179
xe_sriov_pf_debugfs.o \
179180
xe_sriov_pf_provision.o \
180181
xe_sriov_pf_service.o \
182+
xe_sriov_pf_sysfs.o \
181183
xe_tile_sriov_pf_debugfs.o
182184

183185
# include helpers for tests even when XE is built-in

drivers/gpu/drm/xe/regs/xe_gt_regs.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@
590590
#define GT_GFX_RC6 XE_REG(0x138108)
591591

592592
#define GT0_PERF_LIMIT_REASONS XE_REG(0x1381a8)
593+
/* Common performance limit reason bits - available on all platforms */
593594
#define GT0_PERF_LIMIT_REASONS_MASK 0xde3
594595
#define PROCHOT_MASK REG_BIT(0)
595596
#define THERMAL_LIMIT_MASK REG_BIT(1)
@@ -599,6 +600,18 @@
599600
#define POWER_LIMIT_4_MASK REG_BIT(8)
600601
#define POWER_LIMIT_1_MASK REG_BIT(10)
601602
#define POWER_LIMIT_2_MASK REG_BIT(11)
603+
/* Platform-specific performance limit reason bits - for Crescent Island */
604+
#define CRI_PERF_LIMIT_REASONS_MASK 0xfdff
605+
#define SOC_THERMAL_LIMIT_MASK REG_BIT(1)
606+
#define MEM_THERMAL_MASK REG_BIT(2)
607+
#define VR_THERMAL_MASK REG_BIT(3)
608+
#define ICCMAX_MASK REG_BIT(4)
609+
#define SOC_AVG_THERMAL_MASK REG_BIT(6)
610+
#define FASTVMODE_MASK REG_BIT(7)
611+
#define PSYS_PL1_MASK REG_BIT(12)
612+
#define PSYS_PL2_MASK REG_BIT(13)
613+
#define P0_FREQ_MASK REG_BIT(14)
614+
#define PSYS_CRIT_MASK REG_BIT(15)
602615

603616
#define GT_PERF_STATUS XE_REG(0x1381b4)
604617
#define VOLTAGE_MASK REG_GENMASK(10, 0)

drivers/gpu/drm/xe/regs/xe_pmt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define BMG_MODS_RESIDENCY_OFFSET (0x4D0)
2525
#define BMG_G2_RESIDENCY_OFFSET (0x530)
2626
#define BMG_G6_RESIDENCY_OFFSET (0x538)
27+
#define BMG_G7_RESIDENCY_OFFSET (0x4B0)
2728
#define BMG_G8_RESIDENCY_OFFSET (0x540)
2829
#define BMG_G10_RESIDENCY_OFFSET (0x548)
2930

drivers/gpu/drm/xe/xe_debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
142142
} residencies[] = {
143143
{BMG_G2_RESIDENCY_OFFSET, "Package G2"},
144144
{BMG_G6_RESIDENCY_OFFSET, "Package G6"},
145+
{BMG_G7_RESIDENCY_OFFSET, "Package G7"},
145146
{BMG_G8_RESIDENCY_OFFSET, "Package G8"},
146147
{BMG_G10_RESIDENCY_OFFSET, "Package G10"},
147148
{BMG_MODS_RESIDENCY_OFFSET, "Package ModS"}

drivers/gpu/drm/xe/xe_device.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "xe_nvm.h"
5353
#include "xe_oa.h"
5454
#include "xe_observation.h"
55+
#include "xe_pagefault.h"
5556
#include "xe_pat.h"
5657
#include "xe_pcode.h"
5758
#include "xe_pm.h"
@@ -896,6 +897,10 @@ int xe_device_probe(struct xe_device *xe)
896897
return err;
897898
}
898899

900+
err = xe_pagefault_init(xe);
901+
if (err)
902+
return err;
903+
899904
if (xe->tiles->media_gt &&
900905
XE_GT_WA(xe->tiles->media_gt, 15015404425_disable))
901906
XE_DEVICE_WA_DISABLE(xe, 15015404425);
@@ -988,21 +993,21 @@ void xe_device_remove(struct xe_device *xe)
988993

989994
void xe_device_shutdown(struct xe_device *xe)
990995
{
996+
struct xe_gt *gt;
997+
u8 id;
998+
991999
drm_dbg(&xe->drm, "Shutting down device\n");
9921000

993-
if (xe_driver_flr_disabled(xe)) {
994-
struct xe_gt *gt;
995-
u8 id;
1001+
xe_display_pm_shutdown(xe);
9961002

997-
xe_display_pm_shutdown(xe);
1003+
xe_irq_suspend(xe);
9981004

999-
xe_irq_suspend(xe);
1005+
for_each_gt(gt, xe, id)
1006+
xe_gt_shutdown(gt);
10001007

1001-
for_each_gt(gt, xe, id)
1002-
xe_gt_shutdown(gt);
1008+
xe_display_pm_shutdown_late(xe);
10031009

1004-
xe_display_pm_shutdown_late(xe);
1005-
} else {
1010+
if (!xe_driver_flr_disabled(xe)) {
10061011
/* BOOM! */
10071012
__xe_driver_flr(xe);
10081013
}

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "xe_lmtt_types.h"
1919
#include "xe_memirq_types.h"
2020
#include "xe_oa_types.h"
21+
#include "xe_pagefault_types.h"
2122
#include "xe_platform_types.h"
2223
#include "xe_pmu_types.h"
2324
#include "xe_pt_types.h"
@@ -418,6 +419,16 @@ struct xe_device {
418419
u32 next_asid;
419420
/** @usm.lock: protects UM state */
420421
struct rw_semaphore lock;
422+
/** @usm.pf_wq: page fault work queue, unbound, high priority */
423+
struct workqueue_struct *pf_wq;
424+
/*
425+
* We pick 4 here because, in the current implementation, it
426+
* yields the best bandwidth utilization of the kernel paging
427+
* engine.
428+
*/
429+
#define XE_PAGEFAULT_QUEUE_COUNT 4
430+
/** @usm.pf_queue: Page fault queues */
431+
struct xe_pagefault_queue pf_queue[XE_PAGEFAULT_QUEUE_COUNT];
421432
} usm;
422433

423434
/** @pinned: pinned BO state */

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "xe_sched_job.h"
2222
#include "xe_sync.h"
2323
#include "xe_svm.h"
24+
#include "xe_trace.h"
2425
#include "xe_vm.h"
2526

2627
/**
@@ -154,6 +155,12 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
154155
goto err_exec_queue;
155156
}
156157

158+
if (atomic_read(&q->job_cnt) >= XE_MAX_JOB_COUNT_PER_EXEC_QUEUE) {
159+
trace_xe_exec_queue_reach_max_job_count(q, XE_MAX_JOB_COUNT_PER_EXEC_QUEUE);
160+
err = -EAGAIN;
161+
goto err_exec_queue;
162+
}
163+
157164
if (args->num_syncs) {
158165
syncs = kcalloc(args->num_syncs, sizeof(*syncs), GFP_KERNEL);
159166
if (!syncs) {
@@ -166,7 +173,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
166173

167174
for (num_syncs = 0; num_syncs < args->num_syncs; num_syncs++) {
168175
err = xe_sync_entry_parse(xe, xef, &syncs[num_syncs],
169-
&syncs_user[num_syncs], SYNC_PARSE_FLAG_EXEC |
176+
&syncs_user[num_syncs], NULL, 0,
177+
SYNC_PARSE_FLAG_EXEC |
170178
(xe_vm_in_lr_mode(vm) ?
171179
SYNC_PARSE_FLAG_LR_MODE : 0));
172180
if (err)
@@ -294,10 +302,6 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
294302
goto err_put_job;
295303

296304
if (!xe_vm_in_lr_mode(vm)) {
297-
err = xe_sched_job_last_fence_add_dep(job, vm);
298-
if (err)
299-
goto err_put_job;
300-
301305
err = xe_svm_notifier_lock_interruptible(vm);
302306
if (err)
303307
goto err_put_job;

0 commit comments

Comments
 (0)