From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 16E661A1E3A for ; Mon, 24 Oct 2016 04:29:22 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 818887F09D; Mon, 24 Oct 2016 11:29:21 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-107.phx2.redhat.com [10.3.116.107]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9OBTJgA012207; Mon, 24 Oct 2016 07:29:20 -0400 To: Ard Biesheuvel , edk2-devel@ml01.01.org References: <1477299443-9324-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leif.lindholm@linaro.org, heyi.guo@linaro.org, ryan.harkin@linaro.org From: Laszlo Ersek Message-ID: <2dd8fe88-2f3f-d6bf-6cce-f0daba839d5a@redhat.com> Date: Mon, 24 Oct 2016 13:29:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1477299443-9324-1-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 24 Oct 2016 11:29:21 +0000 (UTC) Subject: Re: [PATCH 1/2] ArmVirtPkg/PrePi: remove mSystemMemoryEnd X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 11:29:22 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 10/24/16 10:57, Ard Biesheuvel wrote: > 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 > --- > 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 > > -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 > > -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 ( > series Acked-by: Laszlo Ersek