tests/amdgpu: add atomic_mem cp_packet to verify the secure buffer
authorAaron Liu <aaron.liu@amd.com>
Thu, 14 Nov 2019 08:14:06 +0000 (16:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Oct 2020 17:46:22 +0000 (13:46 -0400)
commit5de99b1fa610b8395e1501446ee8340fd044b1fe
tree2b2f1e6fe80a490c7ebf695e123fc8c1ed725205
parentb352ef44b879cfac275d5aeb06d0ab8511dd0d14
tests/amdgpu: add atomic_mem cp_packet to verify the secure buffer

Secure buffer is only able to be read with trusted ip block.
So we need use GFX ip to read it back instead of CPU.
Steps:
1. use write_data packet to write 0xdeadbeaf to secure buffer,
2. use atmoic_mem packet and ATOMIC_CMPSWAP_RTN_32 opcode to compare
the cmp_data(0xdeadbeaf) to the written data which has been encrypted.
If the result is equal, then overwrite the src_data(0x12345678) to the
secure buffer and return directly. Otherwise loop again until gfx timeout
and the secure buffer data unchanged.

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>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
tests/amdgpu/basic_tests.c