public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcello Sylvester Bauer" <marcello.bauer@9elements.com>
To: devel@edk2.groups.io
Cc: Maurice Ma <maurice.ma@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Star Zeng <star.zeng@intel.com>
Subject: [PATCH v1 1/1] UefipayloadPkg: Protect coreboot tables
Date: Wed,  8 Jul 2020 14:01:25 +0200	[thread overview]
Message-ID: <20200708120125.24344-2-marcello.bauer@9elements.com> (raw)
In-Reply-To: <20200708120125.24344-1-marcello.bauer@9elements.com>

From: Patrick Rudolph <patrick.rudolph@9elements.com>

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Marcello Sylvester Bauer <marcello.bauer@9elements.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 UefiPayloadPkg/BlSupportPei/BlSupportPei.c | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
index 22972453117a..b3ff065a537e 100644
--- a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
+++ b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
@@ -390,24 +390,36 @@ BlPeiEntryPoint (
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB GfxDeviceInfo;
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *NewGfxDeviceInfo;
 
-
-  //
-  // Report lower 640KB of RAM. Attribute EFI_RESOURCE_ATTRIBUTE_TESTED
-  // is intentionally omitted to prevent erasing of the coreboot header
-  // record before it is processed by ParseMemoryInfo.
+  // Report lower 640KB of RAM.
+  // Mark memory as reserved to keep coreboot header in place.
   //
   BuildResourceDescriptorHob (
-    EFI_RESOURCE_SYSTEM_MEMORY,
+    EFI_RESOURCE_MEMORY_RESERVED,
     (
     EFI_RESOURCE_ATTRIBUTE_PRESENT |
     EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+    EFI_RESOURCE_ATTRIBUTE_TESTED |
     EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
     EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
     EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
     EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
     ),
     (EFI_PHYSICAL_ADDRESS)(0),
-    (UINT64)(0xA0000)
+    (UINT64)(0x1000)
+    );
+
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_SYSTEM_MEMORY,
+    (
+    EFI_RESOURCE_ATTRIBUTE_PRESENT |
+    EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+    EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+    EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+    EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
+    ),
+    (EFI_PHYSICAL_ADDRESS)(0x1000),
+    (UINT64)(0x9F000)
     );
 
   BuildResourceDescriptorHob (
-- 
2.27.0


  reply	other threads:[~2020-07-08 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 12:01 [PATCH v1 0/1] Protect coreboot tables Marcello Sylvester Bauer
2020-07-08 12:01 ` Marcello Sylvester Bauer [this message]
2020-09-08 21:40   ` [edk2-devel] [PATCH v1 1/1] UefipayloadPkg: " Guo Dong
2020-09-14  8:59     ` Marcello Sylvester Bauer
2020-09-14 17:32       ` Guo Dong
2020-10-01 10:23         ` Laszlo Ersek
2020-10-05 15:34           ` Marcello Sylvester Bauer
2020-10-06  8:25             ` Laszlo Ersek

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=20200708120125.24344-2-marcello.bauer@9elements.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