summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-12-04 14:10:10 -0800
committerCommit Bot <commit-bot@chromium.org>2019-12-06 00:13:45 +0000
commit020f32e4026f3041477eaf7dbc9f270af94376ed (patch)
tree58bf87a8ff05069e7ff66fb3e85a5679aadf2b3e
parentd74b33fac4d51cbb077712d77567b702badb5d33 (diff)
downloadvboot-020f32e4026f3041477eaf7dbc9f270af94376ed.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/+/1954965 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Auto-Submit: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--Makefile12
1 files changed, 4 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 398baa97..006767da 100644
--- a/Makefile
+++ b/Makefile
@@ -839,18 +839,14 @@ ${FWLIB_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
-
-# Workaround for coreboot on x86, which will power off asynchronously
-# without giving us a chance to react. This is not an example of the Right
-# Way to do things. See chrome-os-partner:7689, and the commit message
-# that made this change.
-${FWLIB_OBJS}: CFLAGS += -DSAVE_LOCALE_IMMEDIATELY
+else
+$(info vboot hash algos built with tight loops (slower, smaller code size))
endif
${FWLIB21_OBJS}: INCLUDES += -Ifirmware/lib21/include