From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 012188215F for ; Fri, 24 Feb 2017 01:43:34 -0800 (PST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 883D13D967; Fri, 24 Feb 2017 09:43:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-39.phx2.redhat.com [10.3.116.39]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1O9hWlT018117; Fri, 24 Feb 2017 04:43:33 -0500 To: Jeff Fan , edk2-devel@ml01.01.org References: <20170224061211.24720-1-jeff.fan@intel.com> Cc: Star Zeng , Feng Tian , Michael D Kinney From: Laszlo Ersek Message-ID: <1c624860-9079-5c7a-9cfe-db4d3c8d34ec@redhat.com> Date: Fri, 24 Feb 2017 10:43:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170224061211.24720-1-jeff.fan@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 24 Feb 2017 09:43:34 +0000 (UTC) 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 09:43:34 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 02/24/17 07:12, Jeff Fan wrote: > Platform PEI may add LOCAL APIC memory mapped space into > EFI_HOB_MEMORY_ALLOCATION. 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=390 > > 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 = AddMemoryMappedIoSpace (BaseAddress, SIZE_4KB, EFI_MEMORY_UC); > ASSERT_EFI_ERROR (Status); > > + // > + // Try to allocate APIC memory mapped space, does not check return > + // status because it may be allocated by other driver, or DXE Core if > + // this range is built into Memory Allocation HOB. > + // > Status = gDS->AllocateMemorySpace ( > EfiGcdAllocateAddress, > EfiGcdMemoryTypeMemoryMappedIo, > @@ -1084,7 +1089,10 @@ AddLocalApicMemorySpace ( > ImageHandle, > NULL > ); > - ASSERT_EFI_ERROR (Status); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_INFO, "%a: %a: AllocateMemorySpace() Status - %r\n", > + gEfiCallerBaseName, __FUNCTION__, Status)); > + } > } > > /** > Did you actually hit the ASSERT on some platform soon after we discussed it? :) Either way, Reviewed-by: Laszlo Ersek Thanks! Laszlo