public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
To: <edk2-devel@lists.01.org>, <leif.lindholm@linaro.org>,
	<ard.biesheuvel@linaro.org>
Subject: [PATCH] RFC Inform UEFI memory to Linux
Date: Fri, 15 Sep 2017 20:02:34 +0530	[thread overview]
Message-ID: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com> (raw)

From: Udit Kumar <udit.kumar@nxp.com>

While creating Hob list, ArmPlatformPkg is hiding UEFI memory.
whereas this memory can be used by OS.

This patch, allows OS to use UEFI code area.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Signed-off-by: Udit Kumar <udit.kumar@nxp.com>
---
 ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 28 ++++++++++++-------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
index 2feb11f..ae6ebc4 100644
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
@@ -147,24 +147,24 @@ MemoryPeim (
         if (PcdGet64 (PcdFdBaseAddress) == NextHob.ResourceDescriptor->PhysicalStart) {
           if (SystemMemoryTop == FdTop) {
             NextHob.ResourceDescriptor->ResourceAttribute = ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT;
-          } else {
-            // Create the System Memory HOB for the firmware with the non-present attribute
-            BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                        ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
-                                        PcdGet64 (PcdFdBaseAddress),
-                                        PcdGet32 (PcdFdSize));
-
+          } else {
+            // Create the System Memory HOB for the firmware with the non-present attribute
+            BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
+                                        ResourceAttributes,
+                                        PcdGet64 (PcdFdBaseAddress),
+                                        PcdGet32 (PcdFdSize));
+
             // Top of the FD is system memory available for UEFI
             NextHob.ResourceDescriptor->PhysicalStart += PcdGet32(PcdFdSize);
             NextHob.ResourceDescriptor->ResourceLength -= PcdGet32(PcdFdSize);
           }
-        } else {
-          // Create the System Memory HOB for the firmware with the non-present attribute
-          BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                      ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
-                                      PcdGet64 (PcdFdBaseAddress),
-                                      PcdGet32 (PcdFdSize));
-
+        } else {
+          // Create the System Memory HOB for the firmware with the non-present attribute
+          BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
+                                      ResourceAttributes,
+                                      PcdGet64 (PcdFdBaseAddress),
+                                      PcdGet32 (PcdFdSize));
+
           // Update the HOB
           NextHob.ResourceDescriptor->ResourceLength = PcdGet64 (PcdFdBaseAddress) - NextHob.ResourceDescriptor->PhysicalStart;
 
-- 
1.9.1



             reply	other threads:[~2017-09-15  8:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 14:32 Meenakshi Aggarwal [this message]
2017-09-15 10:13 ` [PATCH] RFC Inform UEFI memory to Linux Leif Lindholm
2017-09-15 22:55   ` Ard Biesheuvel
2017-09-18  4:07     ` Udit Kumar
2017-09-18  4:30       ` Ard Biesheuvel
2017-09-19 12:32 ` [PATCH v2] PeiLib : " Meenakshi Aggarwal
2017-09-19  8:07   ` Sakar Arora
2017-09-19 10:10     ` Udit Kumar
2017-09-19 11:20       ` Sakar Arora
2017-09-19 12:46         ` Udit Kumar
2017-09-19 12:48     ` Ard Biesheuvel
2017-09-20  5:32       ` Sakar Arora
2017-09-20  6:32         ` Ard Biesheuvel
2017-09-20  8:20           ` Sakar Arora
2017-09-25  5:47             ` Meenakshi Aggarwal
2017-11-30 10:07             ` Udit Kumar
2017-11-30 14:33               ` Ard Biesheuvel
2017-09-20 14:59   ` Gao, Liming
2017-09-21  5:59     ` Udit Kumar

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=1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.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