[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be9042b9294bda450659d3cd418c5e8759d57319.camel@mengyan1223.wang>
Date: Tue, 30 Mar 2021 02:08:36 +0800
From: Xi Ruoyao <xry111@...gyan1223.wang>
To: Christian König
<ckoenig.leichtzumerken@...il.com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>
Cc: David Airlie <airlied@...ux.ie>,
Felix Kuehling <Felix.Kuehling@....com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Dan Horák <dan@...ny.cz>,
amd-gfx@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
stable@...r.kernel.org
Subject: Re: [PATCH] drm/amdgpu: fix an underflow on non-4KB-page systems
On 2021-03-29 20:04 +0200, Christian König wrote:
> Am 29.03.21 um 19:53 schrieb Xℹ Ruoyao:
> > If the initial value of `num_entires` (calculated at line 1654) is not
> > an integral multiple of `AMDGPU_GPU_PAGES_IN_CPU_PAGE`, in line 1681 a
> > value greater than the initial value will be assigned to it. That causes
> > `start > last + 1` after line 1708. Then in the next iteration an
> > underflow happens at line 1654. It causes message
> >
> > *ERROR* Couldn't update BO_VA (-12)
> >
> > printed in kernel log, and GPU hanging.
> >
> > Fortify the criteria of the loop to fix this issue.
>
> NAK the value of num_entries must always be a multiple of
> AMDGPU_GPU_PAGES_IN_CPU_PAGE or otherwise we corrupt the page tables.
>
> How do you trigger that?
Simply run "OpenGL area" from gtk3-demo (which just renders a triangle with GL)
under Xorg, on MIPS64. See the BugLink.
> Christian.
>
> >
> > BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1549
> > Fixes: a39f2a8d7066 ("drm/amdgpu: nuke amdgpu_vm_bo_split_mapping v2")
> > Reported-by: Xi Ruoyao <xry111@...gyan1223.wang>
> > Reported-by: Dan Horák <dan@...ny.cz>
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Xi Ruoyao <xry111@...gyan1223.wang>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > index ad91c0c3c423..cee0cc9c8085 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> > @@ -1707,7 +1707,7 @@ static int amdgpu_vm_bo_update_mapping(struct
> > amdgpu_device *adev,
> > }
> > start = tmp;
> >
> > - } while (unlikely(start != last + 1));
> > + } while (unlikely(start < last + 1));
> >
> > r = vm->update_funcs->commit(¶ms, fence);
> >
> >
> > base-commit: a5e13c6df0e41702d2b2c77c8ad41677ebb065b3
>
--
Xi Ruoyao <xry111@...gyan1223.wang>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists