diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 2bc1c46dff..4879ee87b7 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -17,6 +17,7 @@ Module Name: #include #include #include +#include // // The Library classes this module consumes @@ -626,6 +627,15 @@ PublishPeiMemory ( } } + // + // MEMFD_BASE_ADDRESS separates the SMRAM at the default SMBASE from the + // normal boot permanent PEI RAM. Regarding the S3 boot path, the S3 + // permanent PEI RAM is located even higher. + // + if (FeaturePcdGet (PcdSmmSmramRequire) && mQ35SmramAtDefaultSmbase) { + ASSERT (SMM_DEFAULT_SMBASE + MCH_DEFAULT_SMBASE_SIZE <= MemoryBase); + } + // // Publish this memory to the PEI Core //