From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F09810E065 for ; Wed, 29 Nov 2023 08:03:22 +0000 (UTC) From: Jesse Zhang To: Date: Wed, 29 Nov 2023 16:03:07 +0800 Message-ID: <20231129080307.135383-1-jesse.zhang@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Subject: [igt-dev] [PATCH i-g-t] tests/amdgpu: fix secure bounce test issue List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luben Tuikov , Alex Deucher , Christian Koenig Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: To the secure memory, the destination data(bo2) has been encrypted, after copying it via SDMA from bo to bo2. It cannot compare bo2 with the original data. Therefore, skip this memory check. Cc: Vitaly Prosyak Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian Koenig Cc: Kamil Konieczny Signed-off-by: Jesse Zhang --- tests/amdgpu/amd_security.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/amdgpu/amd_security.c b/tests/amdgpu/amd_security.c index d1146a7ce..678270fdf 100644 --- a/tests/amdgpu/amd_security.c +++ b/tests/amdgpu/amd_security.c @@ -225,14 +225,16 @@ amdgpu_secure_bounce(amdgpu_device_handle device_handle, int fd, secure == true ? 1 : 0); /* Verify the contents of Bob. */ - for (pp = (__typeof__(pp))ring_context->bo2_cpu; - pp < (__typeof__(pp)) ring_context->bo2_cpu + SECURE_BUFFER_SIZE; - pp += sizeof(secure_pattern)) { - r = memcmp(pp, secure_pattern, sizeof(secure_pattern)); - if (r) { - // test failure - igt_assert(false); - break; + if (!secure) { + for (pp = (__typeof__(pp))ring_context->bo2_cpu; + pp < (__typeof__(pp)) ring_context->bo2_cpu + SECURE_BUFFER_SIZE; + pp += sizeof(secure_pattern)) { + r = memcmp(pp, secure_pattern, sizeof(secure_pattern)); + if (r) { + // test failure + igt_assert(false); + break; + } } } -- 2.25.1