* [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes
@ 2026-12-02 22:34 Matt Turner
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Matt Turner @ 2026-12-02 22:34 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
Pierre-Eric Pelloux-Prayer, Le Ma, Lijo Lazar
Cc: amd-gfx, dri-devel, linux-kernel, Matt Turner, Gregoire Pean,
Jatin Kataria
Three small fixes found while working on the amdgpu devcoredump.
Patch 1 fixes reading the IB contents into the devcoredump: a NULL
dereference for PRT mappings and purged BOs, a wrong offset for
mappings that don't start at the beginning of their BO, no bounds
check of the IB against its mapping, and clobbering abo->kmap.
Patch 2 clears the JPEG and VCN1 IP dump pointers after freeing them,
as the other VCN versions already do.
Patch 3 skips the MES legacy queue unmap during a GPU reset, as the
KIQ path already does, so a hung MES doesn't add about 2.1 seconds per
queue to recovery.
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
Matt Turner (3):
drm/amdgpu: fix IB content read in the devcoredump
drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers
drm/amdgpu: don't unmap legacy queues through MES during reset
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 67 ++++++++++++++++--------
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 +++
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 1 +
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 +
4 files changed, 56 insertions(+), 21 deletions(-)
---
base-commit: a69db917063c539fa09325ea22f3ff7b0626b478
change-id: 20261118-amdgpu-devcoredump-fixes-03f0342dc0a2
Best regards,
--
Matt Turner <mattst88@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump
2026-12-02 22:34 [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes Matt Turner
@ 2026-12-02 22:34 ` Matt Turner
2026-12-02 22:53 ` sashiko-bot
2026-12-02 22:34 ` [PATCH 2/3] drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers Matt Turner
2026-12-02 22:34 ` [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset Matt Turner
2 siblings, 1 reply; 6+ messages in thread
From: Matt Turner @ 2026-12-02 22:34 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
Pierre-Eric Pelloux-Prayer, Le Ma, Lijo Lazar
Cc: amd-gfx, dri-devel, linux-kernel, Matt Turner, Gregoire Pean
amdgpu_devcoredump_print_ibs() has several problems when reading the
contents of the IBs of the hung job:
- PRT mappings have a bo_va with no BO behind it, so an IB address that
falls into a PRT range dereferences a NULL BO in both the lock loop
and the copy loop.
- A BO without a resource (e.g. purged) is dereferenced via
tbo.resource->mem_type.
- The offset into the BO ignores mapping->offset, so for a mapping that
does not start at the beginning of its BO the wrong data is dumped.
- There is no check that the IB lies within the mapping, so a bogus IB
address or size from a misbehaving process reads outside the mapping,
possibly past the end of the BO.
- ttm_bo_kmap() maps the entire BO, which needlessly vmaps large BOs,
and the mapping is stored in abo->kmap, clobbering any kernel mapping
the driver already holds there.
- BOs with AMDGPU_GEM_CREATE_NO_CPU_ACCESS that have been moved to GTT
are skipped, while BOs in CPU invisible VRAM without that flag fail
in ttm_bo_kmap().
Skip mappings with no BO and BOs with no resource, honor
mapping->offset, and check that the IB lies within its mapping, which
amdgpu_vm_verify_parameters() already keeps within the BO. Read VRAM
through amdgpu_device_vram_access(), which uses the CPU visible
aperture where it can and MM_INDEX/MM_DATA for the rest, and kmap only
the pages covering the IB into a local map object for everything else.
Fixes: 7b15fc2d1f1a ("drm/amdgpu: dump job ibs in the devcoredump")
Suggested-by: Gregoire Pean <gpean@netflix.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 67 ++++++++++++++++--------
1 file changed, 46 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
index 30a8b4c5591d..0c6533b950f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
@@ -209,6 +209,16 @@ static void amdgpu_devcoredump_fw_info(struct amdgpu_device *adev,
}
}
+static struct amdgpu_bo *
+amdgpu_devcoredump_mapping_bo(struct amdgpu_bo_va_mapping *mapping)
+{
+ /* PRT mappings have a bo_va with no BO behind it. */
+ if (!mapping || !mapping->bo_va)
+ return NULL;
+
+ return mapping->bo_va->base.bo;
+}
+
static void
amdgpu_devcoredump_print_ibs(struct drm_printer *p,
struct amdgpu_coredump_info *coredump,
@@ -259,10 +269,10 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
u64 addr = coredump->ibs[i].gpu_addr & AMDGPU_GMC_HOLE_MASK;
mapping = amdgpu_vm_bo_lookup_mapping(vm, addr);
- if (!mapping)
+ abo = amdgpu_devcoredump_mapping_bo(mapping);
+ if (!abo)
continue;
- abo = mapping->bo_va->base.bo;
r = drm_exec_lock_obj(&exec, &abo->tbo.base);
drm_exec_retry_on_contention(&exec);
if (r)
@@ -271,6 +281,7 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
}
for (int i = 0; i < coredump->num_ibs; i++) {
+ u64 size = (u64)coredump->ibs[i].ib_size_dw * 4;
bool emit_content = false;
ib_content = kvmalloc_array(coredump->ibs[i].ib_size_dw, 4,
@@ -280,41 +291,55 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
va_start = coredump->ibs[i].gpu_addr & AMDGPU_GMC_HOLE_MASK;
mapping = amdgpu_vm_bo_lookup_mapping(vm, va_start);
- if (!mapping)
+ abo = amdgpu_devcoredump_mapping_bo(mapping);
+ if (!abo || !abo->tbo.resource)
goto output_ib_content;
- abo = mapping->bo_va->base.bo;
- offset = va_start - mapping->start * AMDGPU_GPU_PAGE_SIZE;
+ if (va_start + size >
+ (mapping->last + 1) * AMDGPU_GPU_PAGE_SIZE)
+ goto output_ib_content;
- if (abo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) {
+ offset = va_start - mapping->start * AMDGPU_GPU_PAGE_SIZE +
+ mapping->offset;
+
+ if (abo->tbo.resource->mem_type == TTM_PL_VRAM) {
struct amdgpu_res_cursor cursor;
off = 0;
-
- if (abo->tbo.resource->mem_type != TTM_PL_VRAM)
- goto output_ib_content;
-
- amdgpu_res_first(abo->tbo.resource, offset,
- coredump->ibs[i].ib_size_dw * 4, &cursor);
+ amdgpu_res_first(abo->tbo.resource, offset, size,
+ &cursor);
while (cursor.remaining) {
- amdgpu_device_mm_access(adev, cursor.start,
- &ib_content[off], cursor.size,
- false);
+ amdgpu_device_vram_access(adev, cursor.start,
+ &ib_content[off],
+ cursor.size, false);
off += cursor.size / 4;
amdgpu_res_next(&cursor, cursor.size);
}
emit_content = true;
} else {
- r = ttm_bo_kmap(&abo->tbo, 0, PFN_UP(abo->tbo.base.size),
- &abo->kmap);
+ struct ttm_bo_kmap_obj map;
+ unsigned long first = offset >> PAGE_SHIFT;
+ bool is_iomem;
+
+ /*
+ * Map only the pages backing the IB, into a local map
+ * object so a kernel mapping held in abo->kmap is left
+ * untouched.
+ */
+ r = ttm_bo_kmap(&abo->tbo, first,
+ PFN_UP(offset + size) - first, &map);
if (r)
goto output_ib_content;
- kptr = amdgpu_bo_kptr(abo);
- kptr += offset;
- memcpy(ib_content, kptr, coredump->ibs[i].ib_size_dw * 4);
+ kptr = ttm_kmap_obj_virtual(&map, &is_iomem);
+ kptr += offset_in_page(offset);
+ if (is_iomem)
+ memcpy_fromio(ib_content,
+ (void __iomem *)kptr, size);
+ else
+ memcpy(ib_content, kptr, size);
- amdgpu_bo_kunmap(abo);
+ ttm_bo_kunmap(&map);
emit_content = true;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers
2026-12-02 22:34 [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes Matt Turner
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
@ 2026-12-02 22:34 ` Matt Turner
2026-12-02 22:34 ` [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset Matt Turner
2 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2026-12-02 22:34 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
Pierre-Eric Pelloux-Prayer, Le Ma, Lijo Lazar
Cc: amd-gfx, dri-devel, linux-kernel, Matt Turner, Jatin Kataria
amdgpu_jpeg_reg_dump_fini() and vcn_v1_0_sw_fini() free the IP dump
buffer but leave adev->jpeg.ip_dump and adev->vcn.ip_dump set. Clear
them, as amdgpu_vcn_reg_dump_fini() already does for the other VCN
versions, so that anything looking at them after teardown sees NULL
rather than a freed buffer.
Suggested-by: Jatin Kataria <jkataria@netflix.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 1 +
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
index ec3833c79a01..9f31cb445aa5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
@@ -501,6 +501,7 @@ int amdgpu_jpeg_reg_dump_init(struct amdgpu_device *adev,
static void amdgpu_jpeg_reg_dump_fini(struct amdgpu_device *adev)
{
kfree(adev->jpeg.ip_dump);
+ adev->jpeg.ip_dump = NULL;
adev->jpeg.reg_list = NULL;
adev->jpeg.reg_count = 0;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 897310d04f83..ee30cf1503ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -233,6 +233,7 @@ static int vcn_v1_0_sw_fini(struct amdgpu_ip_block *ip_block)
amdgpu_vcn_sw_fini(adev, 0);
kfree(adev->vcn.ip_dump);
+ adev->vcn.ip_dump = NULL;
return 0;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset
2026-12-02 22:34 [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes Matt Turner
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
2026-12-02 22:34 ` [PATCH 2/3] drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers Matt Turner
@ 2026-12-02 22:34 ` Matt Turner
2026-12-02 22:48 ` sashiko-bot
2 siblings, 1 reply; 6+ messages in thread
From: Matt Turner @ 2026-12-02 22:34 UTC (permalink / raw)
To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
Pierre-Eric Pelloux-Prayer, Le Ma, Lijo Lazar
Cc: amd-gfx, dri-devel, linux-kernel, Matt Turner, Jatin Kataria
Commit 7b1ebbe856fc ("drm/amdgpu: Avoid kcq disable during reset")
made amdgpu_gfx_disable_kcq() and amdgpu_gfx_disable_kgq() skip the
KIQ unmap once a reset is in progress, since the reset tears down and
rebuilds the queues anyway. It did not cover the MES branch that
commit f7fb9d677faf ("drm/amdgpu/mes12: fix suspend issue") had added
to the same functions earlier.
When MES is hung, each of those unmap requests waits out the MES
submission timeout of about 2.1 seconds before failing, and the
failure is ignored, so recovery stalls for that long per queue for
nothing.
Skip the MES unmap during reset as well, matching the KIQ path.
Fixes: 7b1ebbe856fc ("drm/amdgpu: Avoid kcq disable during reset")
Suggested-by: Jatin Kataria <jkataria@netflix.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index c5a2dcff5058..0e9456b57577 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -586,6 +586,10 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev, int xcc_id)
int j;
if (adev->enable_mes) {
+ /* As below for KIQ: the reset tears down and rebuilds the queues. */
+ if (amdgpu_in_reset(adev))
+ return 0;
+
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
j = i + xcc_id * adev->gfx.num_compute_rings;
amdgpu_mes_unmap_legacy_queue(adev,
@@ -636,6 +640,10 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int xcc_id)
int j;
if (adev->enable_mes) {
+ /* As below for KIQ: the reset tears down and rebuilds the queues. */
+ if (amdgpu_in_reset(adev))
+ return 0;
+
if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) {
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
j = i + xcc_id * adev->gfx.num_gfx_rings;
--
2.56.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset
2026-12-02 22:34 ` [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset Matt Turner
@ 2026-12-02 22:48 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-12-02 22:48 UTC (permalink / raw)
To: Matt Turner; +Cc: amd-gfx, dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amdgpu: amdgpu_gfx_disable_kgq() skips post-reset unmap
on GFX11
--
commit 0c68dfc74c61f610dfe69cfef805b4a5d17edd1f
Author: Matt Turner <mattst88@gmail.com>
drm/amdgpu: don't unmap legacy queues through MES during reset
This commit skips the MES legacy queue unmap in amdgpu_gfx_disable_kcq()
and amdgpu_gfx_disable_kgq() when a GPU reset is in progress.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index c5a2dcff5058a..0e9456b57577b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
[ ... ]
> @@ -636,6 +640,10 @@ int amdgpu_gfx_disable_kgq(struct amdgpu_device *adev, int xcc_id)
> int j;
>
> if (adev->enable_mes) {
> + /* As below for KIQ: the reset tears down and rebuilds the queues. */
> + if (amdgpu_in_reset(adev))
> + return 0;
> +
> if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) {
> for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
> j = i + xcc_id * adev->gfx.num_gfx_rings;
[Severity: Medium]
Does returning early when amdgpu_in_reset(adev) is true prevent
gfx_v11_0_cp_resume() from unmapping the temporary gfx_ring[0] during
post-reset resume when adev->gfx.disable_kq is set?
During GPU recovery, amdgpu_device_gpu_recover() holds the reset domain
lock (keeping in_gpu_reset set to 1) across amdgpu_device_asic_reset(),
including post-reset IP reinitialization in
amdgpu_device_reinit_after_reset() -> ... -> gfx_v11_0_cp_resume(). When
adev->gfx.disable_kq is true, gfx_v11_0_cp_resume() temporarily maps
gfx_ring[0] via amdgpu_gfx_enable_kgq() to initialize clear state and
then immediately calls amdgpu_gfx_disable_kgq(adev, 0) to unmap it:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:gfx_v11_0_cp_resume() {
...
if (adev->gfx.disable_kq) {
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
ring = &adev->gfx.gfx_ring[i];
/* we don't want to set ring->ready */
r = amdgpu_ring_test_ring(ring);
if (r)
return r;
}
amdgpu_gfx_disable_kgq(adev, 0);
}
...
}
Because amdgpu_in_reset(adev) is still true at that point,
amdgpu_gfx_disable_kgq() now returns early without calling
amdgpu_mes_unmap_legacy_queue(). That leaves gfx_ring[0] mapped on an HQD
that amdgpu_mes_init() did not reserve for kernel queues and instead
exposed in adev->mes.gfx_hqd_mask for MES user queues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-amdgpu-devcoredump-fixes-v1-0-59f622a29769@gmail.com?part=3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
@ 2026-12-02 22:53 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-12-02 22:53 UTC (permalink / raw)
To: Matt Turner; +Cc: amd-gfx, dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amdgpu: unaligned VRAM IB read in
amdgpu_devcoredump_print_ibs()
--
commit 14b3e312c2b66e1a7d6ed65ad219c71a4c22a7ca
Author: Matt Turner <mattst88@gmail.com>
drm/amdgpu: fix IB content read in the devcoredump
This commit reworks IB content dumping in amdgpu_devcoredump_print_ibs() to
validate mappings and BO resources, account for mapping->offset, read VRAM
via amdgpu_device_vram_access(), and map non-VRAM pages into a local
ttm_bo_kmap_obj.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
> index 30a8b4c5591dd..0c6533b950f60 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
[ ... ]
> @@ -271,6 +281,7 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
> }
>
> for (int i = 0; i < coredump->num_ibs; i++) {
> + u64 size = (u64)coredump->ibs[i].ib_size_dw * 4;
> bool emit_content = false;
>
> ib_content = kvmalloc_array(coredump->ibs[i].ib_size_dw, 4,
> @@ -280,41 +291,55 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
>
> va_start = coredump->ibs[i].gpu_addr & AMDGPU_GMC_HOLE_MASK;
> mapping = amdgpu_vm_bo_lookup_mapping(vm, va_start);
> - if (!mapping)
> + abo = amdgpu_devcoredump_mapping_bo(mapping);
> + if (!abo || !abo->tbo.resource)
> goto output_ib_content;
>
> - abo = mapping->bo_va->base.bo;
> - offset = va_start - mapping->start * AMDGPU_GPU_PAGE_SIZE;
> + if (va_start + size >
> + (mapping->last + 1) * AMDGPU_GPU_PAGE_SIZE)
> + goto output_ib_content;
>
> - if (abo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) {
> + offset = va_start - mapping->start * AMDGPU_GPU_PAGE_SIZE +
> + mapping->offset;
> +
> + if (abo->tbo.resource->mem_type == TTM_PL_VRAM) {
> struct amdgpu_res_cursor cursor;
>
> off = 0;
> -
> - if (abo->tbo.resource->mem_type != TTM_PL_VRAM)
> - goto output_ib_content;
> -
> - amdgpu_res_first(abo->tbo.resource, offset,
> - coredump->ibs[i].ib_size_dw * 4, &cursor);
> + amdgpu_res_first(abo->tbo.resource, offset, size,
> + &cursor);
> while (cursor.remaining) {
> - amdgpu_device_mm_access(adev, cursor.start,
> - &ib_content[off], cursor.size,
> - false);
> + amdgpu_device_vram_access(adev, cursor.start,
> + &ib_content[off],
> + cursor.size, false);
> off += cursor.size / 4;
> amdgpu_res_next(&cursor, cursor.size);
> }
> emit_content = true;
[Severity: Medium]
Can an unaligned IB address cause amdgpu_devcoredump_print_ibs() to print
uninitialized kernel memory from ib_content?
amdgpu_cs_p2_ib() copies userspace's chunk_ib->va_start into ib->gpu_addr
without checking 4-byte alignment. When va_start is not 4-byte aligned,
offset, cursor.start, and cursor.size are unaligned as well. For
CPU-invisible VRAM, amdgpu_device_vram_access() falls back to
amdgpu_device_mm_access(), which aborts without writing to the buffer:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:amdgpu_device_mm_access() {
if (!drm_dev_enter(adev_to_drm(adev), &idx))
return;
if (!IS_ALIGNED(pos, 4) || !IS_ALIGNED(size, 4)) {
dev_err(adev->dev, "unaligned pos/size (pos=0x%llx, size=0x%zx)\n",
pos, size);
drm_dev_exit(idx);
return;
}
Since ib_content is allocated without __GFP_ZERO and emit_content is set to
true unconditionally, the devcoredump formats uninitialized memory. Even in
CPU-visible VRAM, if an unaligned IB crosses a buddy block boundary,
cursor.size on the first block is not a multiple of 4, so off +=
cursor.size / 4 misaligns subsequent block reads and leaves the trailing
bytes of ib_content unwritten.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-amdgpu-devcoredump-fixes-v1-0-59f622a29769@gmail.com?part=1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-12-02 22:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 22:34 [PATCH 0/3] drm/amdgpu: devcoredump and reset fixes Matt Turner
2026-12-02 22:34 ` [PATCH 1/3] drm/amdgpu: fix IB content read in the devcoredump Matt Turner
2026-12-02 22:53 ` sashiko-bot
2026-12-02 22:34 ` [PATCH 2/3] drm/amdgpu: clear stale JPEG and VCN1 IP dump pointers Matt Turner
2026-12-02 22:34 ` [PATCH 3/3] drm/amdgpu: don't unmap legacy queues through MES during reset Matt Turner
2026-12-02 22:48 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.