libpayload: Add VBOOT_SHA_ARMV8_CE config

Add Kconfig option for VBOOT_SHA_ARMV8_CE, which will use ARMv8 Crypto
Extension for SHA256[1] instead of software implementation.

[1] https://crrev.com/c/4170144

BUG=b:263514393
BRANCH=corsola
TEST='vboot kernel verification' gets 111 msecs improvement on
Tentacruel.
Before:
1100:finished vboot kernel verification                905,150 (123,518)

After:
1100:finished vboot kernel verification                787,277 (12,254)

Cq-Depend: chromium:4170144, chromium:4242678
Change-Id: If92830830a0658dfad2a066e9efa624783865cf2
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72710
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Yidi Lin 2023-01-31 15:09:24 +08:00 committed by Felix Held
parent 458f1720f1
commit 70409217e7
2 changed files with 9 additions and 0 deletions

View File

@ -24,4 +24,12 @@ config VBOOT_X86_SHA_EXT
This option enables SHA256 implementation using x86 SHA processor extension
instructions: sha256msg1, sha256msg2, sha256rnds2.
config VBOOT_SHA_ARMV8_CE
bool "SHA256 implementation using ARMv8 Crypto Extension"
default y if CHROMEOS
default n
depends on ARCH_ARM64
help
This option enables SHA256 implementation using ARMv8 Crypto Extension.
endif

View File

@ -37,6 +37,7 @@ $(VBOOT_FW_LIB): $(obj)/libpayload-config.h
$(MAKE) -C "$(VBOOT_SOURCE)" \
TPM2_MODE=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_TPM2_MODE)) \
X86_SHA_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_SHA_EXT)) \
ARMV8_CRYPTO_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_SHA_ARMV8_CE)) \
UNROLL_LOOPS=1 \
BUILD="$(VBOOT_BUILD_DIR)" \
V=$(V) \