From nobody Fri May 3 17:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60709+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60709+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591241277; cv=none; d=zohomail.com; s=zohoarc; b=b3xX5S9rpj7XmjVPfFej8GcHy0Cr8kRRCatamR8RDdSnuw/mPURK2HS4oLJZsrgO7pMsVfdPcyCN9tjEZatptxHnI1ZZrJ/opyjbsWE5poPa/OZrqbxa37FcsBL9GsiOl/za8+TD+gtN0i5XAMbVtiRX0AeXYqN6RMZEbMWq2F0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591241277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=QNsy9F+6mUFB0fJP4v9r/wB98MS7eJbMejbDJnEWqyQ=; b=dWkIQwFzoDdw0aO6BcdZZGkfeIeeeULuYp4kaQY2zJrTNu41voWrph/BsNulGnZO/TnmcpB8hO86n/5k5EPryjPDpLS48sn3G44q58kMhVBmz9qWBQAJf6x5wXLHHIZCQ/fC67bcnYL8zWPB64CWw4GVTTyMiGCBIlayD8M0KzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60709+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591241277282946.8109991793007; Wed, 3 Jun 2020 20:27:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jWsHYY1788612x7DYsc1FyA8; Wed, 03 Jun 2020 20:27:56 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web12.6510.1591241275730400375 for ; Wed, 03 Jun 2020 20:27:56 -0700 IronPort-SDR: 9GKwvcowsI2Oy6O75QxIG6uLhlXTbEk/Em7LEYVkdgFYQMQMrUNIMsWsDFJlCjZ5eI1c91txSi vsZzWAOqOdgQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 20:27:56 -0700 IronPort-SDR: zBPseY8+xDs4r40/XA7XOwHPUkSNVGqfBlLesEFFcpIDojRANB78hWhGw0SVmnuS+PUxqOXZE+ wkeZoz6RX1EA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,470,1583222400"; d="scan'208";a="471280225" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.43]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 20:27:54 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH V2 1/2] MdePkg/PciSegmentInfoLib: Add missing EFIAPI to GetPciSegmentInfo() Date: Thu, 4 Jun 2020 11:27:09 +0800 Message-Id: <20200604032710.970-2-ray.ni@intel.com> In-Reply-To: <20200604032710.970-1-ray.ni@intel.com> References: <20200604032710.970-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: U16EJaw0B9tPmHyzAH3DAwstx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591241276; bh=bDRS35Dd/m2sYciHq4CQ/TCn33TSwJqdD1z/N0KZxfY=; h=Cc:Date:From:Reply-To:Subject:To; b=K+bhc8JNut6tUyveWD42PP5ZSa1NWKwZLsGXM2O0eX/qo1AG0ADaLdJ04JeluQ0vMnb /yUnJMhYPY+GiG8PFn4V5LJuNwpAw5/opwCoktmnzhahJYHMIECV8o+Ry30SrTlwGHwO/ 8MBpRjsJlumOLrk7AW3TJk0wWsBud2eHSnU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" All public APIs should have EFIAPI modifier. Somehow PciSegmentInfoLib missed the EFIAPI modifier. The patch updates the library header file and NULL instance in MdePkg to add the missing EFIAPI. Signed-off-by: Ray Ni Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu --- MdePkg/Include/Library/PciSegmentInfoLib.h | 3 ++- MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Library/PciSegmentInfoLib.h b/MdePkg/Include/Li= brary/PciSegmentInfoLib.h index 320a223628..659ff85649 100644 --- a/MdePkg/Include/Library/PciSegmentInfoLib.h +++ b/MdePkg/Include/Library/PciSegmentInfoLib.h @@ -3,7 +3,7 @@ =20 This library is consumed by PciSegmentLib to support multiple segment PC= I configuration access. =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -28,6 +28,7 @@ typedef struct { @retval A callee owned array holding the segment information. **/ PCI_SEGMENT_INFO * +EFIAPI GetPciSegmentInfo ( UINTN *Count ); diff --git a/MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c b= /MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c index f9019c4e64..3ec7784057 100644 --- a/MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c +++ b/MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c @@ -2,7 +2,7 @@ Default PCI Segment Information Library that returns one segment whose segment base address equals to PcdPciExpressBaseAddress. =20 - Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -21,6 +21,7 @@ @retval A callee owned array holding the segment information. **/ PCI_SEGMENT_INFO * +EFIAPI GetPciSegmentInfo ( UINTN *Count ) --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60709): https://edk2.groups.io/g/devel/message/60709 Mute This Topic: https://groups.io/mt/74665112/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 3 17:59:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60710+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60710+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591241278; cv=none; d=zohomail.com; s=zohoarc; b=FlzwXLxi3Kpjv/GyJtWVB/y4N40+cLRKupFzt0oRN5/N9Z9D0iQe2heUA0xek7xQXN18sqQhGQYviE9OTEcGjtgBEK+I30UAnY7S1gbTjH5JUUSoaXqR/AJaKK/DgYE2RIGpqO3F9phJsUIapIXciyUsx/2mBY3x1GFc9VVb7Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591241278; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=7b2i44vFCNt5naWCH+lBP0kkG7UzvsGOAqZuqHEBd9s=; b=XsAVxDsK7gTCSelTWAlPFplb2//UQ9p7bp907KLr+4C8y+VhHUvxFPyZSMHyr+wjsmhFQotEtb0g/zvTNBIvX72qMj98hi3VBWksvzz14MpR1nRAdGnniRoipWs10P0uk9dIxc21oFtukgw7JpahE2kFZnlMxWzR0LChAI/5Luw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60710+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591241278494661.2513397730777; Wed, 3 Jun 2020 20:27:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MId5YY1788612xPd6SRckXL3; Wed, 03 Jun 2020 20:27:58 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web12.6510.1591241275730400375 for ; Wed, 03 Jun 2020 20:27:57 -0700 IronPort-SDR: Ar+CMiC9m9Omb4PlKm1Zaa1WdwgxMC0T7Vl0WWF52wa+8V2ih3KCYp4S1ExMv+uIfV4BdEMkWW /bwwxo/pcIzQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 20:27:57 -0700 IronPort-SDR: oyob/uocw2/p1ZSDl3W1CU4CsEg/rJJWvk5TiYgTb02A/LNl2QuuPO7HR2aHu+ZNYPS6m1qp7H QADnBSvA3lUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,470,1583222400"; d="scan'208";a="471280229" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.43]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 20:27:56 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Maurice Ma , Guo Dong , Benjamin You Subject: [edk2-devel] [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Date: Thu, 4 Jun 2020 11:27:10 +0800 Message-Id: <20200604032710.970-3-ray.ni@intel.com> In-Reply-To: <20200604032710.970-1-ray.ni@intel.com> References: <20200604032710.970-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: WbvCOxjheA2AA7vXK4k8P4SXx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591241278; bh=LYeWdcOSfkGIcbKf24hyL9AnJ9Jy+/P4ooKGI0X4OuA=; h=Cc:Date:From:Reply-To:Subject:To; b=MY4Uwxz0JvADlu5yylD6lI5q2Ydqeoqa9tkLMmMGJ9vSEfPZYlX1YWXJxD855yjwId+ Y1uDyto+Eny0QGKWZRgUB4Rn94h/kKdDLLLhG0KX92gu9iQsQp4HWh03Cy2GR+ujKfTFi iWx/GWiQgkCqbLqEeMlyAHIhWxFneaYPwp0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Today's UefiPayloadPkg always uses 0xE0000000 as the PCIE base address and ignores the value set in AcpiBoardInfo HOB created by the boot loader. This makes the payload binary cannot work in environment where the PCIE base address set by boot loader doesn't equal to 0xE0000000. The patch enhances UefiPayloadPkg so that the PCIE base address set by boot loader in the AcpiBoardInfo HOB is used. Signed-off-by: Ray Ni Cc: Maurice Ma Cc: Guo Dong Cc: Benjamin You --- .../PciSegmentInfoLibAcpiBoardInfo.c | 59 +++++++++++++++++++ .../PciSegmentInfoLibAcpiBoardInfo.inf | 36 +++++++++++ UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 16 +---- 3 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/P= ciSegmentInfoLibAcpiBoardInfo.c create mode 100644 UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/P= ciSegmentInfoLibAcpiBoardInfo.inf diff --git a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegme= ntInfoLibAcpiBoardInfo.c b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoar= dInfo/PciSegmentInfoLibAcpiBoardInfo.c new file mode 100644 index 0000000000..d37c91cc9f --- /dev/null +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoL= ibAcpiBoardInfo.c @@ -0,0 +1,59 @@ +/** @file + PCI Segment Information Library that returns one segment whose + segment base address is retrieved from AcpiBoardInfo HOB. + + Copyright (c) 2020, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +#include +#include +#include + +STATIC PCI_SEGMENT_INFO mPciSegment0 =3D { + 0, // Segment number + 0, // To be fixed later + 0, // Start bus number + 255 // End bus number +}; + +/** + Return an array of PCI_SEGMENT_INFO holding the segment information. + + Note: The returned array/buffer is owned by callee. + + @param Count Return the count of segments. + + @retval A callee owned array holding the segment information. +**/ +PCI_SEGMENT_INFO * +EFIAPI +GetPciSegmentInfo ( + UINTN *Count + ) +{ + EFI_HOB_GUID_TYPE *GuidHob; + ACPI_BOARD_INFO *AcpiBoardInfo; + + ASSERT (Count !=3D NULL); + if (Count =3D=3D NULL) { + return NULL; + } + + if (mPciSegment0.BaseAddress =3D=3D 0) { + // + // Find the acpi board information guid hob + // + GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); + ASSERT (GuidHob !=3D NULL); + + AcpiBoardInfo =3D (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (GuidHob); + mPciSegment0.BaseAddress =3D AcpiBoardInfo->PcieBaseAddress; + } + *Count =3D 1; + return &mPciSegment0; +} diff --git a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegme= ntInfoLibAcpiBoardInfo.inf b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBo= ardInfo/PciSegmentInfoLibAcpiBoardInfo.inf new file mode 100644 index 0000000000..ec4dbaaa55 --- /dev/null +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoL= ibAcpiBoardInfo.inf @@ -0,0 +1,36 @@ +## @file +# PCI Segment Information Library that returns one segment whose +# segment base address is retrieved from AcpiBoardInfo HOB. +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PciSegmentInfoLibAcpiBoardInfo + FILE_GUID =3D 0EA82AA2-6C36-4FD5-BC90-FFA3ECB5E0CE + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PciSegmentInfoLib | DXE_DRIVER + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + PciSegmentInfoLibAcpiBoardInfo.c + +[Packages] + MdePkg/MdePkg.dec + UefiPayloadPkg/UefiPayloadPkg.dec + +[LibraryClasses] + PcdLib + HobLib + DebugLib diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/Uefi= PayloadPkgIa32X64.dsc index 0736cd9954..62d680eb79 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -3,7 +3,7 @@ # # Provides drivers and definitions to create uefi payload for bootloaders. # -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -38,11 +38,6 @@ [Defines] # DEFINE MAX_LOGICAL_PROCESSORS =3D 64 =20 - # - # PCI options - # - DEFINE PCIE_BASE =3D 0xE0000000 - # # Serial port set up # @@ -122,14 +117,10 @@ [LibraryClasses] PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf -!if $(PCIE_BASE) =3D=3D 0 PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf -!else - PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf - PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf -!endif - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf + PciSegmentLib|MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegmentLibS= egmentInfo.inf + PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/= PciSegmentInfoLibAcpiBoardInfo.inf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf @@ -288,7 +279,6 @@ [PcdsFixedAtBuild] gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c= , 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0= x31 } =20 - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) =20 !if $(SOURCE_DEBUG_ENABLE) gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 --=20 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60710): https://edk2.groups.io/g/devel/message/60710 Mute This Topic: https://groups.io/mt/74665113/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-