From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 941128216E for ; Thu, 23 Feb 2017 22:13:31 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2017 22:13:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="69619041" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2017 22:13:31 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 23 Feb 2017 22:13:30 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 23 Feb 2017 22:13:30 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Fri, 24 Feb 2017 14:13:28 +0800 From: "Tian, Feng" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Zeng, Star" , "Kinney, Michael D" , "Tian, Feng" Thread-Topic: [PATCH] UefiCpuPkg/CpuDxe: Do not ASSERT on AllocateMemorySpace() error Thread-Index: AQHSjmT7DyIYOauOOEKy7KvbgFAlQqF3rWCQ Date: Fri, 24 Feb 2017 06:13:28 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699B5158@SHSMSX101.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:13:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian Thanks Feng -----Original Message----- From: Fan, Jeff=20 Sent: Friday, February 24, 2017 2:12 PM To: edk2-devel@lists.01.org Cc: Laszlo Ersek ; Zeng, Star ; Tia= n, Feng ; Kinney, Michael D Subject: [PATCH] UefiCpuPkg/CpuDxe: Do not ASSERT on AllocateMemorySpace() = 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