From 4e7872d2f71f511df155a9048f06761afce751da Mon Sep 17 00:00:00 2001 From: Maurice Ma Date: Wed, 16 Nov 2016 19:22:32 -0800 Subject: [PATCH] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue When coreboot reports memory range across 1MB, the current code cannot handle it properly. In this case the range should be adjusted to start from 1MB instead since the memory resource below 1MB has been preprocessed by CbSupportPei module. This patch fixed the coreboot + UEFI payload hang issue when running on QEMU due to incorrect memory map. Cc: Prince Agyeman Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Maurice Ma Reviewed-by: Prince Agyeman --- CorebootModulePkg/CbSupportPei/CbSupportPei.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c index 8fa0ac5c1e..831de89b21 100755 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c +++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c @@ -169,6 +169,11 @@ CbMemInfoCallback ( EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE; + if ((Base < 0x100000) && ((Base + Size) > 0x100000)) { + Size -= (0x100000 - Base); + Base = 0x100000; + } + MemInfo = (CB_MEM_INFO *)Param; if (Base >= 0x100000) { if (Type == CB_MEM_RAM) {