Aaron Durbin submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Arthur Heymans: Looks good to me, but someone else must approve
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 <josienordrum@google.com>
Change-Id: I3a4c199c42ee556187d6c4277e8793a36e4d493b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45274
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
---
M src/lib/fmap.c
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lib/fmap.c b/src/lib/fmap.c
index e1e6a57..377123a 100644
--- a/src/lib/fmap.c
+++ b/src/lib/fmap.c
@@ -46,6 +46,10 @@
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,

To view, visit change 45274. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3a4c199c42ee556187d6c4277e8793a36e4d493b
Gerrit-Change-Number: 45274
Gerrit-PatchSet: 6
Gerrit-Owner: Josie Nordrum <josienordrum@google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged