From 8ec49e48310c91c91248cc53e37d7f2e34c69687 Mon Sep 17 00:00:00 2001 From: Islam Ragimov Date: Fri, 15 Nov 2024 14:11:05 +0000 Subject: [PATCH 1/3] Updated burst api test for aarch64 Previously imported commit ingored changes for aarch64 - caused by commit: 9674a1642dc993fac60fa1cb1a82ef1913cec3a8 - upstream commit: f8889c509cbc3cbf902b122dbe66f05f932145d2 Change-Id: I91eda089e95f61c7c1119197e0e53182feb72202 --- test/kat-app/api_test.c | 54 +++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/test/kat-app/api_test.c b/test/kat-app/api_test.c index f4b0d190..058790b6 100644 --- a/test/kat-app/api_test.c +++ b/test/kat-app/api_test.c @@ -711,9 +711,6 @@ test_burst_api(struct IMB_MGR *mb_mgr) uint32_t i, completed_jobs, n_jobs = MAX_BURST_JOBS; struct IMB_JOB **null_jobs = NULL; int err; -#ifdef __aarch64__ - int earliest_job, next_job; -#endif printf("SUBMIT_BURST() API behavior test:\n"); @@ -776,6 +773,10 @@ test_burst_api(struct IMB_MGR *mb_mgr) print_progress(); } + /* from this point IMB_CIPHER_ZUC_EEA3 will be used instead of + * IMB_CIPHER_CBC for aarch64, since IMB_CIPHER_CBC is not + * supported for aarch64 */ + /* ======== test 4 : invalid job order */ while (IMB_GET_NEXT_BURST(mb_mgr, n_jobs, jobs) < n_jobs) @@ -862,37 +863,6 @@ test_burst_api(struct IMB_MGR *mb_mgr) if (!quiet_mode) printf("\n"); -#ifdef __aarch64__ - if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) { - /* ======== test 6: full job queue wprapping around */ - earliest_job = mb_mgr->earliest_job; - next_job = mb_mgr->next_job; - /* simulate mb_mgr job queue being almost full of jobs that are still processing */ - mb_mgr->earliest_job = mb_mgr->next_job = 0; - /* mark one job as complete, so SUBMIT_BURST has something to return */ - mb_mgr->jobs[0].status = IMB_STATUS_COMPLETED; - for (i = 1; i < IMB_MAX_JOBS; i++) { - mb_mgr->jobs[i].status = IMB_STATUS_BEING_PROCESSED; - } - /* just collect completions */ - IMB_SUBMIT_BURST_NOCHECK(mb_mgr, 0, jobs); - - /* ensure that mbr_mgr job buffer was not marked as "empty" in the process */ - if (mb_mgr->earliest_job == -1) { - printf("%s: test %d, job buffer unexpectedly marked 'empty'\n", __func__, - TEST_INVALID_BURST); - return 1; - } - /* restore job queue state */ - for (i = 0; i < IMB_MAX_JOBS; i++) { - mb_mgr->jobs[i].status = IMB_STATUS_COMPLETED; - } - mb_mgr->earliest_job = earliest_job; - mb_mgr->next_job = next_job; - - return 0; - } -#else /* ======== test 6: full job queue wrapping around */ struct IMB_JOB *burst_jobs[IMB_MAX_BURST_SIZE] = { NULL }; @@ -916,11 +886,20 @@ test_burst_api(struct IMB_MGR *mb_mgr) return 1; } + /* using IMB_CIPHER_SNOW3G_UEA2_BITLEN instead of IMB_CIPHER_ZUC_EEA3 + * for the aarch64 in the following case to have succesful validation + * of msg_len_to_cipher_in_bytes for the first job */ + /* fill in valid jobs */ for (i = 0; i < num_jobs; i++) { job = burst_jobs[i]; +#ifndef __aarch64__ fill_in_job(job, IMB_CIPHER_CBC, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, IMB_ORDER_CIPHER_HASH, NULL, NULL); +#else /* __aarch64__ */ + fill_in_job(job, IMB_CIPHER_SNOW3G_UEA2_BITLEN, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, + IMB_ORDER_CIPHER_HASH, NULL, NULL); +#endif /* __aarch64__ */ imb_set_session(mb_mgr, job); } @@ -974,8 +953,13 @@ test_burst_api(struct IMB_MGR *mb_mgr) /* fill in valid jobs */ for (i = 0; i < num_jobs; i++) { job = burst_jobs[i]; +#ifndef __aarch64__ fill_in_job(job, IMB_CIPHER_CBC, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, IMB_ORDER_CIPHER_HASH, NULL, NULL); +#else /* __aarch64__ */ + fill_in_job(job, IMB_CIPHER_ZUC_EEA3, IMB_DIR_ENCRYPT, IMB_AUTH_NULL, + IMB_ORDER_CIPHER_HASH, NULL, NULL); +#endif /* __aarch64__ */ imb_set_session(mb_mgr, job); } @@ -1033,7 +1017,7 @@ test_burst_api(struct IMB_MGR *mb_mgr) if ((mb_mgr->features & IMB_FEATURE_SAFE_PARAM) == 0) return 0; -#endif + printf("GET_NEXT_BURST() API behavior test:\n"); /* ======== test 7 : NULL pointer to burst job array */ -- GitLab From ce6fa41c719b50262f3280ddbc01b655db8cbf3c Mon Sep 17 00:00:00 2001 From: Islam Ragimov Date: Fri, 15 Nov 2024 14:12:30 +0000 Subject: [PATCH 2/3] Fixed CMake Debug build for aarch64 - caused by commit: 75986d67269be6bb047cb4326e4c2279946cd2d1 - upstream commit: 560ead8f05d2f5c6bf35364e293cd18011b53fab Change-Id: I589ff76097df42b7b147a87df109c27b55066832 --- perf/ipsec_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perf/ipsec_perf.c b/perf/ipsec_perf.c index 8ce1c71a..61a64cd3 100644 --- a/perf/ipsec_perf.c +++ b/perf/ipsec_perf.c @@ -1766,7 +1766,6 @@ do_test_quic_aes_ecb_hp(struct params_s *params, const uint32_t num_iter, IMB_MG return time / num_iter; } -#endif /* __aarch64__ */ static uint64_t do_test_quic_chacha20_hp(struct params_s *params, const uint32_t num_iter, IMB_MGR *p_mgr, @@ -1821,6 +1820,7 @@ do_test_quic_chacha20_hp(struct params_s *params, const uint32_t num_iter, IMB_M return time / num_iter; } +#endif /* __aarch64__ */ /* Performs test using AES_HMAC or DOCSIS */ static uint64_t -- GitLab From 941a040d6c5a6944c684f8cfce63da00b020b272 Mon Sep 17 00:00:00 2001 From: Islam Ragimov Date: Fri, 15 Nov 2024 14:17:31 +0000 Subject: [PATCH 3/3] Added .bss section with gps and simd_regs labels for aarch64 Fix for safe-check tests degradation appeared after applying the following upstream commits: - from: 8086d7b550deeddc06b70dbbcad4e9d14e83c069 - to: cb9d2a7dda69c61eefa33ff68c5c339a627bbea8 Change-Id: I86ba57a998bd8e576cbf9d5b263b3db9d1deed9e --- test/xvalid-app/misc_aarch64.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/xvalid-app/misc_aarch64.S b/test/xvalid-app/misc_aarch64.S index 27882c24..c032ebee 100644 --- a/test/xvalid-app/misc_aarch64.S +++ b/test/xvalid-app/misc_aarch64.S @@ -28,6 +28,18 @@ **********************************************************************/ .arch armv8-a+sve +.section .bss + +.align 8 +gps: +.space 29*8 + +.align 8 +simd_regs: +.space 32*32 + +.section .text + .global nosimd_memcpy .type nosimd_memcpy,%function .align 5 -- GitLab