[edk2] [PATCH] Revert "MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits"

Gao, Liming liming.gao at intel.com
Thu Dec 6 16:03:09 PST 2018


Oh, this is a good point of runtime service in OS part. I agree to revert it. 

Reviewed-by: Liming Gao <liming.gao at intel.com>

Thanks
Liming
>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel at linaro.org]
>Sent: Friday, December 07, 2018 5:37 AM
>To: edk2-devel at lists.01.org
>Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>; Leif Lindholm
><leif.lindholm at linaro.org>; Gao, Liming <liming.gao at intel.com>; Laszlo Ersek
><lersek at redhat.com>; Eric Auger <eric.auger at redhat.com>; Andrew Jones
><drjones at redhat.com>; Philippe Mathieu-Daude <philmd at redhat.com>
>Subject: [PATCH] Revert "MdePkg/ProcessorBind.h AARCH64: limit
>MAX_ADDRESS to 48 bits"
>
>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.
>
>Cc: Leif Lindholm <leif.lindholm at linaro.org>
>Cc: Liming Gao <liming.gao at intel.com>
>Cc: Laszlo Ersek <lersek at redhat.com>
>Cc: Eric Auger <eric.auger at redhat.com>
>Cc: Andrew Jones <drjones at redhat.com>
>Cc: Philippe Mathieu-Daude <philmd at redhat.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>---
> MdePkg/Include/AArch64/ProcessorBind.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/MdePkg/Include/AArch64/ProcessorBind.h
>b/MdePkg/Include/AArch64/ProcessorBind.h
>index dad75df1c579..968c18f915ae 100644
>--- a/MdePkg/Include/AArch64/ProcessorBind.h
>+++ b/MdePkg/Include/AArch64/ProcessorBind.h
>@@ -138,9 +138,9 @@ typedef INT64   INTN;
> #define MAX_2_BITS  0xC000000000000000ULL
>
> ///
>-/// Maximum legal AARCH64  address (48 bits for 4 KB page size)
>+/// Maximum legal AARCH64  address
> ///
>-#define MAX_ADDRESS   0xFFFFFFFFFFFFULL
>+#define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL
>
> ///
> /// Maximum legal AArch64 INTN and UINTN values.
>--
>2.19.2



More information about the edk2-devel mailing list