From patchwork Mon Oct 24 08:57:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 78908 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2457922qge; Mon, 24 Oct 2016 01:57:33 -0700 (PDT) X-Received: by 10.98.15.134 with SMTP id 6mr26559273pfp.117.1477299453211; Mon, 24 Oct 2016 01:57:33 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id c5si14340774pfe.244.2016.10.24.01.57.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 01:57:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AA09E1A1E3B; Mon, 24 Oct 2016 01:57:32 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 A9DA61A1E3A for ; Mon, 24 Oct 2016 01:57:30 -0700 (PDT) Received: by mail-wm0-x233.google.com with SMTP id f193so103559937wmg.0 for ; Mon, 24 Oct 2016 01:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=iEYpT3KyYH0ICJGoty/G6mt+KhDA7w2da/1+e3mJ7pw=; b=GPuErV7HUwcwU2RanvFXzQ99LU684ZpCqszp9RcBTE+nuaTQIt/PDba21RP9yHTANN KP/ZJMdRdahcVb1GWx4oU90FmIYOF1rgFLca7NLpnhU/6xSA05fSXNAOsWRhIqmwzJZO ZMCVH7qtSefc0zdW3GRIBMFEj+OKt+CBzajcw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iEYpT3KyYH0ICJGoty/G6mt+KhDA7w2da/1+e3mJ7pw=; b=R2QQG8yVeNNsqTI7cQp1zuosMR4BlEvSQqMbSB9SsqVmv2qEhuAKQDeLAO8BRFcirc TRZ6u+tzjnaFbkrfkklRj7UYlfaXhaVNGDxKD+PhBz6cFVtEe+NOO9jOwb2Kkj9zhTWf T42/gdOExO2apkKFqcWEOm5anwCHZHIiHqPAiRPrE5lw2FevXdR64vm7cdWVRJ7WrR45 LkIzfb/QjE9kfyfWzEJoyOSgKuzjhIBL0iI9qKwit9kahFiDUHbsC9LEr4sF6wzt2WNM tJqLyKUIturi9Puwc7piqL8VtKXLW8eJzjENqxvpm9gU5vwZh73V0KtxwUY/qn0K1R81 KzVA== X-Gm-Message-State: AA6/9Rn7pWb3f3XtgmD4qemy4CCkgeeg6bZfASAR746nWO6T60oKXVwsASpJ0hnC28Dldyf6 X-Received: by 10.28.132.130 with SMTP id g124mr22095262wmd.37.1477299449241; Mon, 24 Oct 2016 01:57:29 -0700 (PDT) Received: from localhost.localdomain ([105.146.229.54]) by smtp.gmail.com with ESMTPSA id uq6sm18114920wjc.37.2016.10.24.01.57.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 01:57:26 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 24 Oct 2016 09:57:22 +0100 Message-Id: <1477299443-9324-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [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: , Cc: heyi.guo@Linaro.org, lersek@redhat.com, ryan.harkin@linaro.org, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.7.4 _______________________________________________ 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/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 (