From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.32085.1591628711843560042 for ; Mon, 08 Jun 2020 08:05:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=bykaWyRZ; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: maurice.ma@intel.com) IronPort-SDR: apG8f2yMd6VNhpV1F6bVXnmQMkMdaQQ/6yWVlPol34ZJ9eGm/uE5+tCdIsc2mxzjHYztShOPDZ t3aSbZyMDrww== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 08:05:10 -0700 IronPort-SDR: Iom2oPFvuqpkxGj7eVDIpeMAJB/T8FWtJO3+62XWj85JsPc+hmywMfM9YyBVaqOpoG/4I75xCr wU4mzWgDD5ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,487,1583222400"; d="scan'208";a="295479533" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 08 Jun 2020 08:05:09 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 08:05:08 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 8 Jun 2020 08:05:08 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 8 Jun 2020 08:05:08 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jun 2020 08:05:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LnYAZfUwp8brpzNX7te/ynNSlinSKAdP2Qtw3Eab4+TsTLilha9huvR6Pr41L9PJ5wOrxQpGeiKgzq8MHjeKopmIsEKkztiGT9Ga7wJo7sx/2IWW9j4NCu+rg5JRu2nkgza7ZLq+wHyOUjezV3dVeP9iV5tltWQjpZEo0A3p2yxmfgmFzPzsp1OnXRew5mfjZzLAmT7hFy4aLwH6hj7e2x+8W9quZ2xx/BhSi50KW2U2ReFx96dreHYJVVEzHlGrZQfgWG2lv3OUwRBRiHcy8OuoIBvGSZM9PY8Gh9VumSl8ywDitX8hrFnS/fNETa52U2hCAWhjaXOIkuKVjESZgw== 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=Ua/J4YxnzHfMxpa+Brit7CeXT+ZM4HPd3HqCkyP/rko=; b=G5agte4X/Vj9R08H8AFdxnIe8OkgFZq3l4h/9ObIPTUjswMniNBQytEoyok5gQrKrGbj2IHXX/4vb1UDrb/sgBdomZcMzEnxf+5IWyjVNYjif8ROmzn1rCL/YsdJXYe0bDaOrhtnVfW+hLrFxxrE1Zr9DFJp69Nj5MthRl0VBEB8kitr78lV/om1g1lpDKV2wXGPOdPqMVidf69bMVaE9vepGT6o8ygObNenKFRGmhRsUeyNOTANPbRU3CzqgdBVha6Ko/jnfeDg5nnzCqFtmDeWtg74gjPMomp8JvCaPKfiPJ3j1pHVmNZSvb1oeQyOtXthkE6rY9eGARKv0W/UeA== 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=Ua/J4YxnzHfMxpa+Brit7CeXT+ZM4HPd3HqCkyP/rko=; b=bykaWyRZJ9uaYQu6WYFFswlU3XDsiLZZ9naU2FAeX0SXBHmyfRlkjcctBUs39ITowGBOTbCXwrUJ+4MKvK/3YWsRen0d6//wPq8hqBoGcOEMbCi0zbhWGSgssMZ2xp88JgJUnOHZzUSTGsrgbBSANtB0ubi5Wnv0ztC7e9sOJeI= Received: from DM6PR11MB2793.namprd11.prod.outlook.com (2603:10b6:5:c0::29) by DM6PR11MB2684.namprd11.prod.outlook.com (2603:10b6:5:c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Mon, 8 Jun 2020 15:05:00 +0000 Received: from DM6PR11MB2793.namprd11.prod.outlook.com ([fe80::d43:5665:5cee:b3c5]) by DM6PR11MB2793.namprd11.prod.outlook.com ([fe80::d43:5665:5cee:b3c5%6]) with mapi id 15.20.3066.023; Mon, 8 Jun 2020 15:04:59 +0000 From: "Ma, Maurice" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Dong, Guo" , "You, Benjamin" Subject: Re: [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Thread-Topic: [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB Thread-Index: AQHWOiAupwK/k0N9iUiAeKQKdHvA6qjIi+Vw Date: Mon, 8 Jun 2020 15:04:59 +0000 Message-ID: References: <20200604032710.970-1-ray.ni@intel.com> <20200604032710.970-3-ray.ni@intel.com> In-Reply-To: <20200604032710.970-3-ray.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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: [104.153.200.60] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d27dc8f-620a-44f8-ab2d-08d80bbd5071 x-ms-traffictypediagnostic: DM6PR11MB2684: 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:9508; x-forefront-prvs: 042857DBB5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +ZbUjTCcoVh6geYqAIGGyls6fUrlvwvaih5EXblIxolFG51le1hnTUaZQuSmXbhsLIKZSeKnwvD+5TElBYfnD+PnwCRr+BaBYMtrhl0KKkAiUksdxGN2GncK9+gTtQ656icvyRzq2rtw1RROn2nZJ5nRUoKAe7LKpRJeSY0s3UJVRvUEMqgY4kvhE8Gx0ZGVZVDEmlGVBedfjpmGQTyXDXMCtKto+zeElcTvkoszEQr1SH7JgEe6Wzx2OaCNcJbdh0+xrVZa5nya6mf1kdlbICcPwPGP7auNtCNUH5u0eix/KbPsnZNeYIAMeJrKKuQge0n5QaTsvaNXqYRhX0GXMg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB2793.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(346002)(376002)(366004)(136003)(39860400002)(33656002)(478600001)(53546011)(6506007)(8676002)(110136005)(54906003)(8936002)(107886003)(7696005)(316002)(4326008)(86362001)(83380400001)(26005)(55016002)(9686003)(66476007)(66946007)(19627235002)(66556008)(5660300002)(64756008)(66446008)(2906002)(71200400001)(76116006)(52536014)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: jgV0uuJ6PZi+/wFVq9o60jdrQbLGNCbOW5WytuObXlLaT/9RKamTsW4GpVHUv88ijO6eetnO+V4f0y8QAKXcGzneIjES9YRIwnUaZfkFoyoHishBwdG4q+jmvMvAm6SAA3jv0PYw2F4OPWZmroaHSd98lyzPuB74g80c0GAYN9mZji5vWbgdXxYtBITnZTkJB/Vhge8to0PS95TYJAZCFMWwes1Rjp4dPa4Q3EOsSCs7SX7mrRhRaADUaz8bV7nEtOJDKncdX3Zm2Blgm0CKMp5E1e52RFDpUhXrMvrX93n9406NSgK8qYA4nzCJHHCgFtwtuFxGngxfwcmkadoBwa7Oij62JSP1IN2ZzmFwUObtD2BnXXu07muQTP37KErNqztBv+vqXKn5psE2gjX/7HR2JEEa4kWkbBCCMxRFsgxRGq+CcARG0PdvRiXPiJskSLJ7NmSWW+N50rFHEHK0aUPdMq343n1KDSSIkXA0ppu4gILIbpTphBqZhafbZTOY MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4d27dc8f-620a-44f8-ab2d-08d80bbd5071 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2020 15:04:59.7657 (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: 1S7rmZxXq/8RLeM/8J5zVo3X95jLIA3+FL8Gf839j2gQBj2lCrDvndD2AUfwp562j2G6c/TYGqzEGhTFfcAv+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2684 Return-Path: maurice.ma@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Ray, I noticed in this V2 patch, you removed the following line from the DSC fil= e. gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) It will make the PcdPciExpressBaseAddress become PcdsFixedAtBuild type inst= ead of PcdsDynamicDefault. Is this your intention ? Also this V2 patch forced PcdLib class instance to be BasePciLibCf8. It me= ans all PCI configuration space access will use I/O port access. We prefer= using BasePciSegmentLibPci. I think we should keep the original code for= this so that it is configurable. Also can we sync up DSC changes into UefiPayloadPkgIa32.dsc as well ? Thanks Maurice > -----Original Message----- > From: Ni, Ray > Sent: Wednesday, June 3, 2020 20:27 > To: devel@edk2.groups.io > Cc: Ma, Maurice ; Dong, Guo ; > You, Benjamin > Subject: [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored= in > AcpiBoardInfo HOB >=20 > Today's UefiPayloadPkg always uses 0xE0000000 as the PCIE base address an= d > ignores the value set in AcpiBoardInfo HOB created by the boot loader. Th= is > makes the payload binary cannot work in environment where the PCIE base > address set by boot loader doesn't equal to 0xE0000000. >=20 > The patch enhances UefiPayloadPkg so that the PCIE base address set by bo= ot > loader in the AcpiBoardInfo HOB is used. >=20 > 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/PciSegmentInfoLibAc > piBoardInfo.c > create mode 100644 > UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc > piBoardInfo.inf >=20 > diff --git > a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib > AcpiBoardInfo.c > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib > AcpiBoardInfo.c > new file mode 100644 > index 0000000000..d37c91cc9f > --- /dev/null > +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn > +++ foLibAcpiBoardInfo.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-Li= cense- > Identifier: BSD-2-Clause-Patent++**/++#include +#include > ++#include +#include > +#include ++STATIC > PCI_SEGMENT_INFO mPciSegment0 =3D {+ 0, // Segment number+ 0, // To b= e > fixed later+ 0, // Start bus number+ 255 // End bus number+};++/**+ R= eturn > an array of PCI_SEGMENT_INFO holding the segment information.++ Note: Th= e > returned array/buffer is owned by callee.++ @param Count Return the co= unt > 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);++ AcpiBoard= Info =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/PciSegmentInfoLib > AcpiBoardInfo.inf > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib > AcpiBoardInfo.inf > new file mode 100644 > index 0000000000..ec4dbaaa55 > --- /dev/null > +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn > +++ 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 PciSegmentInfoLibAcpi= BoardInfo+ > FILE_GUID =3D 0EA82AA2-6C36-4FD5-BC90-FFA3ECB5E0CE+ > MODULE_TYPE =3D BASE+ VERSION_STRING = =3D 1.0+ > LIBRARY_CLASS =3D PciSegmentInfoLib | DXE_DRIVER++#+# Th= e > 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+ > DebugLibdiff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc > b/UefiPayloadPkg/UefiPayloadPkgIa32X64.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 bootload= ers. #-# > 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 - #- # PCI options- = #- > DEFINE PCIE_BASE =3D 0xE0000000- # # Serial port s= et 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-!end= if- > PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i > nf+ > PciSegmentLib|MdePkg/Library/PciSegmentLibSegmentInfo/BasePciSegmentLi > bSegmentInfo.inf+ > PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/P= c > iSegmentInfoLibAcpiBoardInfo.inf > PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC > offGetEntryPointLib.inf > CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCache > MaintenanceLib.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, 0= x23, > 0x31 } - > gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) !if > $(SOURCE_DEBUG_ENABLE) > gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2-- > 2.26.2.windows.1