From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.1120.1591205923736845893 for ; Wed, 03 Jun 2020 10:38:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=wbsoptnI; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: guo.dong@intel.com) IronPort-SDR: ROy6AEqOYbNNKnWLpTDZIqeUj0SJYCxAPtbAPxF1b7La0v+413zLq3WtwrE74I4KTBeNfh6x7F 2Ufn8FXuZpbg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 10:38:42 -0700 IronPort-SDR: TCiFKmu1/heK80m+0pziYx86Rr4s8OrwVP7TayJD5S+jTmitFPtaWjCiEyTVoje7Z0E5LA7sli 1+x6LyBg4WHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,468,1583222400"; d="scan'208";a="312671215" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by FMSMGA003.fm.intel.com with ESMTP; 03 Jun 2020 10:38:42 -0700 Received: from orsmsx125.amr.corp.intel.com (10.22.240.125) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jun 2020 10:38:42 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX125.amr.corp.intel.com (10.22.240.125) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jun 2020 10:38:41 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 3 Jun 2020 10:38:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aD8jXbA79nxtEvLngArbSF2B7VNGfX/mEDtxdAHdWmId8vmMB6FnsJQHA6MHm+SQadnuyuHJTog+SOBho29GFlc3Ay7Jz1VX0IaPoq64G4TJkW7+87aymEgJsfCx9FuETxWYBVxLfIW4yP9Osk68Li4L9OIVV67bYyCIusX3dP1EjHJhNE3IWqT9SR29tkYUKdnmoW4hYMGOAUmFenYr21L7FZdnfFGgqXPZN1ItZhv5/Bl2050U2QXjxfd3oN5KvgOlX/RfzyV6pW4vn9f7vFanWiSJXhggaoNaicAQsosF3X0ir1OYFc1cA0VEgL78w/OmodlnseA2fPmDq+rgiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M1CVQ3d3D6j0PTGa//K5ajEvh7TGbDCjkLBBqT2BTbQ=; b=QpLJdEhUt6pLMoe6ScQKb0YesaesCS2prlDNcDgwmqJJMbkAjK3a9Gweebs6KoRB4AzcvWLmeW85Oq4gEs3fCsbvce3khXcXGmkQDKl1HrJVBgwo0H1JlcQcNmyggwsW2Ymbell18KOim3JL9PV9iLYtVKKyLyWzxqDs3z/ZwY+KLu6T1y3w6NhVe5GrbSrpHRzZJwRJJX0qRjqQguO4EPr6+yIowPPmmrFISfNapvk3tKgWpL60isbLL0FioXimM/hqgpF6AM8t8hu79apbiSdyY6ybmEXE9t2NmvxPjaOeXwBDuQhX7PesnjkXDdinL9ZNb+MSI4c9ANeo4hkbAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M1CVQ3d3D6j0PTGa//K5ajEvh7TGbDCjkLBBqT2BTbQ=; b=wbsoptnIfvTwYrR/d7kT3iRJp/iO3biMvGLps6zSRZxv6fVZlPU0yflvpgF4nfCmO10QxYi03uYj2MiPpJ8trfFTI/SysiCtrHWL/5AVxkLsphHSwdGSKhZRmybUv0cQTHaV8znQuIIjpGaAH0i+/rOfg9NMUQhiJbkvFm6/W/U= Received: from BYAPR11MB3653.namprd11.prod.outlook.com (2603:10b6:a03:f7::14) by BYAPR11MB3846.namprd11.prod.outlook.com (2603:10b6:a03:f5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19; Wed, 3 Jun 2020 17:38:39 +0000 Received: from BYAPR11MB3653.namprd11.prod.outlook.com ([fe80::d1b:deae:aabb:ef77]) by BYAPR11MB3653.namprd11.prod.outlook.com ([fe80::d1b:deae:aabb:ef77%5]) with mapi id 15.20.3066.018; Wed, 3 Jun 2020 17:38:39 +0000 From: "Guo Dong" To: "Ma, Maurice" , "Ni, Ray" , "devel@edk2.groups.io" CC: "You, Benjamin" Subject: Re: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Thread-Topic: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Thread-Index: AQHWOZDLI8OOzObAwkGr68Gyv40uzqjHBhAAgAAh5sA= Date: Wed, 3 Jun 2020 17:38:39 +0000 Message-ID: References: <20200603102039.768-1-ray.ni@intel.com> <20200603102039.768-3-ray.ni@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [68.2.51.172] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 917b55f1-937a-4a0c-becc-08d807e4f384 x-ms-traffictypediagnostic: BYAPR11MB3846: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 04238CD941 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ymSdq9S/zwzm1/7lXO45dujVXhSH1Bcxx8OjaWhA0/FE2CQIiCWOHf/szOuO6SO31PUGV07eho+VdelP3bR+QRKHL3FlS7yd010tUneqo0bJZdWjDqdIN+p9nxuStOtJINJZ80ONDEwPPNDxGwQZZXrsTv32JH+5+uSAYXS5eCojG3EmHoP7401P/zG/okKFrhBaJ/VZFZ+i0BR2+te2E8F/017JnVNdgsqghFBqfthyikIkVfZuB+LeJoU44n28cnMu6yrAOx/EYw5BC5CP4LHpes1ipVlLDDrUNcaeVaB542dxRo1iyDSNJSoxWEZTr6eKOV0Qkri/TeiXxcSv3g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3653.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(396003)(366004)(136003)(346002)(376002)(8676002)(26005)(4326008)(71200400001)(6506007)(2906002)(5660300002)(7696005)(53546011)(33656002)(186003)(107886003)(86362001)(66946007)(66556008)(478600001)(66446008)(66476007)(55016002)(76116006)(64756008)(8936002)(52536014)(316002)(110136005)(83380400001)(19627235002)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: VRrPMDsXnlsvl0MgWi5jlrtGN11DBLnHKqEu8x431WBoQ/nIBJTjz+ul7T2ylLP6DCt0Vs+eRu7RE4oeNZBbFCsTxeIq5qBUE1t2lbpP02yD9zNNdyZHG1T1W2ltsXR628nA4a4mrX4EryUNOESbuu0q4u/W+GQff2ONfYaW85h2ffvejbnB6o8hexET91kDug6tOZzIXSLfNRNROPY6jecrqHRbqHQAxWen821j8L17n7HvsXg5CZB9OY82fX7nMY5mSVTgh/iJvtzqRu8dOLWgXJWofYikiULvcv7LQQdPaQAbZMSgEXWpq/GH6lEIvtEnwuWfjNjSUA/vHhwquM4Pet2BaS+Oni02YfzIcoDXS0sH74EsBOI2rC4v6K6n3Qy6ix12cQbA9IlcPz8hMI3ug/KNhQE9OjhV9xOLSRN3f9gbbs5ZUDFDDT9T4HyCx4OM2r/f/RBXH1EwBYPn1fgfetM1Ir9o0DUbVkrt/cQ= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 917b55f1-937a-4a0c-becc-08d807e4f384 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2020 17:38:39.0657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qBvAV6/pE9FO0fDHjmCCrXjOrIlxZiD21GjPeSCh1mKb1I04rKyAuso3tDajhu5vdNEdJNPUSU9/3JQsLC1YWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3846 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray, How about set PcdPciExpressBaseAddress to 0 instead of $(PCIE_BASE) by defa= ult? We could even remove PCIE_BASE from DSC. Thanks, Guo > -----Original Message----- > From: Ma, Maurice > Sent: Wednesday, June 3, 2020 8:35 AM > To: Ni, Ray ; devel@edk2.groups.io > Cc: Dong, Guo ; You, Benjamin > > Subject: RE: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr store= d > in AcpiBoardInfo HOB >=20 > Hi, Ray, >=20 > Thank you very much for making this change. >=20 > Two minor comments here, > - Should we add "EFIAPI" for function GetPciSegmentInfo() since it is > standard library interface ? > - For ASSERT (Count !=3D NULL), can we have an error handling flow in = the > code to deal with the case ? >=20 > Thanks > Maurice >=20 > > -----Original Message----- > > From: Ni, Ray > > Sent: Wednesday, June 3, 2020 3:21 > > To: devel@edk2.groups.io > > Cc: Ma, Maurice ; Dong, Guo > > ; You, Benjamin > > Subject: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored > > in AcpiBoardInfo HOB > > > > 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/PciSegmentInfoLi > > bAc > > piBoardInfo.c > > create mode 100644 > > > UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLi > > bAc > > piBoardInfo.inf > > > > diff --git > > > a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfo > > Lib > > AcpiBoardInfo.c > > > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfo > > Lib > > AcpiBoardInfo.c > > new file mode 100644 > > index 0000000000..28ca4b5799 > > --- /dev/null > > +++ > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegment > > +++ In > > +++ foLibAcpiBoardInfo.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/PciSegmentInfo > > Lib > > AcpiBoardInfo.inf > > > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfo > > Lib > > AcpiBoardInfo.inf > > new file mode 100644 > > index 0000000000..ec4dbaaa55 > > --- /dev/null > > +++ > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegment > > +++ In > > +++ foLibAcpiBoardInfo.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 PciSegmentInfoLibAc= piBoardInfo+ > > 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 bui= ld > > tools.+#+# VALID_ARCHITECTURES =3D IA32 X64 EBC+#++[Sources]= + > > PciSegmentInfoLibAcpiBoardInfo.c++[Packages]+ MdePkg/MdePkg.dec+ > > UefiPayloadPkg/UefiPayloadPkg.dec++[LibraryClasses]+ PcdLib+ HobLib+ > > DebugLibdiff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > > b/UefiPayloadPkg/UefiPayloadPkgIa32X64.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 > > PciExpressLib|!endif- > > > PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibP > ci > > PciSegmentLib|.i > > nf+ > > > PciSegmentLib|MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegme > ntLi > > bSegmentInfo.inf+ > > > PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInf > > PciSegmentInfoLib|o/Pc > > iSegmentInfoLibAcpiBoardInfo.inf > > PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > > PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/Base > P > > PeCoffGetEntryPointLib|eC > > offGetEntryPointLib.inf > > > CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCac > he > > MaintenanceLib.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, > > 0x31 } - > > gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) !if > > $(SOURCE_DEBUG_ENABLE) > > > gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x > 2@ > > @ -360,6 +360,8 @@ [PcdsDynamicDefault] > > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31 > > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100 + > > gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE)+ > > > ########################################################## > ###### > > ################ # # Components Section - list of all EDK II Modules > > needed by this Platform.-- > > 2.26.2.windows.1