]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits"
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 6 Dec 2018 21:10:36 +0000 (22:10 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 7 Dec 2018 11:24:19 +0000 (12:24 +0100)
This reverts commit 82379bf6603274e81604d5a6f6bb14bdde616286.

On AArch64, we can only use 48 address bits while running in UEFI,
while the GCD and UEFI memory maps may describe up to 52 bits of
physical address space. For this reason, MAX_ADDRESS was reduced
to 48 bits, to ensure that the firmware does not inadvertently
attempt to allocate memory that we cannot access.

However, MAX_ADDRESS is used in runtime drivers as well, and
runtime drivers may deal with kernel virtual addresses, which have
bits [63:48] set. In fact, the OS may be running with 64 KB pages
and pass addresses into the runtime services that use up to 52
bits of address space, either with the top bits set or cleared,
even if the physical address space does not extend beyond 48 bits.

In summary, changing MAX_ADDRESS is a mistake, and needs to be
reverted.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
MdePkg/Include/AArch64/ProcessorBind.h

index dad75df1c5796a458a945780c7a090830afc1e37..968c18f915ae2762a5a645e39a3246fbb1513a1b 100644 (file)
@@ -138,9 +138,9 @@ typedef INT64   INTN;
 #define MAX_2_BITS  0xC000000000000000ULL\r
 \r
 ///\r
 #define MAX_2_BITS  0xC000000000000000ULL\r
 \r
 ///\r
-/// Maximum legal AARCH64  address (48 bits for 4 KB page size)\r
+/// Maximum legal AARCH64  address\r
 ///\r
 ///\r
-#define MAX_ADDRESS   0xFFFFFFFFFFFFULL\r
+#define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL\r
 \r
 ///\r
 /// Maximum legal AArch64 INTN and UINTN values.\r
 \r
 ///\r
 /// Maximum legal AArch64 INTN and UINTN values.\r