From f25ee547634375b7f2dfa09209942fd03d00c76f Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 25 Jan 2023 18:10:49 +0100 Subject: [PATCH] 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 Signed-off-by: Gerd Hoffmann Tested-by: Tom Lendacky Reviewed-by: Jiewen Yao --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index 5aeeeff89f..38cece9173 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/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: