public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, udit.kumar@nxp.com
Subject: Re: [PATCH] RFC Inform UEFI memory to Linux
Date: Fri, 15 Sep 2017 11:13:38 +0100	[thread overview]
Message-ID: <20170915101338.agohuaoakeaokevb@bivouac.eciton.net> (raw)
In-Reply-To: <1505485954-24345-1-git-send-email-meenakshi.aggarwal@nxp.com>

On Fri, Sep 15, 2017 at 08:02:34PM +0530, Meenakshi Aggarwal wrote:
> 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>

I will let Ard comment on the technical aspect, since you've been
discussing this offline.

However, there is something broken in your setup: the patch should
look like this:
---
iff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
index 2feb11f21d..d3fa894244 100644
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
@@ -150,7 +150,7 @@ MemoryPeim (
           } else {
             // Create the System Memory HOB for the
             // firmware with the non-present attribute
             BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                        ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
+                                        ResourceAttributes,
                                         PcdGet64 (PcdFdBaseAddress),
                                         PcdGet32 (PcdFdSize));

@@ -161,7 +161,7 @@ MemoryPeim (
         } else {
           // Create the System Memory HOB for the firmware
           // with the non-present attribute
           BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
-                                      ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
+                                      ResourceAttributes,
                                       PcdGet64 (PcdFdBaseAddress),
                                       PcdGet32 (PcdFdSize));

---

I am guessing you have inadvertently modified the line terminations
from CRLF to LF (the evidence gets stripped out by SMTP).
Please resubmit with this addressed.

/
    Leif

> ---
>  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 10:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 14:32 [PATCH] RFC Inform UEFI memory to Linux Meenakshi Aggarwal
2017-09-15 10:13 ` Leif Lindholm [this message]
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=20170915101338.agohuaoakeaokevb@bivouac.eciton.net \
    --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