summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2023-01-25 18:10:49 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-01-26 08:59:29 +0000
commitf25ee547634375b7f2dfa09209942fd03d00c76f (patch)
tree28e5dc06eeafe83a8277c78738c64bb0e7e8e3e6
parent37d3eb026a766b2405daae47e02094c2ec248646 (diff)
downloadedk2-f25ee547634375b7f2dfa09209942fd03d00c76f.tar.gz
edk2-f25ee547634375b7f2dfa09209942fd03d00c76f.tar.bz2
edk2-f25ee547634375b7f2dfa09209942fd03d00c76f.zip
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>
-rw-r--r--OvmfPkg/Library/PlatformInitLib/MemDetect.c2
1 files changed, 1 insertions, 1 deletions
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: