From c3cc1584088ad68eb9765b2252087c3b27b167cf Mon Sep 17 00:00:00 2001 From: Josie Nordrum Date: Wed, 9 Sep 2020 12:57:13 -0600 Subject: [PATCH] lib/fmap: add ENV_SMM check to setup_preram_cache Add check in setup_preram_cache to return if ENV_SMM is true. This avoids false warning that post-RAM FMAP is accessed too early caused by ENV_ROMSTAGE_OR_BEFORE evaluation in SMI handler. BUG=b:167321319 BRANCH=None TEST=None Signed-off-by: Josie Nordrum Change-Id: I3a4c199c42ee556187d6c4277e8793a36e4d493b Reviewed-on: https://review.coreboot.org/c/coreboot/+/45274 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Aaron Durbin --- src/lib/fmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/fmap.c b/src/lib/fmap.c index e1e6a57a22..377123afdc 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -46,6 +46,10 @@ static void setup_preram_cache(struct mem_region_device *cache_mrdev) if (CONFIG(NO_FMAP_CACHE)) return; + /* No need to use FMAP cache in SMM */ + if (ENV_SMM) + return; + if (!ENV_ROMSTAGE_OR_BEFORE) { /* We get here if ramstage makes an FMAP access before calling cbmem_initialize(). We should avoid letting it come to that,