Browse Source

OvmfPkg: fix BuildResourceDescriptorHob call in PlatformAddHobCB()

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>
Gerd Hoffmann 1 year ago
parent
commit
f25ee54763
1 changed files with 1 additions and 1 deletions
  1. 1 1
      OvmfPkg/Library/PlatformInitLib/MemDetect.c

+ 1 - 1
OvmfPkg/Library/PlatformInitLib/MemDetect.c

@@ -200,7 +200,7 @@ PlatformAddHobCB (
 
       break;
     case EfiAcpiAddressRangeReserved:
-      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End);
+      BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End - Base);
       DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End));
       break;
     default: