Skip to content

Commit 26bb2dc

Browse files
committed
Merge tag 'drm-xe-next-2024-10-10' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Cross-subsystem Changes: - Add drm_line_printer (Michal) Driver Changes: - Fix an UAF (Matt Auld) - Sanity check compression and coherency mode (Matt Auld) - Some PIC-ID work (Jani) - Use IS_ENABLED() instead of defined() on config options. - gt powergating work (Riana) - Suppress missing out ter rpm protection warning (Rodrigo) - Fix a vm leak (Dafna) - Clean up and update 'has_flat_ccs' handling (Lucas) - Fix arg to pci_iomap (Lucas) - Mark reserved engines in shapshot (Lucas) - Don't keep stale pointer (Michal) - Fix build warning with CONFIG_PM=n (Arnd) - Add a xe_bo subtest for shrinking / swapping (Thomas) - Add a warkaround (Tejas) - Some display PM work (Maarten) - Enable Xe2 + PES disaggregation (Ashutosh) - Large xe_mmio rework / cleanup (Matt Roper) - A couple of fixes / cleanups in the xe client code (Matt Auld) - Fix page-fault handling on closed VMs (Matt Brost) - Fix overflow in OA batch buffer (José) - Style fixes (Lucas, Jiapeng, Nitin) - Fixes and new development around SRIOV (Michal) - Use devm_add_action_or_reset() in gt code (He) - Fix CCS offset calculation (Matt Auld) - Remove i915_drv.h include (Rodrigo) - Restore PCI state on resume (Rodrigo) - Fix DSB buffer coherency / Revert DSB disabling (Maarten / Animesh) - Convert USM lock to rwsem (Matt Brost) - Defer gt-mmio intialization (Matt Roper) - meemirq changes (Ilia) - Move some PVC related code out of xe-for-CI and to the driver (Rodrigo / Jani) - Use a helper for ASID->VM lookup (Matt Brost) - Add new PCI id for ARL (Dnyaneshwar) - Use Xe2_LPM steering tables for Xe2_HPM (Gustavo) - Performance tuning work for media GT and L3 cache flushing (Gustavo) - Clean up VM- and exec queue file lock usage (Matt Brost) - GuC locking fix (Matt Auld) - Fix UAF around queue destruction (Matt Auld) - Move IRQ-related registers to dedicated header (Matt Roper) - Resume TDR after GT reset (Matt Brost) - Move xa_alloc to prevent UAF (Matt Auld) - Fix OA stream close (José) - Remove unused i915_gpu_error.h (Jani) - Prevent null pointer access in xe_migrate_copy (Zhanjun) - Fix memory leak when aborting binds (Matt Brost) - Prevent UAF in send_recv() (Matt Auld) - Fix xa_store() error checking (Matt Auld) - drop irq disabling around xa_erase in guc code (Matt Auld) - Use fault injection infrastructure to find issues as probe time (Francois) - Fix a workaround implementation. (Vinay) - Mark wedged_mode debugfs writable (Matt Roper) - Fix for prviewous memirq work (Michal) - More SRIOV work (Michal) - Devcoredump work (John) - GuC logging + devcoredump support (John) - Don't report L3 bank availability on PTL (Shekhar) - Replicate Xe2 PAT settings on Xe2 (Matt Roper) - Define Xe3 feature flags (Haridhar) - Reuse Xe2 MOCS table on on PTL (Haridhar) - Add PTL platform definition (Haridhar) - Add MCR steering for Xe3 (Matt) - More work around GuC capture for devcoredump (Zhanjun) - Improve cache flushing behaviour on bmg (Matt Auld) - Fix shrinker test compiler warnings on 32-bit (Thomas) - Initial set of workarounds for Xe3 (Gustavo) - Extend workaround for xe2lpg (Aradhya) - Fix unbalanced rpm put x 2 (Matt Auld) Signed-off-by: Dave Airlie <[email protected]> # -----BEGIN PGP SIGNATURE----- # # iHUEABYKAB0WIQRskUM7w1oG5rx2IZO4FpNVCsYGvwUCZwekBwAKCRC4FpNVCsYG # v32oAQDnIKVwjZecI1V3oUsy2ZE3TKWx8HH4FweT6S5L6tqZwQD/b0vkeA3UaojO # 5FIkPEqyHFbrj+Sw7bLonLb3LHv4WAE= # =FtY6 # -----END PGP SIGNATURE----- # gpg: Signature made Thu 10 Oct 2024 19:53:11 AEST # gpg: using EDDSA key 6C91433BC35A06E6BC762193B81693550AC606BF # gpg: Can't check signature: No public key # Conflicts: # drivers/gpu/drm/xe/xe_gt_mcr.c # drivers/gpu/drm/xe/xe_tuning.c From: Thomas Hellstrom <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/Zwekwrak12c5SSgo@fedora
2 parents aa628eb + a187c1b commit 26bb2dc

File tree

127 files changed

+6251
-1260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+6251
-1260
lines changed

drivers/gpu/drm/drm_print.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,20 @@ void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
235235
}
236236
EXPORT_SYMBOL(__drm_printfn_err);
237237

238+
void __drm_printfn_line(struct drm_printer *p, struct va_format *vaf)
239+
{
240+
unsigned int counter = ++p->line.counter;
241+
const char *prefix = p->prefix ?: "";
242+
const char *pad = p->prefix ? " " : "";
243+
244+
if (p->line.series)
245+
drm_printf(p->arg, "%s%s%u.%u: %pV",
246+
prefix, pad, p->line.series, counter, vaf);
247+
else
248+
drm_printf(p->arg, "%s%s%u: %pV", prefix, pad, counter, vaf);
249+
}
250+
EXPORT_SYMBOL(__drm_printfn_line);
251+
238252
/**
239253
* drm_puts - print a const string to a &drm_printer stream
240254
* @p: the &drm printer

drivers/gpu/drm/i915/display/intel_dsb.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,10 +706,6 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
706706
if (!i915->display.params.enable_dsb)
707707
return NULL;
708708

709-
/* TODO: DSB is broken in Xe KMD, so disabling it until fixed */
710-
if (!IS_ENABLED(I915))
711-
return NULL;
712-
713709
dsb = kzalloc(sizeof(*dsb), GFP_KERNEL);
714710
if (!dsb)
715711
goto out;

drivers/gpu/drm/xe/Kconfig.debug

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,21 @@ config DRM_XE_DEBUG_VM
4040

4141
If in doubt, say "N".
4242

43+
config DRM_XE_DEBUG_MEMIRQ
44+
bool "Enable extra memirq debugging"
45+
default n
46+
help
47+
Choose this option to enable additional debugging info for
48+
memory based interrupts.
49+
50+
Recommended for driver developers only.
51+
52+
If in doubt, say "N".
53+
4354
config DRM_XE_DEBUG_SRIOV
4455
bool "Enable extra SR-IOV debugging"
4556
default n
57+
select DRM_XE_DEBUG_MEMIRQ
4658
help
4759
Enable extra SR-IOV debugging info.
4860

drivers/gpu/drm/xe/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ xe-y += xe_bb.o \
5656
xe_gt_topology.o \
5757
xe_guc.o \
5858
xe_guc_ads.o \
59+
xe_guc_capture.o \
5960
xe_guc_ct.o \
6061
xe_guc_db_mgr.o \
6162
xe_guc_hwconfig.o \
@@ -129,6 +130,7 @@ xe-$(CONFIG_PCI_IOV) += \
129130
xe_gt_sriov_pf.o \
130131
xe_gt_sriov_pf_config.o \
131132
xe_gt_sriov_pf_control.o \
133+
xe_gt_sriov_pf_migration.o \
132134
xe_gt_sriov_pf_monitor.o \
133135
xe_gt_sriov_pf_policy.o \
134136
xe_gt_sriov_pf_service.o \

drivers/gpu/drm/xe/abi/guc_actions_abi.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ enum xe_guc_sleep_state_status {
176176
#define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT)
177177
#define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8)
178178

179+
enum xe_guc_state_capture_event_status {
180+
XE_GUC_STATE_CAPTURE_EVENT_STATUS_SUCCESS = 0x0,
181+
XE_GUC_STATE_CAPTURE_EVENT_STATUS_NOSPACE = 0x1,
182+
};
183+
184+
#define XE_GUC_STATE_CAPTURE_EVENT_STATUS_MASK 0x000000FF
185+
#define XE_GUC_ACTION_STATE_CAPTURE_NOTIFICATION_DATA_LEN 1
186+
179187
#define XE_GUC_TLB_INVAL_TYPE_SHIFT 0
180188
#define XE_GUC_TLB_INVAL_MODE_SHIFT 8
181189
/* Flush PPC or SMRO caches along with TLB invalidation request */

drivers/gpu/drm/xe/abi/guc_actions_sriov_abi.h

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,4 +557,65 @@
557557
#define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_2_VALUE64 GUC_HXG_REQUEST_MSG_n_DATAn
558558
#define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_3_VALUE96 GUC_HXG_REQUEST_MSG_n_DATAn
559559

560+
/**
561+
* DOC: PF2GUC_SAVE_RESTORE_VF
562+
*
563+
* This message is used by the PF to migrate VF info state maintained by the GuC.
564+
*
565+
* This message must be sent as `CTB HXG Message`_.
566+
*
567+
* Available since GuC version 70.25.0
568+
*
569+
* +---+-------+--------------------------------------------------------------+
570+
* | | Bits | Description |
571+
* +===+=======+==============================================================+
572+
* | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ |
573+
* | +-------+--------------------------------------------------------------+
574+
* | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ |
575+
* | +-------+--------------------------------------------------------------+
576+
* | | 27:16 | DATA0 = **OPCODE** - operation to take: |
577+
* | | | |
578+
* | | | - _`GUC_PF_OPCODE_VF_SAVE` = 0 |
579+
* | | | - _`GUC_PF_OPCODE_VF_RESTORE` = 1 |
580+
* | +-------+--------------------------------------------------------------+
581+
* | | 15:0 | ACTION = _`GUC_ACTION_PF2GUC_SAVE_RESTORE_VF` = 0x550B |
582+
* +---+-------+--------------------------------------------------------------+
583+
* | 1 | 31:0 | **VFID** - VF identifier |
584+
* +---+-------+--------------------------------------------------------------+
585+
* | 2 | 31:0 | **ADDR_LO** - lower 32-bits of GGTT offset to the buffer |
586+
* | | | where the VF info will be save to or restored from. |
587+
* +---+-------+--------------------------------------------------------------+
588+
* | 3 | 31:0 | **ADDR_HI** - upper 32-bits of GGTT offset to the buffer |
589+
* | | | where the VF info will be save to or restored from. |
590+
* +---+-------+--------------------------------------------------------------+
591+
* | 4 | 27:0 | **SIZE** - size of the buffer (in dwords) |
592+
* | +-------+--------------------------------------------------------------+
593+
* | | 31:28 | MBZ |
594+
* +---+-------+--------------------------------------------------------------+
595+
*
596+
* +---+-------+--------------------------------------------------------------+
597+
* | | Bits | Description |
598+
* +===+=======+==============================================================+
599+
* | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_GUC_ |
600+
* | +-------+--------------------------------------------------------------+
601+
* | | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_ |
602+
* | +-------+--------------------------------------------------------------+
603+
* | | 27:0 | DATA0 = **USED** - size of used buffer space (in dwords) |
604+
* +---+-------+--------------------------------------------------------------+
605+
*/
606+
#define GUC_ACTION_PF2GUC_SAVE_RESTORE_VF 0x550Bu
607+
608+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_LEN (GUC_HXG_EVENT_MSG_MIN_LEN + 4u)
609+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_0_OPCODE GUC_HXG_EVENT_MSG_0_DATA0
610+
#define GUC_PF_OPCODE_VF_SAVE 0u
611+
#define GUC_PF_OPCODE_VF_RESTORE 1u
612+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_1_VFID GUC_HXG_EVENT_MSG_n_DATAn
613+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_2_ADDR_LO GUC_HXG_EVENT_MSG_n_DATAn
614+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_3_ADDR_HI GUC_HXG_EVENT_MSG_n_DATAn
615+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_4_SIZE (0xfffffffu << 0)
616+
#define PF2GUC_SAVE_RESTORE_VF_REQUEST_MSG_4_MBZ (0xfu << 28)
617+
618+
#define PF2GUC_SAVE_RESTORE_VF_RESPONSE_MSG_LEN GUC_HXG_RESPONSE_MSG_MIN_LEN
619+
#define PF2GUC_SAVE_RESTORE_VF_RESPONSE_MSG_0_USED GUC_HXG_RESPONSE_MSG_0_DATA0
620+
560621
#endif
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2024 Intel Corporation
4+
*/
5+
6+
#ifndef _ABI_GUC_CAPTURE_ABI_H
7+
#define _ABI_GUC_CAPTURE_ABI_H
8+
9+
#include <linux/types.h>
10+
11+
/* Capture List Index */
12+
enum guc_capture_list_index_type {
13+
GUC_CAPTURE_LIST_INDEX_PF = 0,
14+
GUC_CAPTURE_LIST_INDEX_VF = 1,
15+
};
16+
17+
#define GUC_CAPTURE_LIST_INDEX_MAX (GUC_CAPTURE_LIST_INDEX_VF + 1)
18+
19+
/* Register-types of GuC capture register lists */
20+
enum guc_state_capture_type {
21+
GUC_STATE_CAPTURE_TYPE_GLOBAL = 0,
22+
GUC_STATE_CAPTURE_TYPE_ENGINE_CLASS,
23+
GUC_STATE_CAPTURE_TYPE_ENGINE_INSTANCE
24+
};
25+
26+
#define GUC_STATE_CAPTURE_TYPE_MAX (GUC_STATE_CAPTURE_TYPE_ENGINE_INSTANCE + 1)
27+
28+
/* Class indecies for capture_class and capture_instance arrays */
29+
enum guc_capture_list_class_type {
30+
GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE = 0,
31+
GUC_CAPTURE_LIST_CLASS_VIDEO = 1,
32+
GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE = 2,
33+
GUC_CAPTURE_LIST_CLASS_BLITTER = 3,
34+
GUC_CAPTURE_LIST_CLASS_GSC_OTHER = 4,
35+
};
36+
37+
#define GUC_CAPTURE_LIST_CLASS_MAX (GUC_CAPTURE_LIST_CLASS_GSC_OTHER + 1)
38+
39+
/**
40+
* struct guc_mmio_reg - GuC MMIO reg state struct
41+
*
42+
* GuC MMIO reg state struct
43+
*/
44+
struct guc_mmio_reg {
45+
/** @offset: MMIO Offset - filled in by Host */
46+
u32 offset;
47+
/** @value: MMIO Value - Used by Firmware to store value */
48+
u32 value;
49+
/** @flags: Flags for accessing the MMIO */
50+
u32 flags;
51+
/** @mask: Value of a mask to apply if mask with value is set */
52+
u32 mask;
53+
#define GUC_REGSET_MASKED BIT(0)
54+
#define GUC_REGSET_STEERING_NEEDED BIT(1)
55+
#define GUC_REGSET_MASKED_WITH_VALUE BIT(2)
56+
#define GUC_REGSET_RESTORE_ONLY BIT(3)
57+
#define GUC_REGSET_STEERING_GROUP GENMASK(16, 12)
58+
#define GUC_REGSET_STEERING_INSTANCE GENMASK(23, 20)
59+
} __packed;
60+
61+
/**
62+
* struct guc_mmio_reg_set - GuC register sets
63+
*
64+
* GuC register sets
65+
*/
66+
struct guc_mmio_reg_set {
67+
/** @address: register address */
68+
u32 address;
69+
/** @count: register count */
70+
u16 count;
71+
/** @reserved: reserved */
72+
u16 reserved;
73+
} __packed;
74+
75+
/**
76+
* struct guc_debug_capture_list_header - Debug capture list header.
77+
*
78+
* Debug capture list header.
79+
*/
80+
struct guc_debug_capture_list_header {
81+
/** @info: contains number of MMIO descriptors in the capture list. */
82+
u32 info;
83+
#define GUC_CAPTURELISTHDR_NUMDESCR GENMASK(15, 0)
84+
} __packed;
85+
86+
/**
87+
* struct guc_debug_capture_list - Debug capture list
88+
*
89+
* As part of ADS registration, these header structures (followed by
90+
* an array of 'struct guc_mmio_reg' entries) are used to register with
91+
* GuC microkernel the list of registers we want it to dump out prior
92+
* to a engine reset.
93+
*/
94+
struct guc_debug_capture_list {
95+
/** @header: Debug capture list header. */
96+
struct guc_debug_capture_list_header header;
97+
/** @regs: MMIO descriptors in the capture list. */
98+
struct guc_mmio_reg regs[];
99+
} __packed;
100+
101+
/**
102+
* struct guc_state_capture_header_t - State capture header.
103+
*
104+
* Prior to resetting engines that have hung or faulted, GuC microkernel
105+
* reports the engine error-state (register values that was read) by
106+
* logging them into the shared GuC log buffer using these hierarchy
107+
* of structures.
108+
*/
109+
struct guc_state_capture_header_t {
110+
/**
111+
* @owner: VFID
112+
* BR[ 7: 0] MBZ when SRIOV is disabled. When SRIOV is enabled
113+
* VFID is an integer in range [0, 63] where 0 means the state capture
114+
* is corresponding to the PF and an integer N in range [1, 63] means
115+
* the state capture is for VF N.
116+
*/
117+
u32 owner;
118+
#define GUC_STATE_CAPTURE_HEADER_VFID GENMASK(7, 0)
119+
/** @info: Engine class/instance and capture type info */
120+
u32 info;
121+
#define GUC_STATE_CAPTURE_HEADER_CAPTURE_TYPE GENMASK(3, 0) /* see guc_state_capture_type */
122+
#define GUC_STATE_CAPTURE_HEADER_ENGINE_CLASS GENMASK(7, 4) /* see guc_capture_list_class_type */
123+
#define GUC_STATE_CAPTURE_HEADER_ENGINE_INSTANCE GENMASK(11, 8)
124+
/**
125+
* @lrca: logical ring context address.
126+
* if type-instance, LRCA (address) that hung, else set to ~0
127+
*/
128+
u32 lrca;
129+
/**
130+
* @guc_id: context_index.
131+
* if type-instance, context index of hung context, else set to ~0
132+
*/
133+
u32 guc_id;
134+
/** @num_mmio_entries: Number of captured MMIO entries. */
135+
u32 num_mmio_entries;
136+
#define GUC_STATE_CAPTURE_HEADER_NUM_MMIO_ENTRIES GENMASK(9, 0)
137+
} __packed;
138+
139+
/**
140+
* struct guc_state_capture_t - State capture.
141+
*
142+
* State capture
143+
*/
144+
struct guc_state_capture_t {
145+
/** @header: State capture header. */
146+
struct guc_state_capture_header_t header;
147+
/** @mmio_entries: Array of captured guc_mmio_reg entries. */
148+
struct guc_mmio_reg mmio_entries[];
149+
} __packed;
150+
151+
/* State Capture Group Type */
152+
enum guc_state_capture_group_type {
153+
GUC_STATE_CAPTURE_GROUP_TYPE_FULL = 0,
154+
GUC_STATE_CAPTURE_GROUP_TYPE_PARTIAL
155+
};
156+
157+
#define GUC_STATE_CAPTURE_GROUP_TYPE_MAX (GUC_STATE_CAPTURE_GROUP_TYPE_PARTIAL + 1)
158+
159+
/**
160+
* struct guc_state_capture_group_header_t - State capture group header
161+
*
162+
* State capture group header.
163+
*/
164+
struct guc_state_capture_group_header_t {
165+
/** @owner: VFID */
166+
u32 owner;
167+
#define GUC_STATE_CAPTURE_GROUP_HEADER_VFID GENMASK(7, 0)
168+
/** @info: Engine class/instance and capture type info */
169+
u32 info;
170+
#define GUC_STATE_CAPTURE_GROUP_HEADER_NUM_CAPTURES GENMASK(7, 0)
171+
#define GUC_STATE_CAPTURE_GROUP_HEADER_CAPTURE_GROUP_TYPE GENMASK(15, 8)
172+
} __packed;
173+
174+
/**
175+
* struct guc_state_capture_group_t - State capture group.
176+
*
177+
* this is the top level structure where an error-capture dump starts
178+
*/
179+
struct guc_state_capture_group_t {
180+
/** @grp_header: State capture group header. */
181+
struct guc_state_capture_group_header_t grp_header;
182+
/** @capture_entries: Array of state captures */
183+
struct guc_state_capture_t capture_entries[];
184+
} __packed;
185+
186+
#endif

drivers/gpu/drm/xe/abi/guc_communication_ctb_abi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct guc_ct_buffer_desc {
5252
#define GUC_CTB_STATUS_OVERFLOW (1 << 0)
5353
#define GUC_CTB_STATUS_UNDERFLOW (1 << 1)
5454
#define GUC_CTB_STATUS_MISMATCH (1 << 2)
55+
#define GUC_CTB_STATUS_DISABLED (1 << 3)
5556
u32 reserved[13];
5657
} __packed;
5758
static_assert(sizeof(struct guc_ct_buffer_desc) == 64);

0 commit comments

Comments
 (0)