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: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Laszlo Ersek <lersek@redhat.com>,
	Eric Auger <eric.auger@redhat.com>,
	Andrew Jones <drjones@redhat.com>,
	Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [RFC PATCH 4/7] ArmPkg/ArmMmuLib: take MAX_ALLOC_ADDRESS into account
Date: Fri,  7 Dec 2018 12:23:01 +0100	[thread overview]
Message-ID: <20181207112304.19765-5-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181207112304.19765-1-ard.biesheuvel@linaro.org>

When creating the page tables for the 1:1 mapping, ensure that we don't
attempt to map more than what is architecturally permitted when running
with 4 KB pages, which is 48 bits of VA. This will be reflected in the
value of MAX_ALLOC_ADDRESS once we override it for AArch64, so use that
macro instead of MAX_ADDRESS.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index 5403b8d4070e..e41044142ef4 100644
--- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
@@ -612,7 +612,7 @@ ArmConfigureMmu (
   // use of 4 KB pages.
   //
   MaxAddress = MIN (LShiftU64 (1ULL, ArmGetPhysicalAddressBits ()) - 1,
-                    MAX_ADDRESS);
+                    MAX_ALLOC_ADDRESS);
 
   // Lookup the Table Level to get the information
   LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount);
-- 
2.19.2



  parent reply	other threads:[~2018-12-07 11:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 11:22 [RFC PATCH 0/7] introduce MAX_ALLOC_ADDRESS to limit boot time allocations Ard Biesheuvel
2018-12-07 11:22 ` [RFC PATCH 1/7] MdePkg/Base: introduce MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:53   ` Laszlo Ersek
2018-12-07 11:22 ` [RFC PATCH 2/7] MdeModulePkg/Dxe/Gcd: disregard memory above MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 3/7] MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account Ard Biesheuvel
2018-12-10  2:04   ` Wang, Jian J
2018-12-10  7:22     ` Ard Biesheuvel
2018-12-10 14:52       ` Gao, Liming
2018-12-10 14:53         ` Ard Biesheuvel
2018-12-10 14:57           ` Gao, Liming
2018-12-07 11:23 ` Ard Biesheuvel [this message]
2018-12-07 12:42   ` [RFC PATCH 4/7] ArmPkg/ArmMmuLib: " Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 5/7] ArmPlatformPkg/MemoryInitPeim: " Ard Biesheuvel
2018-12-07 12:46   ` Laszlo Ersek
2018-12-07 12:47     ` Ard Biesheuvel
2018-12-07 12:48       ` Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 6/7] ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:47   ` Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 7/7] MdePkg/ProcessorBind AARCH64: limit MAX_ALLOC_ADDRESS to 48 bits Ard Biesheuvel
2018-12-07 12:51   ` 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=20181207112304.19765-5-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