]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
drm/amdkfd: dqm fence memory corruption
authorQu Huang <jinsdb@126.com>
Thu, 28 Jan 2021 12:14:25 +0000 (20:14 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:50 +0000 (15:42 -0500)
commit47da923c81a040dfce9777b9bbaf13945fb74983
tree755775a49fbe1f1f122ebb72928dc0331b0fb2ba
parent75f7c053d539c71bf444656b8d58566cbc42643e
drm/amdkfd: dqm fence memory corruption

BugLink: https://bugs.launchpad.net/bugs/1923069
commit e92049ae4548ba09e53eaa9c8f6964b07ea274c9 upstream.

Amdgpu driver uses 4-byte data type as DQM fence memory,
and transmits GPU address of fence memory to microcode
through query status PM4 message. However, query status
PM4 message definition and microcode processing are all
processed according to 8 bytes. Fence memory only allocates
4 bytes of memory, but microcode does write 8 bytes of memory,
so there is a memory corruption.

Changes since v1:
  * Change dqm->fence_addr as a u64 pointer to fix this issue,
also fix up query_status and amdkfd_fence_wait_timeout function
uses 64 bit fence value to make them consistent.

Signed-off-by: Qu Huang <jinsdb@126.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_vi.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h