public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Jian J Wang" <jian.j.wang@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Leif Lindholm" <leif.lindholm@linaro.org>,
	"Auger Eric" <eric.auger@redhat.com>,
	"Andrew Jones" <drjones@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [RFC PATCH 5/7] ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account
Date: Fri, 7 Dec 2018 13:47:44 +0100	[thread overview]
Message-ID: <CAKv+Gu-acaQKWKDq8zEJfoxedaWRXBoEUJE-_9zu3MTkjJcBbw@mail.gmail.com> (raw)
In-Reply-To: <a2a40410-17c4-07b1-52c5-d982ac7b7848@redhat.com>

On Fri, 7 Dec 2018 at 13:46, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 12/07/18 12:23, Ard Biesheuvel wrote:
> > Limit the PEI memory region so it will not extend beyond what we can
> > address architecturally when running with 4 KB pages.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > ---
> >  ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
> > index 389a2e6f1abd..25db87fb2374 100644
> > --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
> > +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
> > @@ -109,8 +109,8 @@ InitializeMemory (
> >
> >    SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase);
> >    SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize);
> > -  if (SystemMemoryTop - 1 > MAX_ADDRESS) {
> > -    SystemMemoryTop = (UINT64)MAX_ADDRESS + 1;
> > +  if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) {
> > +    SystemMemoryTop = (UINT64)MAX_ALLOC_ADDRESS + 1;
> >    }
> >    FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress);
> >    FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);
> >
>
> Shouldn't you also update
>
>   ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ADDRESS);
>
> just above the context visible here?
>

No, it's fine for PcdSystemMemoryBase/PcdSystemMemorySize to describe
a region we cannot access in its entirety, as long as we don't use the
top part (See the next patch as well)


  reply	other threads:[~2018-12-07 12:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 11:22 [RFC PATCH 0/7] introduce MAX_ALLOC_ADDRESS to limit boot time allocations Ard Biesheuvel
2018-12-07 11:22 ` [RFC PATCH 1/7] MdePkg/Base: introduce MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:53   ` Laszlo Ersek
2018-12-07 11:22 ` [RFC PATCH 2/7] MdeModulePkg/Dxe/Gcd: disregard memory above MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 3/7] MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account Ard Biesheuvel
2018-12-10  2:04   ` Wang, Jian J
2018-12-10  7:22     ` Ard Biesheuvel
2018-12-10 14:52       ` Gao, Liming
2018-12-10 14:53         ` Ard Biesheuvel
2018-12-10 14:57           ` Gao, Liming
2018-12-07 11:23 ` [RFC PATCH 4/7] ArmPkg/ArmMmuLib: " Ard Biesheuvel
2018-12-07 12:42   ` Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 5/7] ArmPlatformPkg/MemoryInitPeim: " Ard Biesheuvel
2018-12-07 12:46   ` Laszlo Ersek
2018-12-07 12:47     ` Ard Biesheuvel [this message]
2018-12-07 12:48       ` Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 6/7] ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:47   ` Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 7/7] MdePkg/ProcessorBind AARCH64: limit MAX_ALLOC_ADDRESS to 48 bits Ard Biesheuvel
2018-12-07 12:51   ` 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=CAKv+Gu-acaQKWKDq8zEJfoxedaWRXBoEUJE-_9zu3MTkjJcBbw@mail.gmail.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