Commit 14e85fab authored by Simona Vetter's avatar Simona Vetter
Browse files

Merge tag 'drm-xe-fixes-2025-07-11' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes



Driver Changes:
- Clear LMTT page to avoid leaking data from one VF to another
- Align PF queue size to power of 2
- Disable Indirect Ring State to avoid intermittent issues on context
  switch: feature is not currently needed, so can be disabled for now.
- Fix compression handling when the BO pages are very fragmented
- Restore display pm on error path
- Fix runtime pm handling in xe devcoredump
- Fix xe_pm_set_vram_threshold() doc
- Recommend new minor versions of GuC firmware
- Drop some workarounds on VF
- Do not use verbose GuC logging by default: it should be only for
  debugging

Signed-off-by: default avatarSimona Vetter <simona.vetter@ffwll.ch>
From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/s6jyd24mimbzb4vxtgc5vupvbyqplfep2c6eupue7znnlbhuxy@lmvzexfzhrnn
parents 3638e6a8 74806f69
Loading
Loading
Loading
Loading
+28 −10
Original line number Diff line number Diff line
@@ -171,14 +171,32 @@ static void xe_devcoredump_snapshot_free(struct xe_devcoredump_snapshot *ss)

#define XE_DEVCOREDUMP_CHUNK_MAX	(SZ_512M + SZ_1G)

/**
 * xe_devcoredump_read() - Read data from the Xe device coredump snapshot
 * @buffer: Destination buffer to copy the coredump data into
 * @offset: Offset in the coredump data to start reading from
 * @count: Number of bytes to read
 * @data: Pointer to the xe_devcoredump structure
 * @datalen: Length of the data (unused)
 *
 * Reads a chunk of the coredump snapshot data into the provided buffer.
 * If the devcoredump is smaller than 1.5 GB (XE_DEVCOREDUMP_CHUNK_MAX),
 * it is read directly from a pre-written buffer. For larger devcoredumps,
 * the pre-written buffer must be periodically repopulated from the snapshot
 * state due to kmalloc size limitations.
 *
 * Return: Number of bytes copied on success, or a negative error code on failure.
 */
static ssize_t xe_devcoredump_read(char *buffer, loff_t offset,
				   size_t count, void *data, size_t datalen)
{
	struct xe_devcoredump *coredump = data;
	struct xe_devcoredump_snapshot *ss;
	ssize_t byte_copied;
	ssize_t byte_copied = 0;
	u32 chunk_offset;
	ssize_t new_chunk_position;
	bool pm_needed = false;
	int ret = 0;

	if (!coredump)
		return -ENODEV;
@@ -188,20 +206,19 @@ static ssize_t xe_devcoredump_read(char *buffer, loff_t offset,
	/* Ensure delayed work is captured before continuing */
	flush_work(&ss->work);

	if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
	pm_needed = ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX;
	if (pm_needed)
		xe_pm_runtime_get(gt_to_xe(ss->gt));

	mutex_lock(&coredump->lock);

	if (!ss->read.buffer) {
		mutex_unlock(&coredump->lock);
		return -ENODEV;
		ret = -ENODEV;
		goto unlock;
	}

	if (offset >= ss->read.size) {
		mutex_unlock(&coredump->lock);
		return 0;
	}
	if (offset >= ss->read.size)
		goto unlock;

	new_chunk_position = div_u64_rem(offset,
					 XE_DEVCOREDUMP_CHUNK_MAX,
@@ -221,12 +238,13 @@ static ssize_t xe_devcoredump_read(char *buffer, loff_t offset,
		ss->read.size - offset;
	memcpy(buffer, ss->read.buffer + chunk_offset, byte_copied);

unlock:
	mutex_unlock(&coredump->lock);

	if (ss->read.size > XE_DEVCOREDUMP_CHUNK_MAX)
	if (pm_needed)
		xe_pm_runtime_put(gt_to_xe(ss->gt));

	return byte_copied;
	return byte_copied ? byte_copied : ret;
}

static void xe_devcoredump_free(void *data)
+1 −0
Original line number Diff line number Diff line
@@ -444,6 +444,7 @@ static int xe_alloc_pf_queue(struct xe_gt *gt, struct pf_queue *pf_queue)
#define PF_MULTIPLIER	8
	pf_queue->num_dw =
		(num_eus + XE_NUM_HW_ENGINES) * PF_MSG_LEN_DW * PF_MULTIPLIER;
	pf_queue->num_dw = roundup_pow_of_two(pf_queue->num_dw);
#undef PF_MULTIPLIER

	pf_queue->gt = gt;
+11 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ static struct xe_lmtt_pt *lmtt_pt_alloc(struct xe_lmtt *lmtt, unsigned int level
	}

	lmtt_assert(lmtt, xe_bo_is_vram(bo));
	lmtt_debug(lmtt, "level=%u addr=%#llx\n", level, (u64)xe_bo_main_addr(bo, XE_PAGE_SIZE));

	xe_map_memset(lmtt_to_xe(lmtt), &bo->vmap, 0, 0, bo->size);

	pt->level = level;
	pt->bo = bo;
@@ -91,6 +94,9 @@ static struct xe_lmtt_pt *lmtt_pt_alloc(struct xe_lmtt *lmtt, unsigned int level

static void lmtt_pt_free(struct xe_lmtt_pt *pt)
{
	lmtt_debug(&pt->bo->tile->sriov.pf.lmtt, "level=%u addr=%llx\n",
		   pt->level, (u64)xe_bo_main_addr(pt->bo, XE_PAGE_SIZE));

	xe_bo_unpin_map_no_vm(pt->bo);
	kfree(pt);
}
@@ -226,9 +232,14 @@ static void lmtt_write_pte(struct xe_lmtt *lmtt, struct xe_lmtt_pt *pt,

	switch (lmtt->ops->lmtt_pte_size(level)) {
	case sizeof(u32):
		lmtt_assert(lmtt, !overflows_type(pte, u32));
		lmtt_assert(lmtt, !pte || !iosys_map_rd(&pt->bo->vmap, idx * sizeof(u32), u32));

		xe_map_wr(lmtt_to_xe(lmtt), &pt->bo->vmap, idx * sizeof(u32), u32, pte);
		break;
	case sizeof(u64):
		lmtt_assert(lmtt, !pte || !iosys_map_rd(&pt->bo->vmap, idx * sizeof(u64), u64));

		xe_map_wr(lmtt_to_xe(lmtt), &pt->bo->vmap, idx * sizeof(u64), u64, pte);
		break;
	default:
+1 −1
Original line number Diff line number Diff line
@@ -863,7 +863,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
		if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it))
			xe_res_next(&src_it, src_L0);
		else
			emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs,
			emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs || use_comp_pat,
				 &src_it, src_L0, src);

		if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@

struct xe_modparam xe_modparam = {
	.probe_display = true,
	.guc_log_level = 3,
	.guc_log_level = IS_ENABLED(CONFIG_DRM_XE_DEBUG) ? 3 : 1,
	.force_probe = CONFIG_DRM_XE_FORCE_PROBE,
	.wedged_mode = 1,
	.svm_notifier_size = 512,
Loading