summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-12-04 14:10:10 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-03 20:13:50 +0000
commitdfeab24959351002ea7b2d57bc06d39ae31918df (patch)
treee71cea64b118f5e6d5cfc75f9161260cf19fdf6e
parentf4a9874191c1abc99978cc346391e4795cbf68df (diff)
downloadvboot-dfeab24959351002ea7b2d57bc06d39ae31918df.tar.gz
Makefile: Make loop unrolling fully controllable by the caller
We recently reactivated the -DUNROLL_LOOPS code for x86 devices. Unfortunatley, this seems to lead to code size problems for early firmware stages on certain x86 boards (CB:37475). The biggest speedup with unrolled loops was observed during kernel verification anyway (which hashes orders of magnitude more data than firmware verification), so let's make this fully configurable by the calling firmware and only enable it from depthcharge. Pre-RAM coreboot changes are probably better served with the smaller implementation anyway (and this will only become more important as we move to CBFS per-file hashing and need hash algorithms in every stage). BRANCH=None BUG=None TEST=None Cq-Depend: chromium:1951413 Change-Id: I87eaa14299cae0ee0d0b4a098d638b6bccdaf75b Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1951782 Reviewed-by: Aaron Durbin <adurbin@google.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> (cherry picked from commit 695c56dc50a59e5c9098c94f41b3d86b8f99baf1) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1986929 Reviewed-by: Shelley Chen <shchen@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 0241e8f7..92876a92 100644
--- a/Makefile
+++ b/Makefile
@@ -862,12 +862,14 @@ ${TLCL_OBJS}: CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST
# CFLAGS += -DTPM_MANUAL_SELFTEST
-ifneq ($(filter $(FIRMWARE_ARCH),x86 x86_64),)
-# Unrolling loops in cryptolib makes it faster
+ifneq ($(filter-out 0,$(UNROLL_LOOPS)),)
+$(info vboot hash algos built with unrolled loops (faster, larger code size))
${FWLIB_OBJS}: CFLAGS += -DUNROLL_LOOPS
${FWLIB2X_OBJS}: CFLAGS += -DUNROLL_LOOPS
${FWLIB20_OBJS}: CFLAGS += -DUNROLL_LOOPS
${FWLIB21_OBJS}: CFLAGS += -DUNROLL_LOOPS
+else
+$(info vboot hash algos built with tight loops (slower, smaller code size))
endif
${FWLIB21_OBJS}: INCLUDES += -Ifirmware/lib21/include