From ec1d8afd51950d4724db47303ab940ea411cd99d Mon Sep 17 00:00:00 2001 From: Vadim Sukhomlinov Date: Fri, 14 Apr 2023 08:03:33 -0700 Subject: cr50: remove -fconserve-stack for cr50 excluding FIPS 1. -fconserve-stack costs 888 bytes (1.7K for CRYPTO_TEST=1) of code size with unclear benefits. This option exists since initial commit `e24fa592d` on 7 Dec 2011. Real stack usage after TCG tests is sligthly reduced for TPM2 and CONSOLE tasks, slightly increased for HOOKS task. 2. FIPS digest remains the same as FIPS module still compiles with this option set. This has a penalty of ~200 bytes, but maintaining stable digest is more important. Before: *** 3700 bytes in flash and 1100 bytes in RAM Task Ready Name Events Time (s) StkUsed 0 R << idle >> 80000000 2622.363199 104/512 1 HOOKS 00000000 83.747318 664/1024 2 TPM 00000000 34.779582 7600/8192 3 R CONSOLE 00000000 0.338724 424/1024 After: *** 4588 bytes in flash and 1100 bytes in RAM Task Ready Name Events Time (s) StkUsed 0 R << idle >> 80000000 747.794338 104/512 1 R HOOKS 80000000 9.372003 704/1024 2 TPM 00000000 36.982134 7588/8192 3 R CONSOLE 00000000 0.428505 408/1024 BUG=b:277777628 TEST=make BOARD=cr50; tpm_test.py; TCG tests Change-Id: I1ae1c8af6b0870b48f3f985476fa0a0d2b8f57d0 Signed-off-by: Vadim Sukhomlinov Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426791 Tested-by: Vadim Sukhomlinov Reviewed-by: Mary Ruthven Commit-Queue: Vadim Bendebury Reviewed-by: Vadim Bendebury Code-Coverage: Vadim Sukhomlinov Reviewed-by: Vadim Sukhomlinov Auto-Submit: Vadim Sukhomlinov --- core/cortex-m/build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk index cf2d851c77..9415b97487 100644 --- a/core/cortex-m/build.mk +++ b/core/cortex-m/build.mk @@ -37,7 +37,7 @@ export CFLAGS_LTO_PARTIAL_LINK := -flinker-output=nolto-rel # -ffat-lto-objects is a workaround for b/134623681 # Disable assembler warnings # TODO (b/238039591) Remove `-Wa,W` when binutils is fixed. -CFLAGS_CPU += -Wa,-W -ffat-lto-objects -fconserve-stack +CFLAGS_CPU += -Wa,-W -ffat-lto-objects endif core-y=cpu.o init.o ldivmod.o llsr.o uldivmod.o vecttable.o -- cgit v1.2.1