• Qu Huang's avatar
    drm/amdkfd: dqm fence memory corruption · e92049ae
    Qu Huang authored
    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: default avatarQu Huang <jinsdb@126.com>
    Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
    e92049ae
kfd_device_queue_manager.c 53.9 KB