diff options
author | Yidi Lin <yidilin@chromium.org> | 2023-01-31 15:18:57 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-02-16 15:04:40 +0000 |
commit | bd6b81dcad8be11e0e6fa5c7c2d07ab9891038d8 (patch) | |
tree | 9c4a90d5266022fcab927ee0dfe3f4a745dd4e6e | |
parent | 70409217e7a747d8d0113583648b6ac28f256ae9 (diff) |
vboot: Add VBOOT_ARMV8_CE_SHA256_ACCELERATION config
Add Kconfig option for VBOOT_ARMV8_CE_SHA256_ACCELERATION, which will
use ARMv8 Crypto Extension for SHA256[1] instead of software
implementation.
This will speed up firmware verification in verstage.
[1] https://crrev.com/c/4170144
BUG=b:263514393
BRANCH=corsola
TEST='calculating body hash (SHA2)' get 13 msecs improvement on
Tentacruel.
Before:
509:finished calculating body hash (SHA2) 161,548 (14,490)
After:
509:finished calculating body hash (SHA2) 155,101 (1,187)
Change-Id: I02671338fd9e0deb5294dbb7c03528061edc18c4
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72711
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/security/vboot/Kconfig | 8 | ||||
-rw-r--r-- | src/security/vboot/Makefile.inc | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/security/vboot/Kconfig b/src/security/vboot/Kconfig index 9025979596..a9981874cc 100644 --- a/src/security/vboot/Kconfig +++ b/src/security/vboot/Kconfig @@ -291,6 +291,14 @@ config VBOOT_X86_SHA256_ACCELERATION Use sha256msg1, sha256msg2, sha256rnds2 instruction to accelerate SHA hash calculation in vboot. +config VBOOT_ARMV8_CE_SHA256_ACCELERATION + bool "Use ARMv8 Crypto Extension for sha256 hash calculation" + default y if CHROMEOS + default n + depends on ARCH_ARM64 + help + Use ARMv8 Crypto Extension to accelerate SHA hash calculation in vboot. + config VBOOT_DEFINE_WIDEVINE_COUNTERS bool default n diff --git a/src/security/vboot/Makefile.inc b/src/security/vboot/Makefile.inc index 52d6de39f6..9e42ab124b 100644 --- a/src/security/vboot/Makefile.inc +++ b/src/security/vboot/Makefile.inc @@ -30,6 +30,7 @@ $$(VBOOT_LIB_$(1)): $(obj)/config.h EC_EFS="$(CONFIG_VBOOT_EC_EFS)" \ X86_SHA_EXT="$(if $(CONFIG_ARCH_$(call toupper,$(1))_X86_32)$(CONFIG_ARCH_$(call toupper,$(1))_X86_64),$\ $(CONFIG_VBOOT_X86_SHA256_ACCELERATION))" \ + ARMV8_CRYPTO_EXT="$(if $(CONFIG_ARCH_$(call toupper,$(1))_ARMV8_64),$$(CONFIG_VBOOT_ARMV8_CE_SHA256_ACCELERATION))" \ $(MAKE) -C $(VBOOT_SOURCE) \ BUILD=$$(abspath $$(dir $$(VBOOT_LIB_$(1)))) \ V=$(V) \ |