From 0f93a91548c254c7759174b333e51edb65a95712 Mon Sep 17 00:00:00 2001 From: Eugene Myers Date: Tue, 11 May 2021 08:33:07 -0400 Subject: security/intel/stm: Reset BIOS resource list on every stm_setup call Some platforms run the smm_relocation function twice during initialization. This results in the BIOS resource list becoming twice as long. Also, testing has shown that elements of the list created in the first interation may have invalid data included in the resource list. This patch resolves these issues by reseting the list every time stm_setup is involked. This patch has been tested on the Purism L1UM-1X8C Change-Id: I874871ff01bdf0d00a3e6b48bc885e7abaa25112 Signed-off-by: Eugene Myers Reviewed-on: https://review.coreboot.org/c/coreboot/+/55627 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/security/intel/stm/StmPlatformResource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/security/intel/stm/StmPlatformResource.c b/src/security/intel/stm/StmPlatformResource.c index 6fef515052f0..7aa432de4059 100644 --- a/src/security/intel/stm/StmPlatformResource.c +++ b/src/security/intel/stm/StmPlatformResource.c @@ -179,8 +179,12 @@ static void add_msr_resources(void) /* * Add resources to BIOS resource database. */ + +extern uint8_t *m_stm_resources_ptr; + void add_resources_cmd(void) { + m_stm_resources_ptr = NULL; add_simple_resources(); -- cgit v1.2.3