From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6EF56211A2D90 for ; Wed, 19 Dec 2018 22:45:39 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2018 22:45:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,376,1539673200"; d="scan'208";a="285201699" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 19 Dec 2018 22:45:38 -0800 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 22:45:38 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 22:45:37 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.210]) with mapi id 14.03.0415.000; Thu, 20 Dec 2018 14:45:27 +0800 From: "Gao, Liming" To: Ard Biesheuvel , "edk2-devel@lists.01.org" CC: Andrew Jones , "Wu, Hao A" , "Kinney, Michael D" , Laszlo Ersek Thread-Topic: [edk2] [PATCH v2 1/6] MdePkg/Base: introduce MAX_ALLOC_ADDRESS Thread-Index: AQHUl91kLYQqp4AumU+49v+PB+oco6WHLtYg Date: Thu, 20 Dec 2018 06:45:26 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E38F138@SHSMSX104.ccr.corp.intel.com> References: <20181219205640.4704-1-ard.biesheuvel@linaro.org> <20181219205640.4704-2-ard.biesheuvel@linaro.org> In-Reply-To: <20181219205640.4704-2-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 1/6] MdePkg/Base: introduce MAX_ALLOC_ADDRESS X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 06:45:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard >Biesheuvel >Sent: Thursday, December 20, 2018 4:57 AM >To: edk2-devel@lists.01.org >Cc: Andrew Jones ; Wu, Hao A ; >Gao, Liming ; Kinney, Michael D >; Laszlo Ersek >Subject: [edk2] [PATCH v2 1/6] MdePkg/Base: introduce >MAX_ALLOC_ADDRESS > >On some architectures, the maximum representable address deviates from >the virtual address range that is accessible by the firmware at boot >time. For instance, on AArch64, UEFI mandates a 4 KB page size, which >limits the address space to 48 bits, while more than that may be >populated on a particular platform, for use by the OS. > >So introduce a new macro MAX_ALLOC_ADDRESS, which represent the >maximum >address the firmware should take into account when allocating memory >ranges that need to be accessible by the CPU at boot time. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Ard Biesheuvel >--- > MdePkg/Include/AArch64/ProcessorBind.h | 5 +++++ > MdePkg/Include/Arm/ProcessorBind.h | 5 +++++ > MdePkg/Include/Ebc/ProcessorBind.h | 5 +++++ > MdePkg/Include/Ia32/ProcessorBind.h | 5 +++++ > MdePkg/Include/X64/ProcessorBind.h | 5 +++++ > 5 files changed, 25 insertions(+) > >diff --git a/MdePkg/Include/AArch64/ProcessorBind.h >b/MdePkg/Include/AArch64/ProcessorBind.h >index 968c18f915ae..f4a544b34d78 100644 >--- a/MdePkg/Include/AArch64/ProcessorBind.h >+++ b/MdePkg/Include/AArch64/ProcessorBind.h >@@ -142,6 +142,11 @@ typedef INT64 INTN; > /// > #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL > >+/// >+/// Maximum usable address at boot time (48 bits using 4 KB pages) >+/// >+#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL >+ > /// > /// Maximum legal AArch64 INTN and UINTN values. > /// >diff --git a/MdePkg/Include/Arm/ProcessorBind.h >b/MdePkg/Include/Arm/ProcessorBind.h >index 8cca0f3bb050..16a61fc7a325 100644 >--- a/MdePkg/Include/Arm/ProcessorBind.h >+++ b/MdePkg/Include/Arm/ProcessorBind.h >@@ -148,6 +148,11 @@ typedef INT32 INTN; > /// > #define MAX_ADDRESS 0xFFFFFFFF > >+/// >+/// Maximum usable address at boot time >+/// >+#define MAX_ALLOC_ADDRESS MAX_ADDRESS >+ > /// > /// Maximum legal ARM INTN and UINTN values. > /// >diff --git a/MdePkg/Include/Ebc/ProcessorBind.h >b/MdePkg/Include/Ebc/ProcessorBind.h >index 5217cfd97eac..45beb7572817 100644 >--- a/MdePkg/Include/Ebc/ProcessorBind.h >+++ b/MdePkg/Include/Ebc/ProcessorBind.h >@@ -103,6 +103,11 @@ typedef unsigned long UINTN; > /// > #define MAX_ADDRESS ((UINTN)(~0ULL >> (64 - sizeof (INTN) * 8))) > >+/// >+/// Maximum usable address at boot time (48 bits using 4 KB pages) >+/// >+#define MAX_ALLOC_ADDRESS MAX_ADDRESS >+ > /// > /// Maximum legal EBC INTN and UINTN values. > /// >diff --git a/MdePkg/Include/Ia32/ProcessorBind.h >b/MdePkg/Include/Ia32/ProcessorBind.h >index 8e4de7029cfc..71d53e2543bb 100644 >--- a/MdePkg/Include/Ia32/ProcessorBind.h >+++ b/MdePkg/Include/Ia32/ProcessorBind.h >@@ -246,6 +246,11 @@ typedef INT32 INTN; > /// > #define MAX_ADDRESS 0xFFFFFFFF > >+/// >+/// Maximum usable address at boot time >+/// >+#define MAX_ALLOC_ADDRESS MAX_ADDRESS >+ > /// > /// Maximum legal IA-32 INTN and UINTN values. > /// >diff --git a/MdePkg/Include/X64/ProcessorBind.h >b/MdePkg/Include/X64/ProcessorBind.h >index e4254285877b..1c04090c7d03 100644 >--- a/MdePkg/Include/X64/ProcessorBind.h >+++ b/MdePkg/Include/X64/ProcessorBind.h >@@ -260,6 +260,11 @@ typedef INT64 INTN; > /// > #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL > >+/// >+/// Maximum usable address at boot time >+/// >+#define MAX_ALLOC_ADDRESS MAX_ADDRESS >+ > /// > /// Maximum legal x64 INTN and UINTN values. > /// >-- >2.19.2 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel