From patchwork Fri Nov 17 16:09:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119179 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp703370qgn; Fri, 17 Nov 2017 08:09:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMYDmGBhI0AQu4AcdpSiAE4+WAafqmYjKgqeDSsAWggPCEEXaQpEjKXDn/G0Ku775R5FAgwS X-Received: by 10.98.204.10 with SMTP id a10mr2619221pfg.18.1510934985931; Fri, 17 Nov 2017 08:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510934985; cv=none; d=google.com; s=arc-20160816; b=NRFPAT+P8TJsCNvuH1omIEIxy6BQ2i1zXIw8TaF1+kL0qg22tvJCRWYrSb3mM+bhcW EC2nTam63WU8uzRzzAkN+uuLuNa8hv/F6JPwQtTvTjhgxoWDiuKGpauRdW4R6J32Xp2l FG7+3xpLaPGT7mzVGGlvnGXi1UQQSo046hfzyNR5Xaq8y9RRKYkI4ubQtOM0SqT9IWE8 LHb7nFzHO1T+hKs+8Q5iIfw8tCR19Dx8ICWgKDhUJnOwjM7KrSzre/nQ4yGm1ZDM1QC/ 7y3+abFaQX66+UL7aCcQ6cEqw2669IvfgXWPAca5kXNbhESP5y56R6kplFj+oQCGV2nn r4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=GBMs49XX9v03ITCxOTip1xp9nOLlK+4ko7FA+91C+j0=; b=t3Ao2qoHM3LaXW//YKGVGrgumV+WP/2CYB+TFqKVDIpxZrkhGQ8sz7zgXcJOvfKGcC rx5psEZdm45GzwArequ5oq+idf58wgIDapLDbchVk8Nsv13LXi6yNiBrbvSCtpfnTcg+ VrERwK4rhQ0LOVvvwm/m8L7o9hqK98O6JrKXvMY6qOVXGc30LYlpJgDTej8Lq6V7rOn0 PK6PYR1/d4SBwLNy8VHi4sTgEGvWDk3TGvQvGdaklvzLVDgRVvYwcDwd48olAF0p2DVc BjxzaOKBOT8di+XimSoI8zSbTBju6JPVzB3RIBuC82GXH9u6K5ctkbQpDBt8aPXPdo17 QOrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HtVIksdY; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id bd7si2930885plb.577.2017.11.17.08.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HtVIksdY; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3CA202035BB20; Fri, 17 Nov 2017 08:05:27 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B83F72035BB1C for ; Fri, 17 Nov 2017 08:05:25 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id z14so2530923wrb.8 for ; Fri, 17 Nov 2017 08:09:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XJFbcnUCBr1r0ybPAXKexlcLPJ13uvXfBjk2LpmwhyI=; b=HtVIksdYrGB9bxUV7X2PuWV03SXlp1aSs/1z2m02Po+wR3P51Ve743AzFcJuvaVs9l rA2OMl9G7oYbtqIHq8aE5S0aNHLDQtKZOf2f7eg+3B9X96buBsBPtKyudz03t1XHTMdA wayD9RFfWpLVPedzsWFOa8f2S/vHiMV8TQ3G8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XJFbcnUCBr1r0ybPAXKexlcLPJ13uvXfBjk2LpmwhyI=; b=bnHZ5nlolKtWHvzMyJZtxSzpdO6PMze8nlP+UKvZ7B2Km/daJlCPfyqTwtfoCABMwn I/nkce6qvTjOItqGvxrkZdrjgokGneffDYgZX0ilW9NMj1cvkY9u7kyLhnqHdGY6KfJK D6XkIvOhYxOw5t0g2Qfi9ac7JBCvz3Lg2IbkPrezTH5VXEQjBXZkDxsP0ekJ+NYEbuu7 uT8PvgGjySk6F2LCOtfmA4dzsIX/05n5MFN2kC3ef42Dtdq8xYLudAFB+zqArsoF7MNz DqKnn+GAapa7kmLAOTDr83pGWXrb3kOSZasXSm+8uf2rCO2l8nnElnewVCPcXAWH0/9d jm2w== X-Gm-Message-State: AJaThX4BAjPIjSafG1PH1znZIUZENQFCpOPqXHkijQCB7nOSQhU8qoTv VJOtcFoWgDUsolRiUj4tMqcRoSCW33s= X-Received: by 10.223.162.152 with SMTP id s24mr5140095wra.151.1510934974977; Fri, 17 Nov 2017 08:09:34 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:34 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:05 +0000 Message-Id: <20171117160913.17292-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Acked-by: Laszlo Ersek 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 + 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