From 4f9853a9a58d8d13fd3585f1ce7fe39945f86d81 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Thu, 27 Oct 2022 22:49:40 -0600 Subject: [PATCH] security/vboot: Update build rules using x86 SHA extension Currently build rules allow using x86 SHA extensions for all coreboot stages when enabled. On some SoCs where verstage can run in non-x86 environment, x86 SHA extension cannot be used. Update build rules accordingly such that x86 SHA extensions can be used in AMD SoCs. This is particularly useful when CBFS verificiation is enabled which verifies the hash of the CBFS file being loaded. BUG=b:227809919 TEST=Build and boot to OS in Skyrim. Observe that hardware acceleration is used when a CBFS file is loaded and observe an overall improvement of 10 ms. Change-Id: I4f388e963eb82990cda41d3880e66ad937334908 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/68953 Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) Reviewed-by: Kangheui Won Reviewed-by: Yu-Ping Wu --- src/security/vboot/Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/security/vboot/Makefile.inc b/src/security/vboot/Makefile.inc index d38fbace49..bd738711c3 100644 --- a/src/security/vboot/Makefile.inc +++ b/src/security/vboot/Makefile.inc @@ -28,7 +28,8 @@ $$(VBOOT_LIB_$(1)): $(obj)/config.h CC="$$(CC_$(1))" \ CFLAGS="$$(VBOOT_CFLAGS_$(1))" VBOOT2="y" \ EC_EFS="$(CONFIG_VBOOT_EC_EFS)" \ - X86_SHA_EXT="$(CONFIG_VBOOT_X86_SHA256_ACCELERATION)" \ + X86_SHA_EXT="$(if $(CONFIG_ARCH_$(call toupper,$(1))_X86_32)$(CONFIG_ARCH_$(call toupper,$(1))_X86_64),$\ + $(CONFIG_VBOOT_X86_SHA256_ACCELERATION))" \ $(MAKE) -C $(VBOOT_SOURCE) \ BUILD=$$(abspath $$(dir $$(VBOOT_LIB_$(1)))) \ V=$(V) \