tests/amdgpu: add atomic dma command to verify the secure buffer (v2)
DMA's atomic behavir is unlike GFX,If the comparing data is not equal to destination data, For GFX, loop again till gfx timeout(system hang). For DMA, loop again till timer expired and then send interrupt. So testcase can't use interrupt mechanism. We take another way to verify. When the comparing data is not equal to destination data, overwrite the source data to the destination buffer. Otherwise, original destination data unchanged. So if the bo_cpu data is overwritten, the result is passed. Steps: 1. use linear write packet to write 0xdeadbeaf to secure buffer, 2. use atmoic packet and ATOMIC_CMPSWAP_RTN_32 opcode to compare the cmp_data(0xdeadbeaf) to the written data which has been encrypted. v2: add the case of (dest_data != cmp_data). Acked-by: Huang Rui <ray.huang@amd.com> Acked-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Aaron Liu <aaron.liu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Loading
Please register or sign in to comment