From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web08.1165.1630383898613493964 for ; Mon, 30 Aug 2021 21:24:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=phqzoTF0; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10092"; a="218442331" X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208,217";a="218442331" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 21:24:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208,217";a="600780880" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 30 Aug 2021 21:24:57 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 30 Aug 2021 21:24:56 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) 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.10; Mon, 30 Aug 2021 21:24:56 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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, 30 Aug 2021 21:24:56 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) 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.10; Mon, 30 Aug 2021 21:24:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hDW1lvlBlfxHL0Fixc57/K4bwZlnClQNbL7HAR9sAdYiH4gftTJ/vauLWQlpDMmOWWelnl6VJRTquXcx6AhvB0xYByjhS0toYxuFJyk0ovPd6YruCrhkAUXdqT021E00xHHt70KnCxPzYMGdpJEQn+OvRz8aSlwoCU/zad+xqhrPNnUjPeVGhFPl/W29kgJJZ3hOrTB/xZf8VvqKsRxcuwNodqKHaCY1cu9zSNyDEUShclftbmo3qfMY00dIIL+HZ97niqByKOvXbMbDFfI9YbM6PGSJbX/XZimvu20KJPsKFf553a5uZlSxRgVNSwqRu5HDnqZmVHOM6KTbEY5LZg== 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=uF5FFQNRrWAPEA7YFSEc8UBoVwe5U9ti4Ypr30DAHjA=; b=Znxzckc0zd0gxoqYcDFssJwAMwoUmSLl0pup6odvzqpsiA5+NYDMosVWgmCnqsdYeo3yXXjjMxlUZIYZD/4O6SchT1pIcu5IChunXkXDGKDSbOV87zw0ZTf4vmnh5JiX2n4AcLtaPVLU8SraHmZrXI6JH6/323UmVwZSH4k1+0OWR7/vPJjU6wBxG4exB4jlUlzLOkLxP3ctRJZNOOIISt3NR4i4XYsOOskS9P3YwytGDL+2yO/7M1TmPBVmMtYenpbj14N+6fVDBMrE/iJLamOCEcrzvVb1Ao0LxUq0ARO3q2ArjSl2Siqv1BgXE/cRctQi1laEGgq4sPLFz3txhA== 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=uF5FFQNRrWAPEA7YFSEc8UBoVwe5U9ti4Ypr30DAHjA=; b=phqzoTF00nnZjz2v002jVxirWnVIDT3TcWR6198R9jYJPkOCdBOPVnc8nxjMHN5yaj04uaePegOIsrhTrQGwV5H8HhS0+ggNCJoLIeLiHTiQ0V2SlCHqV0NCv+JlnRitgki0rK+nc+lu2L+o6SYKmzI7xk0mZhH6FgOgblJZ51s= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB1553.namprd11.prod.outlook.com (2603:10b6:405:e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.21; Tue, 31 Aug 2021 04:24:55 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b53d:daa8:fc6c:962e]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::b53d:daa8:fc6c:962e%7]) with mapi id 15.20.4478.017; Tue, 31 Aug 2021 04:24:55 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Bassa, Damian" Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP Thread-Topic: [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP Thread-Index: AdeY+paMpehWSOTWSAKEuG98y9jpqAFJPSag Date: Tue, 31 Aug 2021 04:24:55 +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: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 190f8d58-05a8-433c-e78c-08d96c3748e5 x-ms-traffictypediagnostic: BN6PR11MB1553: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wlm5L/bRGes0jU7saUs/Brcgj+9zTmZSlZP8l4NPAwar+HxxHq3LvGTQF0P51KBHHKmfmxnl/zCkZi/dnMa+dWh/oGCRSZGcoohWQdkesEZQBV1F3Iw5QXygqYl5pSXN03/sJtuIXyftl+TeAIGP7tsEj0pyxYc6orPT3AaiRxNRfhLeURL5RxyfmYAbbSwCCRD3dHoOOBq1FeBZ4GSavGJrHLxAjya6I8yA2MiBBUoayAacfiwpzRwBHPqqpwFnBrZbOMrWU1o3POiLa8BUMLIRtp06MuDXGhX5TTSAfTs28Gei1+NUbTMWjgGhqQyG661i0dBO3M0WBCgAH1mmuKsRTegRodAC6cxJBaHfhEcqJwic/2KB7UuctY3ghwD6qBT2R5ZOKK5C5t0xqM6OWcEwNle7BGtfTNyS80Uc68FTG0acmy1SeRh2/Ksb7o+IA2FRW+T8yJpea/Vc1h4oNLx/SssIJ7EQJYero86T04Y9uDi4ALJonoTSg1Zbs6qbgz7v0g818gCgcw+d7GEB9kJA0ntiKtFvZwtPuawVUhsyYabyJT5kkqbzJMXAxOCbXcK7w8JdlYk4bNgeIHgWF/uSwZyZKGeeS0J6mcieFnhdW/KJPM0xdJ0M+XYYrj13Jh5Mr6x/HU5/eA895s7XI5C6vasfmAhkkrqzM6luBrbaJfMxLNeCL4TyGfPNO+2n/xW7hve5wObKvEGRdAuluWXZVAX3fqN9v7+85PviTvPSmL0YipIUJ8PWn3Xk1xTPg9LbUFHSrj3luvjZ4CCWiNKDA09maaAA4LSnHwO9i97ln2GbU/b5/KDs5itrO/t4HDRHWrk4fQAXOj3KAWGqaQ== 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)(376002)(366004)(346002)(396003)(39860400002)(136003)(478600001)(38100700002)(76116006)(316002)(122000001)(66574015)(5660300002)(66446008)(64756008)(66476007)(66556008)(52536014)(6636002)(66946007)(71200400001)(8936002)(2906002)(186003)(83380400001)(33656002)(55016002)(9686003)(53546011)(8676002)(38070700005)(166002)(110136005)(76236003)(7696005)(26005)(86362001)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?Q?+mWqj1lTkAN8RSaPz6P+1e/bGOj/pRqJGVQxUPgQSCeHCwtLi+6QTfGjKN?= =?iso-8859-2?Q?LShIGH21WEcXNgcd4P/z6bjzT5JaapS6HiBig+Wae1+pf7wWKQHUS2/QGb?= =?iso-8859-2?Q?AJ7GOwMHNy+jDfypzzjp+PAZwlN6Yqcil+dSIXnEV2f49GalsN290UawDu?= =?iso-8859-2?Q?f7dfU9LNkMVclrqTiliJlrbUZ1cptcLUUGW5QDY+55mdv6Je6xQF8niCA4?= =?iso-8859-2?Q?2jkttfR1qHfkptnVLfgIMxwPuqyLSvVueDhHDOSwlKgprSzJtgiRAxfZOl?= =?iso-8859-2?Q?mzNnTYJ0tDPx6p/YVIq9RY+FgbP1aY/pbaTI41pEMyul3LGo0g57ZKnZqk?= =?iso-8859-2?Q?GxHkvN0PSnS90yhMDyiHotbce5d0wUuMju29wx10SINqkKQirDEu+Il+v4?= =?iso-8859-2?Q?eyLvSi4CIUuM7BfebjbKrfccqG+grZxOnXXxC69g/4CD2PdlMvF1I+Wx1k?= =?iso-8859-2?Q?BPNj5o6xTgyHOnFMiaFkM5KI7F9258JIvJZ9X+qyqgnUhitRdwg/8Dw2cp?= =?iso-8859-2?Q?q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uthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 190f8d58-05a8-433c-e78c-08d96c3748e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2021 04:24:55.0544 (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: 1r1EnEJAWrxnPevJ4n6Zg0DqVLKjPx2FGZ1zSy8mBxEyD/TbOAgq5eRUnxhcv7PYa5O4BfxDou7aWeA9qQNTBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1553 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN8PR11MB3666214D66E8EF96887B2D81CACC9BN8PR11MB3666namp_" --_000_BN8PR11MB3666214D66E8EF96887B2D81CACC9BN8PR11MB3666namp_ Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable 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, Damia= n 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_BN8PR11MB3666214D66E8EF96887B2D81CACC9BN8PR11MB3666namp_ Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable

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.gro= ups.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 Technology Poland s= p. z o.o.
ul. S=B3owackiego 173 | 80-298 Gda=F1sk | S= =B1d Rejonowy Gda=F1sk P=F3=B3noc | VII Wydzia=B3 Gospodarczy Krajowego Rej= estru 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 zawier= a=E6 informacje poufne. W razie przypadkowego otrzymania tej wiadomo=B6ci, prosimy o powiadomienie nadawcy oraz trwa=B3e jej usuni=EAci= e; jakiekolwiek przegl=B1danie 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_BN8PR11MB3666214D66E8EF96887B2D81CACC9BN8PR11MB3666namp_--