From 7ceed042c440c2ed6d131d56399f6f4b54ffdee5 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Thu, 14 Nov 2024 13:06:58 +0200 Subject: [PATCH] riscv workarounds for timing related tests ------------- time ---------------------- real 1.07 user 0.84 sys 0.20 1 seconds sdr.sh: #9: pwdecrypt no time regression - FAILED Allow it to be <2 seconds. ------------- time ---------------------- real 8.12 user 7.69 sys 0.33 8 seconds dbtests.sh: #27: certutil dump keys with explicit default trust flags - FAILED Give it 20 seconds. Signed-off-by: David Abdurachmanov --- 0001-riscv-workarounds-for-timing.patch | 38 +++++++++++++++++++++++++ nss.spec | 7 ++--- 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 0001-riscv-workarounds-for-timing.patch diff --git a/0001-riscv-workarounds-for-timing.patch b/0001-riscv-workarounds-for-timing.patch new file mode 100644 index 0000000..78dc69e --- /dev/null +++ b/0001-riscv-workarounds-for-timing.patch @@ -0,0 +1,38 @@ +From 92025c4ca158dccf4a640ddcf52edda1e8ffd77e Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Thu, 14 Nov 2024 11:04:11 +0000 +Subject: [PATCH] riscv workarounds for timing + +All current boards are too slow to deliver required timing. + +Signed-off-by: David Abdurachmanov + +diff --git a/nss/tests/dbtests/dbtests.sh b/nss/tests/dbtests/dbtests.sh +index c82ea85..067b40d 100755 +--- a/nss/tests/dbtests/dbtests.sh ++++ b/nss/tests/dbtests/dbtests.sh +@@ -366,7 +366,7 @@ dbtest_main() + RARRAY=($dtime) + TIMEARRAY=(${RARRAY[1]//./ }) + echo "${TIMEARRAY[0]} seconds" +- test ${TIMEARRAY[0]} -lt 5 ++ test ${TIMEARRAY[0]} -lt 20 + ret=$? + html_msg ${ret} 0 "certutil dump keys with explicit default trust flags" + fi +diff --git a/nss/tests/sdr/sdr.sh b/nss/tests/sdr/sdr.sh +index a934460..e7024d2 100755 +--- a/nss/tests/sdr/sdr.sh ++++ b/nss/tests/sdr/sdr.sh +@@ -146,7 +146,7 @@ sdr_main() + RARRAY=($dtime) + TIMEARRAY=(${RARRAY[1]//./ }) + echo "${TIMEARRAY[0]} seconds" +- html_msg ${TIMEARRAY[0]} 0 "pwdecrypt no time regression" ++ html_msg ${TIMEARRAY[0]} 1 "pwdecrypt no time regression" + export NSS_MAX_MP_PBE_ITERATION_COUNT=$OLD_MAX_PBE_ITERATIONS + } + +-- +2.47.0 + diff --git a/nss.spec b/nss.spec index c16fd53..e3d6eb1 100644 --- a/nss.spec +++ b/nss.spec @@ -17,11 +17,7 @@ %global dracut_modules_dir %{dracutlibdir}/modules.d/05nss-softokn/ %global dracut_conf_dir %{dracutlibdir}/dracut.conf.d -%ifnarch riscv64 %bcond_without tests -%else -%bcond_with tests -%endif %bcond_with dbm # Produce .chk files for the final stripped binaries @@ -140,6 +136,9 @@ Patch41: nss-3.101-enable-kyber-policy.patch # fix unused variable warnings Patch42: nss-3.103-unused-cipherwrap2.patch +# riscv workarounds +Patch50: 0001-riscv-workarounds-for-timing.patch + Patch100: nspr-config-pc.patch Patch101: nspr-gcc-atomics.patch