public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Ryan Harkin <ryan.harkin@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	 Laszlo Ersek <lersek@redhat.com>, Heyi Guo <heyi.guo@linaro.org>
Subject: Re: [PATCH 2/2] ArmPlatformPkg/PrePi: avoid global variable write to mSystemMemoryEnd
Date: Mon, 24 Oct 2016 13:21:46 +0100	[thread overview]
Message-ID: <CAKv+Gu-aFxQyqsQ-4ObjdBQgym32JdH5AA1S--dko71j76xLkg@mail.gmail.com> (raw)
In-Reply-To: <CAD0U-hL+YOsz=96dJ5UcmfAvDstBhUU7GmmBkq8p=kwpL2jtaQ@mail.gmail.com>

On 24 October 2016 at 13:05, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On 24 October 2016 at 09:57, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> The global variable mSystemMemoryEnd is initialized by PrePi only if
>> it has not been initialized by ArmPlatformPeiBootAction(). This allows
>> platforms executing under, e.g., ARM Trusted Firmware to dynamically
>> reserve a window at the top of memory that will be used by the secure
>> firmware.
>>
>> However, PrePi is a SEC module, and writing to a global variable
>> violates the SEC constraints, since SEC and PEI may execute from NOR
>> flash.
>>
>> So instead, initialize mSystemMemoryEnd statically. This will ensure
>> it holds the correct value for all implementations where the value
>> is not overridden, but still allows it to be overridden during the
>> call to ArmPlatformPeiBootAction().
>>
>> Note that this patch also fixes a latent bug on 32-bit platforms where
>> a value of mSystemMemoryEnd exceeding 4 GB would be truncated to 32-bits
>> rather than limited to (4 GB - 1)
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> I tested this successfully on FVP Foundation & AEMv8 models, Juno
> R0/1/2 and TC2.
>
> Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
>

Many thanks!


  reply	other threads:[~2016-10-24 12:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  8:57 [PATCH 1/2] ArmVirtPkg/PrePi: remove mSystemMemoryEnd Ard Biesheuvel
2016-10-24  8:57 ` [PATCH 2/2] ArmPlatformPkg/PrePi: avoid global variable write to mSystemMemoryEnd Ard Biesheuvel
2016-10-24 12:05   ` Ryan Harkin
2016-10-24 12:21     ` Ard Biesheuvel [this message]
2016-10-24 14:42   ` Leif Lindholm
2016-10-24 11:29 ` [PATCH 1/2] ArmVirtPkg/PrePi: remove mSystemMemoryEnd 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-aFxQyqsQ-4ObjdBQgym32JdH5AA1S--dko71j76xLkg@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