From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5DE5D81E97 for ; Wed, 16 Nov 2016 19:42:18 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 16 Nov 2016 19:42:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,651,1473145200"; d="scan'208";a="192382346" Received: from mxma-desk2.amr.corp.intel.com ([134.134.163.132]) by fmsmga004.fm.intel.com with ESMTP; 16 Nov 2016 19:42:22 -0800 From: Maurice Ma To: edk2-devel@lists.01.org Cc: Maurice Ma , Prince Agyeman Date: Wed, 16 Nov 2016 19:42:22 -0800 Message-Id: X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <58496c8d78c6b08276762a8f23a133260278d146.1479353852.git.maurice.ma@intel.com> References: <58496c8d78c6b08276762a8f23a133260278d146.1479353852.git.maurice.ma@intel.com> Subject: [PATCH 2/2] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 03:42:18 -0000 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 --- CorebootModulePkg/CbSupportPei/CbSupportPei.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c index 8fa0ac5c1efa..831de89b21d1 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) { -- 2.7.4.windows.1