summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorYidi Lin <yidilin@chromium.org>2023-01-12 14:49:43 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-08 18:58:52 +0000
commit95608084816fc30764610fc60f40d233a17368ab (patch)
tree0e355a2cd8b4af8128e297a39f761240bac95f2c /Makefile
parent45583dd9e413798d547768a614a3554a8d6c8ca8 (diff)
downloadvboot-95608084816fc30764610fc60f40d233a17368ab.tar.gz
vboot: add arm64 SHA256 extension support
Copy sha256_armv8a_ce_a64.S from [1] and make some small changes to make it fit in vboot_reference build environment. With this CL, the boot time gets 126ms improvement on Tentacruel. The `vboot kernel verification` is reduced to 12ms. [1] https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/crypto/sha256_armv8a_ce_a64.S BRANCH=corsola BUG=b:263514393 TEST=make install_dut_test; ./build/tests/vb2_sha256_x86_tests TEST=check `cbmem -t` on Tentacruel Change-Id: Ic9abeae9687b2162d7ddadd46111ec20f34e771c Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4170144 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 18 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0f58909f..6a21f1a9 100644
--- a/Makefile
+++ b/Makefile
@@ -395,8 +395,19 @@ endif
ifneq ($(filter-out 0,${X86_SHA_EXT}),)
CFLAGS += -DX86_SHA_EXT
FWLIB_SRCS += \
+ firmware/2lib/2hwcrypto.c \
firmware/2lib/2sha256_x86.c
endif
+
+ifneq ($(filter-out 0,${ARMV8_CRYPTO_EXT}),)
+CFLAGS += -DARMV8_CRYPTO_EXT
+FWLIB_SRCS += \
+ firmware/2lib/2hwcrypto.c \
+ firmware/2lib/2sha256_arm.c
+FWLIB_ASMS += \
+ firmware/2lib/sha256_armv8a_ce_a64.S
+endif
+
# Even if X86_SHA_EXT is 0 we need cflags since this will be compiled for tests
${BUILD}/firmware/2lib/2sha256_x86.o: CFLAGS += -mssse3 -mno-avx -msha
@@ -410,7 +421,7 @@ FWLIB_SRCS += \
firmware/2lib/2stub.c
endif
-FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o}
+FWLIB_OBJS = ${FWLIB_SRCS:%.c=${BUILD}/%.o} ${FWLIB_ASMS:%.S=${BUILD}/%.o}
TLCL_OBJS = ${TLCL_SRCS:%.c=${BUILD}/%.o}
ALL_OBJS += ${FWLIB_OBJS} ${TLCL_OBJS}
@@ -1109,9 +1120,9 @@ DUT_TEST_BINS = $(addprefix ${BUILD}/,${DUT_TEST_NAMES})
# Special build for sha256_x86 test
${BUILD}/tests/vb2_sha256_x86_tests: \
- ${BUILD}/firmware/2lib/2sha256_x86.o
+ ${BUILD}/firmware/2lib/2sha256_x86.o ${BUILD}/firmware/2lib/2hwcrypto.o
${BUILD}/tests/vb2_sha256_x86_tests: \
- LIBS += ${BUILD}/firmware/2lib/2sha256_x86.o
+ LIBS += ${BUILD}/firmware/2lib/2sha256_x86.o ${BUILD}/firmware/2lib/2hwcrypto.o
.PHONY: install_dut_test
install_dut_test: ${DUT_TEST_BINS}
@@ -1147,6 +1158,10 @@ ${BUILD}/%.o: ${BUILD}/%.c
@${PRINTF} " CC $(subst ${BUILD}/,,$@)\n"
${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+${BUILD}/%.o: %.S
+ @${PRINTF} " CC $(subst ${BUILD}/,,$@)\n"
+ ${Q}${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+
# ----------------------------------------------------------------------------
# Here are the special tweaks to the generic rules.