From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.8318.1631085423164092486 for ; Wed, 08 Sep 2021 00:17:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=mxZMutAc; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10100"; a="284115001" X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208,217";a="284115001" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 00:17:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208,217";a="503434308" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga008.fm.intel.com with ESMTP; 08 Sep 2021 00:17:01 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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.2242.12; Wed, 8 Sep 2021 00:17:01 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 8 Sep 2021 00:17:00 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 8 Sep 2021 00:17:00 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 8 Sep 2021 00:17:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WpDjzdhS1X9nRExuz89Vxa647RNeKtb1Dd5LvE6qV0kDiYcXGT3s657HIrQKipOMh6T8fWW9GOgstW0nvxHc6rsmoBpcHt0AX7j6+EHbplP8osOZtCymKCwNDKOt7DKhO0wJiLXgysatmuiKGLXPNJUv97d07oGQts5ErjCyrHNKq23huVEZueFiGeDI3hLvPzoKWrD7zv8lI5ItkjeZ4YTnBHoeIoCLKJ2VLuSMp0+jiqLBtCoE0bhJsTDT+ltDTi51AKw5rFDG8vx1Uc9W1x1uSdY2acfhYkS/FLrlc5ZZtkeCiGz0Y3v50KAGHt1RomEBQUlzPNO/DRiS6wWb9Q== 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; bh=Uh29vnRqHlHLZFmLyboWaaLfwTvsbnB9rsjjNWLjnL8=; b=FVNn3Hi0MG2bjP4Ya5cel0lPPVntvdbsdgG/N1/yDmZuRoifazB0G/6e/RQdw//ezWnfxpfwTWsK63S6BUKkFLhNUPRb7Vx93Iq7La59Z1Vfrq+xZ5STg/2q+yUSvs9gEGbKnbMiTvWT7U2I86gCjpr/4tY/4vjbkSddk76UEJSfrymQ9ASVogC7nEmGi9arNNIYnYGxMpV5m9aeBRK9BIO4+NVQS5/RxUJUT+USa/AXkN5mruSUB51CcOSWSydAy9U1mxF4jL8d1zzo7hGWwffNs/aeQ7OoyXBbB0BstQMQx0s60ymzi62pn3g8v33kFMsew3Rq+YEpMPq6NXR23g== 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=Uh29vnRqHlHLZFmLyboWaaLfwTvsbnB9rsjjNWLjnL8=; b=mxZMutAcrPwJtpPQVuWQ7AH8X3lxpJWr2d97zfrUFyApMXL6JUpum2rQx+NGTDLC4H7FcmN8ulPtarayjsENaUzZSjy8rnAVoZ4fkOYAKaorDvO8PlqSo3G/QsYrJrSadSPEOl5EeQFGMb9xXlA2huEsmy7iUt3YvsRi5Cgnr94= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB1714.namprd11.prod.outlook.com (2603:10b6:404:47::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.24; Wed, 8 Sep 2021 07:16:59 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::89f0:4b3f:699f:549]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::89f0:4b3f:699f:549%5]) with mapi id 15.20.4500.014; Wed, 8 Sep 2021 07:16:58 +0000 From: "Wu, Hao A" To: "Bassa, Damian" , "devel@edk2.groups.io" , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP Thread-Index: AdeY+paMpehWSOTWSAKEuG98y9jpqAFJPSagAABB0NAAEpzXsAGFIWvA Date: Wed, 8 Sep 2021 07:16:58 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b36d57a0-ee53-4ca1-5d0f-08d97298a5ac x-ms-traffictypediagnostic: BN6PR11MB1714: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IgIffiaTSC/jjGAh8c3RADR+A/YExYJ36gNGlAo4V+dmXcVwFi2Z8WH2R8Zb/WczAB9t/mdBhj4EOpTI+EDKoYs5zI1GKMqPHPNxi3y3Nqdp17LAoS3G3/dweeWoeh5qiZkCiFckZdXAO0Io5/Pl53Xu6/dZhmysejh/SagKJLHK/6HoiglsEX5Bxxit5pLELY5Ip4fjIWPLKjDp9lRZsiBT4IyGCvUMRpP30ycyx6S7E88/cqhDwPpzo8UfNQzBYyS2fn6rAIV6FYEdgVdM1+WjagAKZJhf/9CgNmMXOFS7n1HflX8sxnKDfbmwVu3l4GEwU7l25+/9xnhg485YQSuzlU9Unahx9wtgwhCre59ymyyuyMUGWG4AU35XHid8uaX3KYtZn+4V+rXodiJLg6BbUknIjUPKHv/MFOvsZjEzFBD7w690k82BixGa/BnRu8f+Zd/0uwsEotWEhtV4nT6CKWBK0yV3LhJz6tzxbmgDpbz0cTBRh3iJWx248Ln7wfWW8w+zzfr0DP7zGYxNM4FDVUqYEppsevg9xoNczJSGov5WEzLjtFxqJwRPiw6k1Q5676YqunlfQjUwbUpMpBB0sX821QEEfuUYWUr8Aqs+h8uX2jiVGauTFa4QgzDHSV7e4MVBAGQHUHU+U7oyiIbUy2zR3L/jn8t1nUowH37n/n8iBLwve7/YjGsGLYf9NiAa1ZNOceWy9163kdYrDst3sQvgl7Lbect6bnWivHuzIpE0fO/GG5QLMtkrXifNNNkuDPBNzse4jj8gaO/DfB1o/qJp+RhrZ9Vm/MuJldJq0UCKES69S8eH5D3ZQKjusbHSVziqqHbXlpnH/4J+3g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66556008)(64756008)(66446008)(76116006)(66476007)(6506007)(66946007)(166002)(76236003)(7696005)(66574015)(83380400001)(86362001)(38100700002)(9686003)(38070700005)(33656002)(6636002)(122000001)(55016002)(508600001)(316002)(186003)(8676002)(8936002)(5660300002)(71200400001)(110136005)(53546011)(26005)(2906002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?Q?9/f7n20kOjns1FENzg/ELdhHo7N5AkVBcqzk/jtoIPgaK1JOpiHhRhD3VP?= =?iso-8859-2?Q?HN3DFzr/077kFoV3/5HClH7T2odEtUfQWfR42p2IgvKj8x2RSoOAdn59bv?= =?iso-8859-2?Q?E1kjgNVoWuU+EHjXiePlGrZuf8A0Of87hHWMAjiaTVfcjrBTuuj8/798su?= =?iso-8859-2?Q?co8ilKW+PIxZTQdRl/0E7/2dqlKJ1wKfk284N5pBQGaYtZ8tim4F1nRW+0?= =?iso-8859-2?Q?HeAgb0u2ZN1jYYnLIA/U3Q3bnzVrkVf0Hm0kLK5mNM1LwdWq44pPUge8la?= =?iso-8859-2?Q?pZkMF3eTKYikHVPfy2ntmNha4QkfcEeJeJFWFBHDbRTaewaQB//GveGnQD?= =?iso-8859-2?Q?8EyC0Y0jGwUZXtGFaDDci1hPenh4aOUpSk3uuPTK2ejRBsrR3PLwfdqDJb?= =?iso-8859-2?Q?dtaPD/ZA8WhoXM1zvdSrGHeiTpzhRFmgOgVVMKUZ9UABrwXw0a7Nst+NvM?= =?iso-8859-2?Q?ZgsOYwANn3cyX83/GCy/96Z/E7zSc2Uxf2A4Bdjh4F3wBca+b/VzR6zk91?= =?iso-8859-2?Q?crq8mQW3lNva+hlZ8KzV3ZcHu9t3UDAHbkPtRgtyjBN1+Rf7plt5Cbzc97?= =?iso-8859-2?Q?DFaGslujyEG7FQxDG5UOl+eXhCNS28nIxvkmb4twtDzldOGiK9I/MmSyLf?= =?iso-8859-2?Q?+GvTpJMcTZ6v1PRvsQemY3kYm7PQRZ3DTcH7QkNx77OLeJay6sWw3IB3Vq?= =?iso-8859-2?Q?j7iz+J3NKmfefdJyoexJiYq8GK1B8u7wpP1NzEsRbUrQvnJj6TE6Shww4N?= =?iso-8859-2?Q?Zz0ZcJcYH1pGU8jB0dUHJwLc6jEUpwPoGXFKBg7kTO26/M42yMD+ZPoQns?= =?iso-8859-2?Q?Osq4lfiaepyvYVzMzJt8fw7RuZ7FkqzS6AvzV/d9Fy+k8i6oVOEGVAlvUt?= =?iso-8859-2?Q?cnF9jqTuYVzjyU/qsepJ/TaQE5hy9ZaSFnxcCSUSPUnrD8imFtdSpTTxGP?= =?iso-8859-2?Q?HYofAcWSohitrhriodqXYrAK8+EM49DzVtcvHQWL+FyxWGj7QTnmSq3lHq?= =?iso-8859-2?Q?Wa9VlurIrR38BM63ruJN7XPCvpNV+VAagWvG9YBYflXgpcaX76TGzj4IGV?= =?iso-8859-2?Q?VrArfYdnjPgdq0L2ic+7ARyog0OKmBXQiS0/PtK1zf7pgwHughl9ZSOpdo?= =?iso-8859-2?Q?kbQjojRR5ZTyFsAXHQQUj9OirrQvfn98U+yOuO33p188o8Q4EXQ2087wso?= =?iso-8859-2?Q?Ls70e4EGWHF43xxEleSZZk++KnZdByvFrNLuk8gEf1lj7r2I8N86FzQR5f?= =?iso-8859-2?Q?hCE9xFpH2UQpem1odq6DE00V8lma8OrGhGO7RCgixpsXxijLGDPZG/jirl?= =?iso-8859-2?Q?+cd9RCQHwKpO5WlXco+bKgYB30hTgVb4jsPnWxFZirYhP5BpfPiLbNYopX?= =?iso-8859-2?Q?J4H7Al8X1X?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b36d57a0-ee53-4ca1-5d0f-08d97298a5ac X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 07:16:58.8418 (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: zErEYEmClIjaj6UA4S534WVpoLE8F9dduS4YxEcIkojLTUWXLgHv+Q5WXgf9Gm8Qpod5Luc7LVMonXR76Ady8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1714 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN8PR11MB3666AAA6168B99CA6F1379E0CAD49BN8PR11MB3666namp_" --_000_BN8PR11MB3666AAA6168B99CA6F1379E0CAD49BN8PR11MB3666namp_ Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Really sorry for the late response. So this is a workaround for RCiEP device that is not compliant to the PCIe = spec: |> ARI is an optional capability. This capability must be implemented by e= ach |> Function in an ARI Device. It is not applicable to a Root Port, a Switc= h |> Downstream Port, an RCiEP, or a Root Complex Event Collector. If this the case, could you help to: * Add a comment that briefly describe this workaround before the newly adde= d code * Also mention this workaround information in the commit log message. * Send out a V2 version of the patch? Thanks in advance. Hello Ray, please help to raise if you have concern on this. Best Regards, Hao Wu From: Bassa, Damian Sent: Wednesday, September 1, 2021 1:45 AM To: Wu, Hao A ; devel@edk2.groups.io; Ni, Ray Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che= ck for RCiEP before looking for RP It refers to access to the root port device that doesn't exist in case we a= re dealing with RCiEP device. There can be specific case where RCiEP device has ARI extended capability I= D (even though it's unsupported in this case). In such a case PciSearchDevice goes to CreatePciIoDevice through GatherDevi= ceInfo. And in this case parent is PCI_IO_DEVICE instance created from Crea= teRootBridge function, which isn't valid PCIe device and doesn't have speci= fic bus, only a range of buses. In that case enumerator tries to use this i= nstance to read operation using default 0 bus number, which isn't correct. Damian From: Wu, Hao A > Sent: Tuesday, August 31, 2021 6:28 AM To: devel@edk2.groups.io; Wu, Hao A >; Bassa, Damian >; Ni, Ray > Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che= ck for RCiEP before looking for RP From: devel@edk2.groups.io > On Behalf Of Wu, Hao A Sent: Tuesday, August 31, 2021 12:25 PM To: devel@edk2.groups.io; Bassa, Damian > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che= ck for RCiEP before looking for RP Really sorry, Could you help to provide more information on the below statement? "undefined parent register accesses" Thanks in advance. Best Regards, Hao Wu From: devel@edk2.groups.io > On Behalf Of Bassa, Damian Sent: Tuesday, August 24, 2021 11:15 PM To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check f= or RCiEP before looking for RP Before trying to access parent root port to check ARI capabilities, enumerator should see if Endpoint device is not Root Complex integrated to avoid undefined parent register accesses in these cases. Signed-off-by: Damian Bassa damian.bassa@intel.com --- .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index db1b35f8ef..6451fb8af9 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2153,6 +2153,7 @@ CreatePciIoDevice ( PCI_IO_DEVICE *PciIoDevice; EFI_PCI_IO_PROTOCOL *PciIo; EFI_STATUS Status; + PCI_REG_PCIE_CAPABILITY Capability; PciIoDevice =3D AllocateZeroPool (sizeof (PCI_IO_DEVICE)); if (PciIoDevice =3D=3D NULL) { @@ -2229,7 +2230,16 @@ CreatePciIoDevice ( return NULL; } - if (PcdGetBool (PcdAriSupport)) { + PciIo->Pci.Read ( + PciIo, + EfiPciIoWidthUint16, + PciIoDevice->PciExpressCapabilityOffset + OFFSET_OF (PCI_C= APABILITY_PCIEXP, Capability), + 1, + &Capability.Uint16 + ); + + if (PcdGetBool (PcdAriSupport) && + Capability.Bits.DevicePortType !=3D PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX= _INTEGRATED_ENDPOINT) { // // Check if the device is an ARI device. // -- 2.27.0.windows.1 ________________________________ Intel Technology Poland sp. z o.o. ul. S=B3owackiego 173 | 80-298 Gda=F1sk | S=B1d Rejonowy Gda=F1sk P=F3=B3no= c | VII Wydzia=B3 Gospodarczy Krajowego Rejestru S=B1dowego - KRS 101882 | = NIP 957-07-52-316 | Kapita=B3 zak=B3adowy 200.000 PLN. Ta wiadomo=B6=E6 wraz z za=B3=B1cznikami jest przeznaczona dla okre=B6loneg= o adresata i mo=BFe zawiera=E6 informacje poufne. W razie przypadkowego otr= zymania tej wiadomo=B6ci, prosimy o powiadomienie nadawcy oraz trwa=B3e jej= usuni=EAcie; jakiekolwiek przegl=B1danie lub rozpowszechnianie jest zabron= ione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited. --_000_BN8PR11MB3666AAA6168B99CA6F1379E0CAD49BN8PR11MB3666namp_ Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable

Really sorry for the late response.

 

So this is a workaround for RCiEP device that is not= compliant to the PCIe spec:

|>  ARI is an optional capability. This capa= bility must be implemented by each

|>  Function in an ARI Device. It is not app= licable to a Root Port, a Switch

|>  Downstream Port, an RCiEP, or a Root Com= plex Event Collector.

 

If this the case, could you help to:

* Add a comment that briefly describe this workaroun= d before the newly added code

* Also mention this workaround information in the co= mmit log message.

* Send out a V2 version of the patch?

Thanks in advance.

 

Hello Ray, please help to raise if you have concern = on this.

 

Best Regards,

Hao Wu

 

From: Bassa, Damian <damian.bassa@intel.co= m>
Sent: Wednesday, September 1, 2021 1:45 AM
To: Wu, Hao A <hao.a.wu@intel.com>; devel@edk2.groups.io; Ni, = Ray <ray.ni@intel.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator= to check for RCiEP before looking for RP

 

It refers to access to the root port device that doe= sn’t exist in case we are dealing with RCiEP device.

There can be specific case where RCiEP device has AR= I extended capability ID (even though it’s unsupported in this case).

In such a case PciSearchDevice goes to CreatePciIoDe= vice through GatherDeviceInfo. And in this case parent is PCI_IO_DEVICE ins= tance created from CreateRootBridge function, which isn’t valid PCIe = device and doesn’t have specific bus, only a range of buses. In that case enumerator tries to use this instance to re= ad operation using default 0 bus number, which isn’t correct.

 

Damian

 

From: Wu, Hao A <hao.a.wu@intel.com>
Sent: Tuesday, August 31, 2021 6:28 AM
To: devel@edk2.groups.io= ; Wu, Hao A <hao.a.wu@intel.com>; Bassa, Damian <damian.b= assa@intel.com>; Ni, Ray <ray= .ni@intel.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator= to check for RCiEP before looking for RP

 

From: devel@edk2.groups.io <devel= @edk2.groups.io> On Behalf Of Wu, Hao A
Sent: Tuesday, August 31, 2021 12:25 PM
To: devel@edk2.groups.io= ; Bassa, Damian <damian.bassa@= intel.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator= to check for RCiEP before looking for RP

 

Really sorry,

 

Could you help to provide more information on the be= low statement?

“undefined parent register accesses”

 

Thanks in advance.

 

Best Regards,

Hao Wu

 

From: devel@edk2.groups.io <devel= @edk2.groups.io> On Behalf Of Bassa, Damian
Sent: Tuesday, August 24, 2021 11:15 PM
To: devel@edk2.groups.io=
Subject: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to = check for RCiEP before looking for RP

 

Before trying to access parent root port to check AR= I capabilities,

enumerator should see if Endpoint device is not Root= Complex integrated

to avoid undefined parent register accesses in these= cases.

 

Signed-off-by: Damian Bassa damian.bassa@intel.com

 

---

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c &n= bsp;       | 12 +++++++++++-

1 file changed, 11 insertions(+), 1 deletion(-)=

 

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnume= ratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c=

index db1b35f8ef..6451fb8af9 100644

--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSu= pport.c

+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSu= pport.c

@@ -2153,6 +2153,7 @@ CreatePciIoDevice (=

   PCI_IO_DEVICE    &n= bsp;   *PciIoDevice;

   EFI_PCI_IO_PROTOCOL  *PciIo;<= /o:p>

   EFI_STATUS     &nbs= p;     Status;

+  PCI_REG_PCIE_CAPABILITY Capability;

 

   PciIoDevice =3D AllocateZeroPool (= sizeof (PCI_IO_DEVICE));

   if (PciIoDevice =3D=3D NULL) {

@@ -2229,7 +2230,16 @@ CreatePciIoDevice (

     return NULL;

   }

 

-  if (PcdGetBool (PcdAriSupport)) {=

+  PciIo->Pci.Read (

+        &nb= sp;       PciIo,

+        &nb= sp;       EfiPciIoWidthUint16,

+        &nb= sp;       PciIoDevice->PciExpressCapabilit= yOffset + OFFSET_OF (PCI_CAPABILITY_PCIEXP, Capability),

+        &nb= sp;       1,

+        &nb= sp;       &Capability.Uint16

+        &nb= sp;       );

+

+  if (PcdGetBool (PcdAriSupport) &&

+    Capability.Bits.DevicePortType != =3D PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT) {

     //

     // Check if the device is a= n ARI device.

     //

--

2.27.0.windows.1

 


Intel Technol= ogy Poland sp. z o.o.
ul. S=B3owackiego 173 | 80-298 Gd= a=F1sk | S=B1d Rejonowy Gda=F1sk P=F3=B3noc | VII Wydzia=B3 Gospodarczy Kra= jowego Rejestru S=B1dowego - KRS 101882 | NIP 957-07-52-316 | Kapita=B3 zak=B3adowy 200.000 PLN.

Ta wiadomo=B6= =E6 wraz z za=B3=B1cznikami jest przeznaczona dla okre=B6lonego adresata i = mo=BFe zawiera=E6 informacje poufne. W razie przypadkowego otrzymania tej wiadomo=B6ci, prosimy o powiadomienie nadawcy oraz trwa=B3e jej usuni= =EAcie; jakiekolwiek przegl=B1danie lub rozpowszechnianie jest zabronione.<= br> This e-mail and any at= tachments may contain confidential material for the sole use of the intende= d recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or = distribution by others is strictly prohibited.

 

--_000_BN8PR11MB3666AAA6168B99CA6F1379E0CAD49BN8PR11MB3666namp_--