From nobody Tue Nov 26 01:46:48 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+60653+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+60653+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591179685; cv=none; d=zohomail.com; s=zohoarc; b=jpVzgNk6JFoN564n4tfR2uezGl0sdS1ZYNxicjoWtqzqHTAmfWhm52ykc5xsdKFaWVSHt1vcGh9ODn1Zn6jiavXrm4WbaXe5nB7PFYlZm9DGwASabChS14q0AzZLelMl4qP3X3VQTzTktajGOC6rZTGu1CTWG8GWUQc1SlkyPik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591179685; 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=Dz7W68+VM85PcU0ncSKXTArVaPuEnAn5wcHtcq88x74=; b=Qh5yCHDmlaO7TCCzNHgJdjWqZnege4JX1R4MjX+Y9mu8LJDPGSEy6yegiJ+G+YaEs4Ytf42ohYJufPPHemzQ9y2u3ZkikjL3DHPZ4oObScgAxDc7aqtc/IHpM0aqBPrFZJlR6OAPJIDLrM88mGoU8WRBI5bsKbR2IhQ2UwvkkfE= 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+60653+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 1591179685831248.19879439834017; Wed, 3 Jun 2020 03:21:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id daOWYY1788612xjrngKmRH29; Wed, 03 Jun 2020 03:21:25 -0700 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web11.10820.1591179684436440113 for ; Wed, 03 Jun 2020 03:21:24 -0700 IronPort-SDR: Et5YVYRs8VRj0PUZBNRwHwnajMoiwtFFbCu2Sk1Tq9lFdpo9VemTco8YUtp0xPJcs+Y0pMZPej 95C1yikRkETA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 03:21:24 -0700 IronPort-SDR: C5stLAAt3zRM5QBphtg4xEMIxpKwt8ThV+B3lDJl8uBQmjS0QX29cJd/cSD7Bfjkon11jQSfyR hWyMJ8CKNIpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="269029710" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.43]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2020 03:21:23 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH 1/2] MdePkg/PciSegmentInfoLib: Add missing EFIAPI to GetPciSegmentInfo() Date: Wed, 3 Jun 2020 18:20:38 +0800 Message-Id: <20200603102039.768-2-ray.ni@intel.com> In-Reply-To: <20200603102039.768-1-ray.ni@intel.com> References: <20200603102039.768-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: oVmpdwDdLjDy9RqLC9Exn9hLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591179685; bh=B0c4NcY7HOS0R2aLeRxH2YWd0q8LpAod/8qBtGhuQhw=; h=Cc:Date:From:Reply-To:Subject:To; b=ui7nfIFBjgnV8DMu8hzucllyMsXB7giLsG9Tey3ABL6wQX7zT5Tc01vrauV/Qf5+51i 6KtyqdmJhgNyQatRdUZ/uIgHzhMBEME13vziBZpHZbPMFrcZqJp2bdf5tmrc1MzJWJRVw J4ab8Lg+Mnqjm83gst7Qkys6yJfzE2MrxsU= 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 | 1 + MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c | 1 + 2 files changed, 2 insertions(+) diff --git a/MdePkg/Include/Library/PciSegmentInfoLib.h b/MdePkg/Include/Li= brary/PciSegmentInfoLib.h index 320a223628..a59644af99 100644 --- a/MdePkg/Include/Library/PciSegmentInfoLib.h +++ b/MdePkg/Include/Library/PciSegmentInfoLib.h @@ -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..11c09506ab 100644 --- a/MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c +++ b/MdePkg/Library/BasePciSegmentInfoLibNull/PciSegmentInfoLib.c @@ -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 (#60653): https://edk2.groups.io/g/devel/message/60653 Mute This Topic: https://groups.io/mt/74646707/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 Tue Nov 26 01:46:48 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+60654+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+60654+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591179689; cv=none; d=zohomail.com; s=zohoarc; b=SeUVWfGmZZ1MPAxpFb8JBOV4rUHKflE1Xydug1qKnYLh0BlvmGDfWQsfMT1w6VPjKKmHYCu77hwS9DrWIec9smhNzHTB5Uyt1AYFreGUVQ4IrQ3zoAX+On49OovK1w0/OEU9sCxiuVIgTMR5ld+oIVzgpMz4PmS3aybfycr8tDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591179689; 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=Adj+mjkUZkiZNB3CK083fcByRaoFyC3OiyIgZNNRzac=; b=bUzORBzbhTtymjN9ty5D4aRZ81a2C5KBPyqdsIlYF/Gd3o2EQrGrQ3NIswdnvY4zM50jXr4dRIKq263VjykoGl6/yLxkE1NNBnVlUoh9kf1FT3CVMvWpN1GZdWNAohBF8IweGEwwKGWUWzCv5rsQYRZhvbmU8iBLHdpMyUyFWSs= 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+60654+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 1591179689234412.7552954153283; Wed, 3 Jun 2020 03:21:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tRlcYY1788612xRbghqKOw8c; Wed, 03 Jun 2020 03:21:26 -0700 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web11.10820.1591179684436440113 for ; Wed, 03 Jun 2020 03:21:26 -0700 IronPort-SDR: VxyBYT3qXXFsICwtbI1ywW2SyzDnyXimM0n/l9pLxZpQVqalXH3xyLz7J+XjWJ8N7iz9kthvBe PnnQCTGLP/xA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 03:21:26 -0700 IronPort-SDR: yjbmHMqkVyB4yzD01S723b6LU2lkp0ycHUKnUepAC96Y9D+oAJqZwBD3Pn8wE0TFeTXHScpTnd /46fRKYCFXhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="269029719" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.43]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2020 03:21:24 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Maurice Ma , Guo Dong , Benjamin You Subject: [edk2-devel] [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Date: Wed, 3 Jun 2020 18:20:39 +0800 Message-Id: <20200603102039.768-3-ray.ni@intel.com> In-Reply-To: <20200603102039.768-1-ray.ni@intel.com> References: <20200603102039.768-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: 39UuyUoLI4B6K9rxnBJgTtfTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591179686; bh=x3VwAGRqmzdEaRWw2OMiCdDmbhAc1v0JV3bGv0Blqfg=; h=Cc:Date:From:Reply-To:Subject:To; b=oTtEyeU7D6/siW17TJ6N/fH+aOa0lHDy3Ev0sA6F/N5d+1BpUyX72XrPx3yhaJtsEDr jk4l22aW4dPRlGah/sWLAJgDvonvM8AQzQkeNgC1gQm2uW/Dp+bzzLBkzH9UEIYpDK+os QQPEy5FENoSM+cUl3QWdL/DbKc0rLnYWJ3k= 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 | 55 +++++++++++++++++++ .../PciSegmentInfoLibAcpiBoardInfo.inf | 36 ++++++++++++ UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 6 +- 3 files changed, 95 insertions(+), 2 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..28ca4b5799 --- /dev/null +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoL= ibAcpiBoardInfo.c @@ -0,0 +1,55 @@ +/** @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 * +GetPciSegmentInfo ( + UINTN *Count + ) +{ + EFI_HOB_GUID_TYPE *GuidHob; + ACPI_BOARD_INFO *AcpiBoardInfo; + + ASSERT (Count !=3D 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..e114039f82 100644 --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc @@ -129,7 +129,8 @@ [LibraryClasses] 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 +289,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 @@ -360,6 +360,8 @@ [PcdsDynamicDefault] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100 =20 + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform. --=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 (#60654): https://edk2.groups.io/g/devel/message/60654 Mute This Topic: https://groups.io/mt/74646708/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-