public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, lersek@redhat.com, heyi.guo@Linaro.org,
	ryan.harkin@linaro.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 1/2] ArmVirtPkg/PrePi: remove mSystemMemoryEnd
Date: Mon, 24 Oct 2016 09:57:22 +0100	[thread overview]
Message-ID: <1477299443-9324-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

Recording the top of SEC visible system memory in a global variable is
not necessary, and violates the constraints of the SEC/PEI environment,
given that it may execute from NOR flash. So remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 6 ------
 ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S     | 8 +-------
 ArmVirtPkg/PrePi/PrePi.h                    | 2 --
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
index 9c040b17f253..cc8b47e69026 100644
--- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
+++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
@@ -14,8 +14,6 @@
 
 #include <AsmMacroIoLibV8.h>
 
-ASM_GLOBAL ASM_PFX(mSystemMemoryEnd)
-
 ASM_FUNC(_ModuleEntryPoint)
   //
   // We are built as a ET_DYN PIE executable, so we need to process all
@@ -68,8 +66,6 @@ _SetupStackPosition:
   ldr   x2, PcdGet64 (PcdSystemMemorySize)
   sub   x2, x2, #1
   add   x1, x1, x2      // x1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize
-  adr   x2, mSystemMemoryEnd
-  str   x1, [x2]
 
   // Calculate Top of the Firmware Device
   ldr   x2, PcdGet64 (PcdFdBaseAddress)
@@ -151,5 +147,3 @@ _PrepareArguments:
 
 _NeverReturn:
   b _NeverReturn
-
-ASM_PFX(mSystemMemoryEnd):    .8byte 0
diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
index e03aeefbb003..59028d0a553e 100644
--- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
+++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
@@ -14,8 +14,6 @@
 
 #include <AsmMacroIoLib.h>
 
-ASM_GLOBAL ASM_PFX(mSystemMemoryEnd)
-
 ASM_FUNC(_ModuleEntryPoint)
   //
   // We are built as a ET_DYN PIE executable, so we need to process all
@@ -66,12 +64,10 @@ _SetupStackPosition:
   ADRL  (r12, PcdGet64 (PcdSystemMemorySize))
   ldrd  r2, r3, [r12]
 
-  // calculate the top of memory, and record it in mSystemMemoryEnd
+  // calculate the top of memory
   adds  r2, r2, r1
   sub   r2, r2, #1
   addcs r3, r3, #1
-  adr   r12, mSystemMemoryEnd
-  strd  r2, r3, [r12]
 
   // truncate the memory used by UEFI to 4 GB range
   teq   r3, #0
@@ -159,5 +155,3 @@ _PrepareArguments:
 
 _NeverReturn:
   b _NeverReturn
-
-ASM_PFX(mSystemMemoryEnd):    .quad 0
diff --git a/ArmVirtPkg/PrePi/PrePi.h b/ArmVirtPkg/PrePi/PrePi.h
index 9b828377adc3..d3189c0b8a6f 100644
--- a/ArmVirtPkg/PrePi/PrePi.h
+++ b/ArmVirtPkg/PrePi/PrePi.h
@@ -29,8 +29,6 @@
 
 #define SerialPrint(txt)  SerialPortWrite (txt, AsciiStrLen(txt)+1);
 
-extern UINT64 mSystemMemoryEnd;
-
 RETURN_STATUS
 EFIAPI
 TimerConstructor (
-- 
2.7.4



             reply	other threads:[~2016-10-24  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  8:57 Ard Biesheuvel [this message]
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
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=1477299443-9324-1-git-send-email-ard.biesheuvel@linaro.org \
    --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