Attention is currently required from: Yu-Ping Wu.
Hello Yu-Ping Wu,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/80710?usp=email
to review the following change.
Change subject: vboot: Enable new arm64 SIMD crypto acceleration ......................................................................
vboot: Enable new arm64 SIMD crypto acceleration
This patch passes the correct flag to vboot to enable SIMD crypto acceleration on arm64 devices. This uses a core part of the ISA and should thus be supported on all arm64 SoCs -- so we normally always want it enabled, but there should still be a Kconfig in case a SoC wants to use the hwcrypto interface for its own (off-CPU) crypto acceleration engine instead. (You could also disable it to save a small amount of code size at the cost of speed, if necessary.)
Change-Id: I3820bd6b7505202b7edb6768385ce5deb18777a4 Signed-off-by: Julius Werner jwerner@chromium.org --- M payloads/libpayload/vboot/Kconfig M payloads/libpayload/vboot/Makefile.mk M src/security/vboot/Kconfig M src/security/vboot/Makefile.mk 4 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/80710/1
diff --git a/payloads/libpayload/vboot/Kconfig b/payloads/libpayload/vboot/Kconfig index 23d61f4..6d71a7c 100644 --- a/payloads/libpayload/vboot/Kconfig +++ b/payloads/libpayload/vboot/Kconfig @@ -49,4 +49,16 @@ help This option enables SHA256 implementation using ARMv8 Crypto Extension.
+config VBOOT_ARM64_RSA_ACCELERATION + bool "Use arm64 SIMD instructions to accelerate RSA signature verification" + default y + depends on ARCH_ARM64 + help + Use arm64 SIMD instructions (NEON) to parallelize two multiplications + in the modulus exponentiation algorithm, which speeds up RSA signature + verification in vboot. This is supported on all arm64 CPUs so you'd + generally always want this enabled, unless your SoC is overriding + vboot's hwcrypto API with its own crypto accelerator IP instead (or + you're trying really hard to save on code size). + endif diff --git a/payloads/libpayload/vboot/Makefile.mk b/payloads/libpayload/vboot/Makefile.mk index bdc9ad2a..554fec8 100644 --- a/payloads/libpayload/vboot/Makefile.mk +++ b/payloads/libpayload/vboot/Makefile.mk @@ -46,6 +46,7 @@ X86_SHA_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_SHA_EXT)) \ VB2_X86_RSA_ACCELERATION=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION)) \ ARMV8_CRYPTO_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_SHA_ARMV8_CE)) \ + ARM64_RSA_ACCELERATION=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_ARM64_RSA_ACCELERATION)) \ UNROLL_LOOPS=1 \ BUILD="$(VBOOT_BUILD_DIR)" \ V=$(V) \ diff --git a/src/security/vboot/Kconfig b/src/security/vboot/Kconfig index 56e94d5..4bd36f5 100644 --- a/src/security/vboot/Kconfig +++ b/src/security/vboot/Kconfig @@ -318,6 +318,18 @@ help Use ARMv8 Crypto Extension to accelerate SHA hash calculation in vboot.
+config VBOOT_ARM64_RSA_ACCELERATION + bool "Use arm64 SIMD instructions to accelerate RSA signature verification" + default y + depends on ARCH_VERSTAGE_ARM64 + help + Use arm64 SIMD instructions (NEON) to parallelize two multiplications + in the modulus exponentiation algorithm, which speeds up RSA signature + verification in vboot. This is supported on all arm64 CPUs so you'd + generally always want this enabled, unless your SoC is overriding + vboot's hwcrypto API with its own crypto accelerator IP instead (or + you're trying really hard to save on code size). + config VBOOT_DEFINE_WIDEVINE_COUNTERS bool default n diff --git a/src/security/vboot/Makefile.mk b/src/security/vboot/Makefile.mk index 1689efb..23271ea 100644 --- a/src/security/vboot/Makefile.mk +++ b/src/security/vboot/Makefile.mk @@ -33,6 +33,7 @@ VB2_X86_RSA_ACCELERATION="$(if $(CONFIG_ARCH_$(call toupper,$(1))_X86_32)$(CONFIG_ARCH_$(call toupper,$(1))_X86_64),$\ $(CONFIG_VBOOT_X86_RSA_ACCELERATION))" \ ARMV8_CRYPTO_EXT="$(if $(CONFIG_ARCH_$(call toupper,$(1))_ARMV8_64),$$(CONFIG_VBOOT_ARMV8_CE_SHA256_ACCELERATION))" \ + ARM64_RSA_ACCELERATION="$(if $(CONFIG_ARCH_$(call toupper,$(1))_ARM64),$$(CONFIG_VBOOT_ARM64_RSA_ACCELERATION))" \ $(MAKE) -C $(VBOOT_SOURCE) \ BUILD=$$(abspath $$(dir $$(VBOOT_LIB_$(1)))) \ V=$(V) \