]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: fix BuildResourceDescriptorHob call in PlatformAddHobCB()
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 25 Jan 2023 17:10:49 +0000 (18:10 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 26 Jan 2023 08:59:29 +0000 (08:59 +0000)
BuildResourceDescriptorHob() expects the third parameter be the Length,
not the End address.

Fixes: 328076cfdf45 ("OvmfPkg/PlatformInitLib: Add PlatformAddHobCB")
Reported-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
OvmfPkg/Library/PlatformInitLib/MemDetect.c

index 5aeeeff89f574be785a2bfed70d774c6e4ce23f8..38cece9173e8011fd1930d43e163cd3048b24198 100644 (file)
@@ -200,7 +200,7 @@ PlatformAddHobCB (
 \r
       break;\r
     case EfiAcpiAddressRangeReserved:\r
-      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End);\r
+      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End - Base);\r
       DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End));\r
       break;\r
     default:\r