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.120; helo=mga04.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 7C76C21199536 for ; Thu, 6 Dec 2018 16:03:13 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2018 16:03:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,324,1539673200"; d="scan'208";a="98726361" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2018 16:03:12 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 6 Dec 2018 16:03:12 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 6 Dec 2018 16:03:11 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.176]) with mapi id 14.03.0415.000; Fri, 7 Dec 2018 08:03:10 +0800 From: "Gao, Liming" To: Ard Biesheuvel , "edk2-devel@lists.01.org" CC: Leif Lindholm , Laszlo Ersek , Eric Auger , Andrew Jones , Philippe Mathieu-Daude Thread-Topic: [PATCH] Revert "MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits" Thread-Index: AQHUjavpBhT1GyYork+ODeLayUehg6VyZIbg Date: Fri, 7 Dec 2018 00:03:09 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E384FDC@SHSMSX104.ccr.corp.intel.com> References: <20181206213722.7597-1-ard.biesheuvel@linaro.org> In-Reply-To: <20181206213722.7597-1-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] Revert "MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits" 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: Fri, 07 Dec 2018 00:03:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Oh, this is a good point of runtime service in OS part. I agree to revert i= t.=20 Reviewed-by: Liming Gao Thanks Liming >-----Original Message----- >From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >Sent: Friday, December 07, 2018 5:37 AM >To: edk2-devel@lists.01.org >Cc: Ard Biesheuvel ; Leif Lindholm >; Gao, Liming ; Laszlo Ers= ek >; Eric Auger ; Andrew Jones >; Philippe Mathieu-Daude >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 >Cc: Liming Gao >Cc: Laszlo Ersek >Cc: Eric Auger >Cc: Andrew Jones >Cc: Philippe Mathieu-Daude >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Ard Biesheuvel >--- > 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