From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org 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 7469C2034712F for ; Tue, 21 Nov 2017 07:47:34 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 797E9C0546CE; Tue, 21 Nov 2017 15:51:49 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-145.rdu2.redhat.com [10.10.120.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A8FA5C552; Tue, 21 Nov 2017 15:51:48 +0000 (UTC) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> <20171117160913.17292-8-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: Date: Tue, 21 Nov 2017 16:51:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171117160913.17292-8-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Nov 2017 15:51:49 +0000 (UTC) Subject: Re: [PATCH 07/15] ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 15:47:34 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/17/17 17:09, Ard Biesheuvel wrote: > ArmPlatformStackLib has hooks into primary/secondary core PCDs and > other ArmPlatformLib related junk, so let's simply set the stack > pointer directly. This is trivial given that our PrePi is unicore > only. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirt.dsc.inc | 1 - > ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 14 ++------------ > ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S | 14 ++------------ > ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 1 - > 4 files changed, 4 insertions(+), 26 deletions(-) > > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index 50eb8675d1c0..5d7edff104b5 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -93,7 +93,6 @@ [LibraryClasses.common] > ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf > ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf > ArmGicArchLib|ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf > - ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf > ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf > ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf > ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerVirtCounterLib/ArmGenericTimerVirtCounterLib.inf > diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S > index 3296aedfe9aa..891cf1fcab40 100644 > --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S > +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S > @@ -111,22 +111,12 @@ _GetBaseUefiMemory: > > _GetStackBase: > // r1 = The top of the Mpcore Stacks Before pushing the patch, please consider updating the "r1" comment here, in the aarch64 version. Acked-by: Laszlo Ersek Thanks Laszlo > + mov sp, x1 > + > // Stack for the primary core = PrimaryCoreStack > MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) > sub x22, x1, x2 > > - // Stack for the secondary core = Number of Cores - 1 > - MOV32 (x1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) > - sub x22, x22, x1 > - > - // x22 = The base of the MpCore Stacks (primary stack & secondary stacks) > - mov x0, x22 > - mov x1, x20 > - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize) > - MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) > - MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) > - bl ASM_PFX(ArmPlatformStackSet) > - > mov x0, x20 > mov x1, x21 > mov x2, x22 > diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S > index a918c191432e..ced08593e9de 100644 > --- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S > +++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S > @@ -120,22 +120,12 @@ _GetBaseUefiMemory: > > _GetStackBase: > // r1 = The top of the Mpcore Stacks > + mov sp, r1 > + > // Stack for the primary core = PrimaryCoreStack > MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) > sub r9, r1, r2 > > - // Stack for the secondary core = Number of Cores - 1 > - MOV32 (r1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) > - sub r9, r9, r1 > - > - // r9 = The base of the MpCore Stacks (primary stack & secondary stacks) > - mov r0, r9 > - mov r1, r10 > - //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize) > - MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) > - MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) > - bl ASM_PFX(ArmPlatformStackSet) > - > mov r0, r10 > mov r1, r11 > mov r2, r9 > diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf > index e816e9583da8..ae9a088c7256 100755 > --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf > +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf > @@ -54,7 +54,6 @@ [LibraryClasses] > LzmaDecompressLib > PeCoffGetEntryPointLib > PrePiLib > - ArmPlatformStackLib > MemoryAllocationLib > HobLib > PrePiHobListPointerLib >