From mboxrd@z Thu Jan 1 00:00:00 1970
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
by mx.groups.io with SMTP id smtpd.web12.1151.1632155058142433797
for ;
Mon, 20 Sep 2021 09:24:18 -0700
Authentication-Results: mx.groups.io;
dkim=fail reason="body hash did not verify" header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kXCZQtyY;
spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: damian.bassa@intel.com)
X-IronPort-AV: E=McAfee;i="6200,9189,10113"; a="221283633"
X-IronPort-AV: E=Sophos;i="5.85,308,1624345200";
d="scan'208,217";a="221283633"
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 09:24:17 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.85,308,1624345200";
d="scan'208,217";a="473675737"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
by fmsmga007.fm.intel.com with ESMTP; 20 Sep 2021 09:24:17 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Mon, 20 Sep 2021 09:24:16 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
15.1.2242.12; Mon, 20 Sep 2021 09:24:16 -0700
Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by
fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
15.1.2242.12 via Frontend Transport; Mon, 20 Sep 2021 09:24:16 -0700
Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) by
edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.1.2242.12; Mon, 20 Sep 2021 09:24:12 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=fSUGqG8zAjaGgOKY0E1WqfOiFcPToX+LT6FDHH4vHbIxjviJ7CCDrV7cz8Y+m4Z7/42VS4RbsqT9MX7Mg9Coqsac+BWIJk8rzlPAF1gmCEyQzNztWZhJWuvrctEVpZZi3LuG40rs89USgHFLahNamGIJcu2IOokrKdY8CkPcAC3QhVtRWDx2Gb43XpJNvTZjtKdWaXsZHVmIqLgb7sjxkhVsLYWT/6eb632Vw6uPeL18n3UEaQcKRLi/Or/xBAJ8UXOqEtqEoF+aEyxNpbMXbwO1hv7ykCowaik6R7TjKHicAFRZE2wKVPYlDZUFZ3DqItyATIN01XpPrFayk9/rLw==
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=TmY/C94JBzTecmLY5esBsNX0MboPxWf6iMh/z7RJgn4=;
b=I9OJDl/0pBdGRjzPjVUjGhtN5ubI+GbP80HZC5EmubnnR7hbXXxsk2Eo/8S2LY8jqLV/lW323ueXOk3aJBycB/SQoall6Py6uVQhaNTRicd+DaskfM2t9XrPVGN1lD8asWyv+isfFPYFCYmcN/y0sCrBYdaxZAFzEb19GLsXipHFehdynWg9nvvm/5KKSBH2dC1WobBk6Fa3mZcdavArnlVdkbLEX+bL9QJsIbdXpsXNf7AEEdk3ELov7zya41rA6Cs24GH4IVlqNIc3U9v1Jjsapf5ZzxQ1V4+epWWnXTXLehp7DiByezvHwbDPylDJJ3Jo0+5QASaC54QoE8R8Cg==
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=TmY/C94JBzTecmLY5esBsNX0MboPxWf6iMh/z7RJgn4=;
b=kXCZQtyYUGbwQSCu3NuCmAbjbM2CAK/g+dZOYL/g0Yh1uIyKsXESx7gRXwRnYDaXhRvakUAR9Ogi+nBP7/Whu51YZ+Gjt5NNjhmqn/806uP5RWvzgYDqdYiuP+91JPpcgNTFA5dy4MLAXW7CU4mwkil1+aX03H3imGnLkd7/5yw=
Received: from CO1PR11MB5187.namprd11.prod.outlook.com (2603:10b6:303:95::15)
by MWHPR11MB1967.namprd11.prod.outlook.com (2603:10b6:300:111::14) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.17; Mon, 20 Sep
2021 16:24:11 +0000
Received: from CO1PR11MB5187.namprd11.prod.outlook.com
([fe80::60d4:c5c8:b43c:f940]) by CO1PR11MB5187.namprd11.prod.outlook.com
([fe80::60d4:c5c8:b43c:f940%6]) with mapi id 15.20.4523.018; Mon, 20 Sep 2021
16:24:11 +0000
From: "Bassa, Damian"
To: "Ni, Ray" , "Wu, Hao A" ,
"devel@edk2.groups.io"
CC: "Kolakowski, Jacek"
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+paMpehWSOTWSAKEuG98y9jpqAFJPSagAABB0NAAEpzXsAGFIWvAAWn5jXAAAzNy4AA3hnLAADOmjyAAlrizkA==
Date: Mon, 20 Sep 2021 16:24:11 +0000
Message-ID:
References:
In-Reply-To:
Accept-Language: pl-PL, en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
dlp-product: dlpe-windows
dlp-reaction: no-action
dlp-version: 11.6.200.16
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: 1a36c542-b336-454d-2315-08d97c531446
x-ms-traffictypediagnostic: MWHPR11MB1967:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs:
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: tBBI1NHblzXHM50O7uOz7wRBRKoCDGsFBkrGy3rEraftgZALTTAuL5gCZMLU3yBYrxpJNfjCgQ/3MjnSOHFcWq+DPz2geottwzDaGJEZoml2lc14nKJS55NZfHspG1zcpQDQYqmRKeGK0mVKtQjQMJLoS8gUafQEZkfhfhrDxHBuJTZmuAdIDpoIfXZfGj3H0wnapTWOemfgVJZSUQbVT8if5p4ar+fERmxUh0QQhoen1x+9Y1yjHgqAqSaLITohyiMDENvbU15b8k4PTMDJCc/TmQPXUybOLMlvHN1IHeZ/HJZrJXIjxbO5jllRNdBNYDYzffUiE8g1NNIz17wW4cgceFpUlVvrg4duwFQpIDU9Kq6iPlMIVoPl6xR8qOiN9CsRB0DVEp1STq1Z6FnHvJC8tk2tGYjBipx3QSba6U6TBRoOeVr6nbM6HAyTF8JxcWFVGaFeJk0WKUPLTQBMsO7q50MYrykvOrYMNImP7PddXyujNtwF+O/4UQdErYgPeBSTIO5Rtc4oOjqKi0cbBfFWOCR/lXC5CIPnZrOa87cNWWRja+fzSqP0u6dnnoU5u9RAeuE66fexjIF5AJxxNgkV3PhMji4UQ09Tm6EZ6B0EVvNkg6tmi6tt8d648cOlyoR1waDVh7Y8XGB7DjnC+nfYXPcYPdspCmpF27aGxHo8Kxzc7A7u5Ga6thbwK6MI4J7BodfoSlZYlYRKvMdo33/HqPrn4QlRNwXJhJW9hteR83qN+KSL+CY1ObyLsEl2wnTHpOiyGNG4V6R0dg/b97ZCLEIYmQDIxImJh5oR4kscL3xz/3ud/jChsaxuIP34JSJbx4GSPnvxBip63pxZuQ==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5187.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(316002)(186003)(52536014)(76236003)(107886003)(83380400001)(508600001)(26005)(5660300002)(38070700005)(166002)(66476007)(64756008)(66556008)(66446008)(66946007)(2906002)(76116006)(86362001)(38100700002)(110136005)(122000001)(33656002)(55016002)(4326008)(71200400001)(7696005)(53546011)(6506007)(8936002)(9686003)(8676002)(66574015);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?Q?uR5yt2/rlbH7z9ij4xTbokV9spcY97mtXupvpOa4UzAT9gYIyqXcya2dXE?=
=?iso-8859-2?Q?LJ2iewtpc1AXr59nZR8u5zPRriI0wzcsjNTkhUmAbjYHdLr2r0M55v6VZW?=
=?iso-8859-2?Q?NlM/Pg+rY5KUUtjrRJ2+PiaCjdmP+UeAn6dVBPUOBehJglddp7psHOClNT?=
=?iso-8859-2?Q?sRHNquA9hA3aDHpahC+qbowLw7sb7o5v7dJy1Al7levev9FNlL3J88oKbc?=
=?iso-8859-2?Q?+02K7wcTW20VlRkm39brgkZCp2mUr458aj9UaA5m7yHfJ/m2pQYFmHT4wy?=
=?iso-8859-2?Q?GNlg8thA1SLnK4R5jil01FOKT4Cy7lKaZl2UP53K0TnI01XwIF6IFweeAm?=
=?iso-8859-2?Q?ae3H46SPhXIhk+ppqlZXAkCDovWtGatvzTu38SM90fUivtVb50/3EtTOgi?=
=?iso-8859-2?Q?8bBCzWU1tvY/KK4nXZn81uC5CyqBtKqNhz85ZbB2RpsaJbvYG+8uPQlIab?=
=?iso-8859-2?Q?cwFwBLz7RZELr+mExj0B6WXWmDWxeu0OUTWh2FwiEQYLM1kIrolnr7spwA?=
=?iso-8859-2?Q?U4yXv09QobBK4R2I1iu73LEOMLK9hRfriVaW0UFKYqtVuOYn+74im1SUZs?=
=?iso-8859-2?Q?TJUKI19qSm47+teqAxwPRbO1vLlSIh2SgMhiH7Qpvl3fyDYQ6Vb6q/wusu?=
=?iso-8859-2?Q?68SYSQFqDCZTX4C23hNL796I6sCsfAzbnqbIGmocjKQLXGNhBHhYicMrv5?=
=?iso-8859-2?Q?CiMEgyqyHb7e0DX177tvgxeACl1vsmOc9uCxQR5J4dHcgmCe35blWKd7+9?=
=?iso-8859-2?Q?yJ4k8HdpYzqRlPhcUCA/EmTBQ18355m4+dNJb21O8HG6atu8W3ffShseCn?=
=?iso-8859-2?Q?xabc74ivrPHLiwbHEF9QaacJe5DcNsVKDf397/8H0Fd6Af9MNZ1dJzqnL3?=
=?iso-8859-2?Q?QzOgC0eV7GFDit+XZEWKjQejlM67ynh57Njehi3mPaZdSMfDKhIqAV16Qo?=
=?iso-8859-2?Q?qu6jwqNe+KtnYz/7roO+Sz1cyo1J6ERZvzGKkHlTwRcFQtYOcymqQi/N9l?=
=?iso-8859-2?Q?mQYQqbs+BFRUtbsG9r45GH9L1VmZWkqYRRXO/13gqOhCNEYJCd6L6SikEG?=
=?iso-8859-2?Q?W8esmalrG5/HyCtoSf1IQ5gXXKK2DF85j72CrFWZxi6I5eervHTTK42mS6?=
=?iso-8859-2?Q?Nt5aSnjjPDj6+TfbuUQO8JyH9cJaXN0sTwaOOjqn93qj6Zer5rJ5mx9ATY?=
=?iso-8859-2?Q?X0z0KccvsioaLwvQmly2C5ZQnFekR8uRJHjUtOc5F/uKdbUsEl3PKst40y?=
=?iso-8859-2?Q?cp4waEXMnM5+UpoNRkMeVCkPAoKOkw8c2qdCacsJ4L2UHy6o+Pz6zZ1X1M?=
=?iso-8859-2?Q?5j7BBAfEwP7r7AfDyKiWGGyoiVSujXlYLYQ+4lCbjLoP/OF/vI2RCawEBr?=
=?iso-8859-2?Q?BrbgiKyLLZ?=
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5187.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1a36c542-b336-454d-2315-08d97c531446
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2021 16:24:11.3259
(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: XtHu/Fh1mW4WzE4e0/VmfI0IZsGS9t+PfsSV7+PhaKnJk39h0t6/qqiC6ZvdNJp1CIParUIjdEt+aCt/FSFB1A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1967
Return-Path: damian.bassa@intel.com
X-OriginatorOrg: intel.com
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_CO1PR11MB5187EAF96BD0D97678F77C728DA09CO1PR11MB5187namp_"
--_000_CO1PR11MB5187EAF96BD0D97678F77C728DA09CO1PR11MB5187namp_
Content-Type: text/plain; charset="iso-8859-2"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Thank you for input. Submitted V2.
Damian
From: Ni, Ray
Sent: Friday, September 17, 2021 6:31 PM
To: Bassa, Damian ; Wu, Hao A ;=
devel@edk2.groups.io
Cc: Kolakowski, Jacek
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che=
ck for RCiEP before looking for RP
If a device is a RCiEP, PciIoDev->Parent points to a virtual PCI_IO_DEVICE =
for the RootComplex.
The PCI_IO_EVICE.Parent equals to NULL for RootComplex.
Which means, we can create a helper function
BOOLEAN IsRootBridge(PciIo) { return (BOOLEAN) (PciIo->Parent =3D=3D NULL);=
}
your code can call this helper function.
From: Bassa, Damian >
Sent: Friday, September 17, 2021 12:02 AM
To: Ni, Ray >; Wu, Hao A >; devel@edk2.groups.io
Cc: Kolakowski, Jacek >
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che=
ck for RCiEP before looking for RP
I was looking for anything that wouldn't include reading register but only =
thing that distinguish device PCI_IO_DEVICE instances with root bridge inst=
ances is population of BusNumberRanges structure.
This technically could be used since this is populated only for root bridge=
s and not devices but using this would be just confusing since there is no =
self-explanatory field there.
For my knowledge this is best way to tackle this issue. Please let me know =
if there are have some other worth exploring ideas.
Damian
From: Ni, Ray >
Sent: Wednesday, September 15, 2021 3:21 PM
To: Bassa, Damian >; =
Wu, Hao A >; devel@edk2.group=
s.io
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che=
ck for RCiEP before looking for RP
Extending PciBus to support such case is valid.
But can you check if there is other pure software way to detect whether it'=
s an ECiEP?
From: Bassa, Damian >
Sent: Wednesday, September 15, 2021 7:54 PM
To: Wu, Hao A >; devel@edk2.g=
roups.io; Ni, Ray >
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che=
ck for RCiEP before looking for RP
Should we consider this workaround? I'm having issues interpreting this par=
t of PCIe spec.
My understanding of this quote is that this capability can exist in but it =
shouldn't be considered.
I would assume it's possible option that it needs to be considered? Is that=
wrong?
Damian
From: Wu, Hao A >
Sent: Wednesday, September 8, 2021 9:17 AM
To: Bassa, Damian >; =
devel@edk2.groups.io; Ni, Ray >
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to che=
ck for RCiEP before looking for RP
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.g=
roups.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.
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz=
ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31=
6 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata=
i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi=
adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek=
olwiek przegladanie lub rozpowszechnianie jest zabronione.
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_CO1PR11MB5187EAF96BD0D97678F77C728DA09CO1PR11MB5187namp_
Content-Type: text/html; charset="iso-8859-2"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Thank you for input. Submitted V2.
Damian
From: Ni, Ray <ray.ni@intel.com>
Sent: Friday, September 17, 2021 6:31 PM
To: Bassa, Damian <damian.bassa@intel.com>; Wu, Hao A <hao.=
a.wu@intel.com>; devel@edk2.groups.io
Cc: Kolakowski, Jacek <Jacek.Kolakowski@intel.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator=
to check for RCiEP before looking for RP
If a device is a RCiEP, PciIoDev->Parent points t=
o a virtual PCI_IO_DEVICE for the RootComplex.
The PCI_IO_EVICE.Parent equals to NULL for RootCompl=
ex.
Which means, we can create a helper function
BOOLEAN IsRootBridge(PciIo) { return (BOOLEAN) (PciI=
o->Parent =3D=3D NULL); }
your code can call this helper function.<=
/p>
I was looking for anything that wouldn’t inclu=
de reading register but only thing that distinguish device PCI_IO_DEVICE in=
stances with root bridge instances is population of BusNumberRanges structu=
re.
This technically could be used since this is populat=
ed only for root bridges and not devices but using this would be just confu=
sing since there is no self-explanatory field there.
For my knowledge this is best way to tackle this iss=
ue. Please let me know if there are have some other worth exploring ideas.<=
o:p>
Damian
Extending PciBus to support such case is valid.=
But can you check if there is other pure software wa=
y to detect whether it’s an ECiEP?
Should we consider this workaround? I’m having=
issues interpreting this part of PCIe spec.
My understanding of this quote is that this capabili=
ty can exist in but it shouldn’t be considered.
I would assume it’s possible option that it ne=
eds to be considered? Is that wrong?
Damian
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.
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
Really sorry,
Could you help to provide more information on the be=
low statement?
“undefined parent register accesses”
Thanks in advance.
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=
p>
+ &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.
Intel =
Technology Poland sp. z o.o.
ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy G=
dańsk Północ | VII Wydział Gospodarczy Krajowego Rejest=
ru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakła=
dowy 200.000 PLN.
Ta wiadomość wraz z załącznikami jest przeznacz=
ona dla określonego adresata i może zawierać informacje pouf=
ne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiado=
mienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przegl=
1;danie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material f=
or the sole use of the intended recipient(s). If you are not the intended r=
ecipient, please contact the sender and delete all copies; any review or di=
stribution by others is strictly prohibited.
--_000_CO1PR11MB5187EAF96BD0D97678F77C728DA09CO1PR11MB5187namp_--