<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Yu Gothic";
        panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@Yu Gothic";
        panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 6 6 2 2 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">It refers to access to the root port device that doesn’t exist in case we are dealing with RCiEP device.
<o:p></o:p></p>
<p class="MsoNormal">There can be specific case where RCiEP device has ARI extended capability ID (even though it’s unsupported in this case).
<o:p></o:p></p>
<p class="MsoNormal">In such a case PciSearchDevice goes to CreatePciIoDevice through GatherDeviceInfo. And in this case parent is PCI_IO_DEVICE instance 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 read operation using default 0 bus number, which isn’t correct.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Damian<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Wu, Hao A <hao.a.wu@intel.com> <br>
<b>Sent:</b> Tuesday, August 31, 2021 6:28 AM<br>
<b>To:</b> devel@edk2.groups.io; Wu, Hao A <hao.a.wu@intel.com>; Bassa, Damian <damian.bassa@intel.com>; Ni, Ray <ray.ni@intel.com><br>
<b>Subject:</b> RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>>
<b>On Behalf Of </b>Wu, Hao A<br>
<b>Sent:</b> Tuesday, August 31, 2021 12:25 PM<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; Bassa, Damian <<a href="mailto:damian.bassa@intel.com">damian.bassa@intel.com</a>><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Really sorry,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Could you help to provide more information on the below statement?<o:p></o:p></p>
<p class="MsoNormal">“undefined parent register accesses”<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks in advance.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Best Regards,<o:p></o:p></p>
<p class="MsoNormal">Hao Wu<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>>
<b>On Behalf Of </b>Bassa, Damian<br>
<b>Sent:</b> Tuesday, August 24, 2021 11:15 PM<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Subject:</b> [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Before trying to access parent root port to check ARI capabilities,<o:p></o:p></p>
<p class="MsoNormal">enumerator should see if Endpoint device is not Root Complex integrated<o:p></o:p></p>
<p class="MsoNormal">to avoid undefined parent register accesses in these cases.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Signed-off-by: Damian Bassa <a href="mailto:damian.bassa@intel.com">
damian.bassa@intel.com</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">---<o:p></o:p></p>
<p class="MsoNormal">.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c         | 12 +++++++++++-<o:p></o:p></p>
<p class="MsoNormal">1 file changed, 11 insertions(+), 1 deletion(-)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c<o:p></o:p></p>
<p class="MsoNormal">index db1b35f8ef..6451fb8af9 100644<o:p></o:p></p>
<p class="MsoNormal">--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c<o:p></o:p></p>
<p class="MsoNormal">+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c<o:p></o:p></p>
<p class="MsoNormal">@@ -2153,6 +2153,7 @@ CreatePciIoDevice (<o:p></o:p></p>
<p class="MsoNormal">   PCI_IO_DEVICE        *PciIoDevice;<o:p></o:p></p>
<p class="MsoNormal">   EFI_PCI_IO_PROTOCOL  *PciIo;<o:p></o:p></p>
<p class="MsoNormal">   EFI_STATUS           Status;<o:p></o:p></p>
<p class="MsoNormal">+  PCI_REG_PCIE_CAPABILITY Capability;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">   PciIoDevice = AllocateZeroPool (sizeof (PCI_IO_DEVICE));<o:p></o:p></p>
<p class="MsoNormal">   if (PciIoDevice == NULL) {<o:p></o:p></p>
<p class="MsoNormal">@@ -2229,7 +2230,16 @@ CreatePciIoDevice (<o:p></o:p></p>
<p class="MsoNormal">     return NULL;<o:p></o:p></p>
<p class="MsoNormal">   }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-  if (PcdGetBool (PcdAriSupport)) {<o:p></o:p></p>
<p class="MsoNormal">+  PciIo->Pci.Read (<o:p></o:p></p>
<p class="MsoNormal">+                PciIo,<o:p></o:p></p>
<p class="MsoNormal">+                EfiPciIoWidthUint16,<o:p></o:p></p>
<p class="MsoNormal">+                PciIoDevice->PciExpressCapabilityOffset + OFFSET_OF (PCI_CAPABILITY_PCIEXP, Capability),<o:p></o:p></p>
<p class="MsoNormal">+                1,<o:p></o:p></p>
<p class="MsoNormal">+                &Capability.Uint16<o:p></o:p></p>
<p class="MsoNormal">+                );<o:p></o:p></p>
<p class="MsoNormal">+<o:p></o:p></p>
<p class="MsoNormal">+  if (PcdGetBool (PcdAriSupport) &&<o:p></o:p></p>
<p class="MsoNormal">+    Capability.Bits.DevicePortType != PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT) {<o:p></o:p></p>
<p class="MsoNormal">     //<o:p></o:p></p>
<p class="MsoNormal">     // Check if the device is an ARI device.<o:p></o:p></p>
<p class="MsoNormal">     //<o:p></o:p></p>
<p class="MsoNormal">-- <o:p></o:p></p>
<p class="MsoNormal">2.27.0.windows.1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal"><strong><span lang="PL" style="font-size:9.0pt;font-family:"Arial Narrow",sans-serif;color:#595959">Intel Technology Poland sp. z o.o.</span></strong><b><span lang="PL" style="font-size:9.0pt;font-family:"Arial Narrow",sans-serif;color:#595959"><br>
</span></b><span lang="PL" style="font-size:9.0pt;font-family:"Arial Narrow",sans-serif;color:#595959">ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego - KRS 101882 | NIP 957-07-52-316 |
 Kapitał zakładowy 200.000 PLN. </span><span lang="PL"><o:p></o:p></span></p>
<p><span lang="PL" style="font-size:8.0pt;font-family:"Arial Narrow",sans-serif;color:#595959;mso-fareast-language:EN-US">Ta wiadomość wraz z załącznikami jest przeznaczona dla określonego adresata i może zawierać informacje poufne. W razie przypadkowego otrzymania
 tej wiadomości, prosimy o powiadomienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub rozpowszechnianie jest zabronione.<br>
</span><span style="font-size:8.0pt;font-family:"Arial Narrow",sans-serif;color:#595959;mso-fareast-language:EN-US">This e-mail and any attachments may contain confidential material for the sole use of the intended 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.
</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"></o:p></span></p>
</div>
</div>
<p>
    <hr/>
    <strong style="line-height: 11.25pt;">
        <span style="font-size: 9pt; color: #595959;">
            <span style="font-family: 'Arial Narrow', sans-serif;">Intel Technology Poland sp. z o.o.<br>
            </span>
        </span>
    </strong>
    <span style="color:#595959; font-family: 'Arial Narrow', sans-serif; font-size: 9pt; line-height: 11.25pt;">
        ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakładowy 200.000 PLN.
    </span>
</p>
<p>
    <span style="font-size:8.0pt;  font-family:'Arial Narrow',sans-serif; mso-fareast-font-family: 'Times New Roman';mso-bidi-font-family:Arial; color:#595959; mso-ansi-language:EN-US; mso-fareast-language:EN-US; mso-bidi-language: PL-PL">
        Ta wiadomość wraz z załącznikami jest przeznaczona dla określonego adresata i może zawierać informacje poufne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiadomienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub rozpowszechnianie jest zabronione.<br>
        This e-mail and any attachments may contain confidential material for the sole use of the intended 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.
    </span>
</p>
<p class="MsoNormal"><o:p></o:p></p>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/80021">View/Reply Online (#80021)</a> |    |  <a target="_blank" href="https://groups.io/mt/85113393/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>