Skip to content

Commit bfc1093

Browse files
committed
Merge tag 'drm-intel-gt-next-2024-07-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Driver Changes: Fixes/improvements/new stuff: - Downgrade stolen lmem setup warning [gem] (Jonathan Cavitt) - Evaluate GuC priority within locks [gt/uc] (Andi Shyti) - Fix potential UAF by revoke of fence registers [gt] (Janusz Krzysztofik) - Return NULL instead of '0' [gem] (Andi Shyti) - Use the correct format specifier for resource_size_t [gem] (Andi Shyti) - Suppress oom warning in favour of ENOMEM to userspace [gem] (Nirmoy Das) Miscellaneous: - Evaluate forcewake usage within locks [gt] (Andi Shyti) - Fix typo in comment [gt/uc] (Andi Shyti) Signed-off-by: Daniel Vetter <[email protected]> From: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ZoZP6mUSergfzFMh@linux
2 parents 6be146c + 3b85152 commit bfc1093

File tree

5 files changed

+31
-18
lines changed

5 files changed

+31
-18
lines changed

drivers/gpu/drm/i915/gem/i915_gem_stolen.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,12 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
936936
} else {
937937
/* Use DSM base address instead for stolen memory */
938938
dsm_base = intel_uncore_read64(uncore, GEN6_DSMBASE) & GEN11_BDSM_MASK;
939-
if (WARN_ON(lmem_size < dsm_base))
940-
return ERR_PTR(-ENODEV);
939+
if (lmem_size < dsm_base) {
940+
drm_dbg(&i915->drm,
941+
"Disabling stolen memory support due to OOB placement: lmem_size = %pa vs dsm_base = %pa\n",
942+
&lmem_size, &dsm_base);
943+
return NULL;
944+
}
941945
dsm_size = ALIGN_DOWN(lmem_size - dsm_base, SZ_1M);
942946
}
943947

drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ static int fw_domains_show(struct seq_file *m, void *data)
7171
struct intel_uncore_forcewake_domain *fw_domain;
7272
unsigned int tmp;
7373

74+
spin_lock_irq(&uncore->lock);
75+
7476
seq_printf(m, "user.bypass_count = %u\n",
7577
uncore->user_forcewake_count);
7678

@@ -79,6 +81,8 @@ static int fw_domains_show(struct seq_file *m, void *data)
7981
intel_uncore_forcewake_domain_to_str(fw_domain->id),
8082
READ_ONCE(fw_domain->wake_count));
8183

84+
spin_unlock_irq(&uncore->lock);
85+
8286
return 0;
8387
}
8488
DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(fw_domains);

drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ struct guc_update_scheduling_policy_header {
295295
} __packed;
296296

297297
/*
298-
* Can't dynmically allocate memory for the scheduling policy KLV because
298+
* Can't dynamically allocate memory for the scheduling policy KLV because
299299
* it will be sent from within the reset path. Need a fixed size lump on
300300
* the stack instead :(.
301301
*

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4267,20 +4267,25 @@ static void guc_bump_inflight_request_prio(struct i915_request *rq,
42674267
u8 new_guc_prio = map_i915_prio_to_guc_prio(prio);
42684268

42694269
/* Short circuit function */
4270-
if (prio < I915_PRIORITY_NORMAL ||
4271-
rq->guc_prio == GUC_PRIO_FINI ||
4272-
(rq->guc_prio != GUC_PRIO_INIT &&
4273-
!new_guc_prio_higher(rq->guc_prio, new_guc_prio)))
4270+
if (prio < I915_PRIORITY_NORMAL)
42744271
return;
42754272

42764273
spin_lock(&ce->guc_state.lock);
4277-
if (rq->guc_prio != GUC_PRIO_FINI) {
4278-
if (rq->guc_prio != GUC_PRIO_INIT)
4279-
sub_context_inflight_prio(ce, rq->guc_prio);
4280-
rq->guc_prio = new_guc_prio;
4281-
add_context_inflight_prio(ce, rq->guc_prio);
4282-
update_context_prio(ce);
4283-
}
4274+
4275+
if (rq->guc_prio == GUC_PRIO_FINI)
4276+
goto exit;
4277+
4278+
if (!new_guc_prio_higher(rq->guc_prio, new_guc_prio))
4279+
goto exit;
4280+
4281+
if (rq->guc_prio != GUC_PRIO_INIT)
4282+
sub_context_inflight_prio(ce, rq->guc_prio);
4283+
4284+
rq->guc_prio = new_guc_prio;
4285+
add_context_inflight_prio(ce, rq->guc_prio);
4286+
update_context_prio(ce);
4287+
4288+
exit:
42844289
spin_unlock(&ce->guc_state.lock);
42854290
}
42864291

drivers/gpu/drm/i915/i915_scatterlist.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
9090

9191
GEM_BUG_ON(!max_segment);
9292

93-
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
93+
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
9494
if (!rsgt)
9595
return ERR_PTR(-ENOMEM);
9696

@@ -104,7 +104,7 @@ struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
104104
}
105105

106106
if (sg_alloc_table(st, DIV_ROUND_UP_ULL(node->size, segment_pages),
107-
GFP_KERNEL)) {
107+
GFP_KERNEL | __GFP_NOWARN)) {
108108
i915_refct_sgt_put(rsgt);
109109
return ERR_PTR(-ENOMEM);
110110
}
@@ -178,7 +178,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
178178
GEM_BUG_ON(list_empty(blocks));
179179
GEM_BUG_ON(!max_segment);
180180

181-
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL);
181+
rsgt = kmalloc(sizeof(*rsgt), GFP_KERNEL | __GFP_NOWARN);
182182
if (!rsgt)
183183
return ERR_PTR(-ENOMEM);
184184

@@ -190,7 +190,7 @@ struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
190190
return ERR_PTR(-E2BIG);
191191
}
192192

193-
if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL)) {
193+
if (sg_alloc_table(st, PFN_UP(res->size), GFP_KERNEL | __GFP_NOWARN)) {
194194
i915_refct_sgt_put(rsgt);
195195
return ERR_PTR(-ENOMEM);
196196
}

0 commit comments

Comments
 (0)