tests/amdgpu: add secure buffer allocation test for system memory
authorHuang Rui <ray.huang@amd.com>
Fri, 16 Aug 2019 08:18:21 +0000 (16:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Oct 2020 17:45:50 +0000 (13:45 -0400)
This patch is to add secure buffer allocation test for system memory.

Acked-by: Huang Rui <ray.huang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
tests/amdgpu/security_tests.c

index 182b03d..afe79e5 100644 (file)
@@ -93,4 +93,13 @@ static void amdgpu_security_alloc_buf_test(void)
 
        r = gpu_mem_free(bo, va_handle, bo_mc, 4096);
        CU_ASSERT_EQUAL(r, 0);
+
+       /* Test secure buffer allocation in system memory */
+       bo = gpu_mem_alloc(device_handle, 4096, 4096,
+                          AMDGPU_GEM_DOMAIN_GTT,
+                          AMDGPU_GEM_CREATE_ENCRYPTED,
+                          &bo_mc, &va_handle);
+
+       r = gpu_mem_free(bo, va_handle, bo_mc, 4096);
+       CU_ASSERT_EQUAL(r, 0);
 }