From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4454E82150 for ; Thu, 23 Feb 2017 22:24:34 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2017 22:24:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="1134268986" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 23 Feb 2017 22:24:33 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 23 Feb 2017 22:24:33 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Fri, 24 Feb 2017 14:24:31 +0800 From: "Zeng, Star" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Tian, Feng" , Laszlo Ersek , "Zeng, Star" Thread-Topic: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Do not ASSERT on AllocateMemorySpace() error Thread-Index: AQHSjmT72arpmRG3AUOKuCuVWDUd3KF3sHHg Date: Fri, 24 Feb 2017 06:24:31 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B82B5F8@shsmsx102.ccr.corp.intel.com> References: <20170224061211.24720-1-jeff.fan@intel.com> In-Reply-To: <20170224061211.24720-1-jeff.fan@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] UefiCpuPkg/CpuDxe: Do not ASSERT on AllocateMemorySpace() error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 06:24:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff= Fan Sent: Friday, February 24, 2017 2:12 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D ; Tian, Feng ; Laszlo Ersek ; Zeng, Star Subject: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Do not ASSERT on AllocateMemoryS= pace() error Platform PEI may add LOCAL APIC memory mapped space into EFI_HOB_MEMORY_ALL= OCATION. Or platform may allocate this range before. So, we skip AllocateMemorySpace()'s return status checking. Instead, we add= one DEBUG message for possible trace. https://bugzilla.tianocore.org/show_bug.cgi?id=3D390 This updating is suggested by Ersek's comments at https://www.mail-archive.= com/edk2-devel@lists.01.org/msg22585.html Cc: Laszlo Ersek Cc: Star Zeng Cc: Feng Tian Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- UefiCpuPkg/CpuDxe/CpuDxe.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index = 2fd2f31..4a5e282 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -1075,6 +1075,11 @@ AddLocalApicMemorySpace ( Status =3D AddMemoryMappedIoSpace (BaseAddress, SIZE_4KB, EFI_MEMORY_UC)= ; ASSERT_EFI_ERROR (Status); =20 + // + // Try to allocate APIC memory mapped space, does not check return =20 + // status because it may be allocated by other driver, or DXE Core if =20 + // this range is built into Memory Allocation HOB. + // Status =3D gDS->AllocateMemorySpace ( EfiGcdAllocateAddress, EfiGcdMemoryTypeMemoryMappedIo, @@ -1084,7 +1089,10 @@ A= ddLocalApicMemorySpace ( ImageHandle, NULL ); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "%a: %a: AllocateMemorySpace() Status - %r\n", + gEfiCallerBaseName, __FUNCTION__, Status)); } } =20 /** --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel