diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index e4e7b72e67..e6b602d79a 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -65,6 +66,11 @@ AmdSevSnpInitialize ( ResourceHob = Hob.ResourceDescriptor; if (ResourceHob->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) { + if (ResourceHob->PhysicalStart >= SIZE_4GB) { + ResourceHob->ResourceType = BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED; + continue; + } + MemEncryptSevSnpPreValidateSystemRam ( ResourceHob->PhysicalStart, EFI_SIZE_TO_PAGES ((UINTN)ResourceHob->ResourceLength)