public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Maurice Ma <maurice.ma@intel.com>
To: edk2-devel@lists.01.org
Cc: Maurice Ma <maurice.ma@intel.com>,
	Prince Agyeman <prince.agyeman@intel.com>
Subject: [PATCH 2/2] CorebootPayloadPkg/CbSupportPei: Fix the memory map issue
Date: Wed, 16 Nov 2016 19:42:22 -0800	[thread overview]
Message-ID: <cfee2f1814679b9e66c2bf8335620102500e3b13.1479353852.git.maurice.ma@intel.com> (raw)
In-Reply-To: <58496c8d78c6b08276762a8f23a133260278d146.1479353852.git.maurice.ma@intel.com>

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 <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
---
 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



      reply	other threads:[~2016-11-17  3:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17  3:40 [PATCH 1/2] CorebootPayloadPkg: Allow PciLib instance selection Maurice Ma
2016-11-17  3:42 ` Maurice Ma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfee2f1814679b9e66c2bf8335620102500e3b13.1479353852.git.maurice.ma@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox