Odd. The structure should be 0 initialized. Does this patch help?
Alex ________________________________ From: Timothy Pearson <[email protected]> Sent: Monday, June 25, 2018 11:53:12 AM To: Zhu, James Cc: [email protected]; Deucher, Alexander; Zhou, David(ChunMing); Koenig, Christian Subject: Re: [PATCH] Increase AMDGPU_MAX_UVD_INSTANCES to 3 n 06/25/2018 09:46 AM, James Zhu wrote: > > > On 2018-06-23 08:02 PM, Timothy Pearson wrote: >> amdgpu_fence_driver_start_ring() attempts to access >> UVD instance 2 during setup, while the existing UVD >> instance count only allows instances 0 and 1. >> >> Increase AMDGPU_MAX_UVD_INSTANCES by one to avoid the >> invalid array access. >> >> Caught by UBSAN. > Hi Timothy, > > From design of view, it is not right to just change > AMDGPU_MAX_UVD_INSTANCES to 3. > > Could you tell me some detail of UBSAN test and attach the dmesg also? Definitely, was looking for some feedback from anyone knowing more about the internals of the UVD system. What's happening is that "ring->me" in amdgpu_fence_driver_start_ring() (drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:379) is set to a value of "2". The overall dmesg is otherwise uninteresting, but I can try to grab the UBSAN output if needed. -- Timothy Pearson Raptor Engineering +1 (415) 727-8645 (direct line) +1 (512) 690-0200 (switchboard) https://www.raptorengineering.com
From 606968912685af9c12881eb90999413c5014217c Mon Sep 17 00:00:00 2001 From: Alex Deucher <[email protected]> Date: Mon, 25 Jun 2018 12:11:08 -0500 Subject: [PATCH] drm/amdgpu/uvd: explicitly set ring->me for UVD instances Shouldn't be necessary since the structure is 0 initialized. Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 1 + drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 1 + drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c index 6fed3d7797a8..a60e36ee43c2 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c @@ -766,6 +766,7 @@ static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = { static void uvd_v4_2_set_ring_funcs(struct amdgpu_device *adev) { adev->uvd.inst->ring.funcs = &uvd_v4_2_ring_funcs; + adev->uvd.inst[0].ring.me = 0; } static const struct amdgpu_irq_src_funcs uvd_v4_2_irq_funcs = { diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c index 341ee6d55ce8..c9fca8f36b25 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c @@ -874,6 +874,7 @@ static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = { static void uvd_v5_0_set_ring_funcs(struct amdgpu_device *adev) { adev->uvd.inst->ring.funcs = &uvd_v5_0_ring_funcs; + adev->uvd.inst[0].ring.me = 0; } static const struct amdgpu_irq_src_funcs uvd_v5_0_irq_funcs = { diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index bfddf97dd13e..3bddf0bc1268 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c @@ -1630,6 +1630,7 @@ static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev) adev->uvd.inst->ring.funcs = &uvd_v6_0_ring_phys_funcs; DRM_INFO("UVD is enabled in physical mode\n"); } + adev->uvd.inst[0].ring.me = 0; } static void uvd_v6_0_set_enc_ring_funcs(struct amdgpu_device *adev) -- 2.13.6
_______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
