<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle20
        {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.25in 1.0in 1.25in;}
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">
<div class="WordSection1">
<p class="MsoNormal">Hi Kim,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ray suggests  a one line patch instead of google’s solution.<o:p></o:p></p>
<p class="MsoNormal">+        PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Could you help to verify Ray’s solution on that card?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><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> Ni, Ray <ray.ni@intel.com> <br>
<b>Sent:</b> Thursday, January 14, 2021 1:59 PM<br>
<b>To:</b> Zhong, Zarcd <zarcd.zhong@intel.com>; devel@edk2.groups.io<br>
<b>Cc:</b> Wu, Hao A <hao.a.wu@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com><br>
<b>Subject:</b> RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Zarcd,<o:p></o:p></p>
<p class="MsoNormal">I may not say very clearly. I prefer to just keep below line. Can you check whether that can work?<o:p></o:p></p>
<p class="MsoNormal">+        PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<br>
Ray<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Zhong, Zarcd <<a href="mailto:zarcd.zhong@intel.com">zarcd.zhong@intel.com</a>>
<br>
<b>Sent:</b> Thursday, January 14, 2021 10:48 AM<br>
<b>To:</b> Ni, Ray <<a href="mailto:ray.ni@intel.com">ray.ni@intel.com</a>>; <a href="mailto:devel@edk2.groups.io">
devel@edk2.groups.io</a><br>
<b>Cc:</b> Wu, Hao A <<a href="mailto:hao.a.wu@intel.com">hao.a.wu@intel.com</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>><br>
<b>Subject:</b> RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Ray,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Attached patch is updated with below add. Thanks for your remind.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;<o:p></o:p></p>
<p class="MsoNormal"><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> Ni, Ray <<a href="mailto:ray.ni@intel.com">ray.ni@intel.com</a>>
<br>
<b>Sent:</b> Wednesday, January 13, 2021 3:01 PM<br>
<b>To:</b> Zhong, Zarcd <<a href="mailto:zarcd.zhong@intel.com">zarcd.zhong@intel.com</a>>;
<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc:</b> Wu, Hao A <<a href="mailto:hao.a.wu@intel.com">hao.a.wu@intel.com</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>><br>
<b>Subject:</b> RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Zarcd,<o:p></o:p></p>
<p class="MsoNormal">I can understand that this patch is needed for some buggy pci devices whose<br>
VF bar behaves strangely. Incompatible PCI protocol can only deal with normal<br>
PCI bar. And this patch is just to enhance the error handling logic.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can you please use below code for error handling?<o:p></o:p></p>
<p class="MsoNormal">+        PciIoDevice->VfPciBar[BarIndex].BarType     = PciBarTypeUnknown<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I understand that your change is aligned to existing error handling in the beginning<br>
of PciIovParseVfBar().<o:p></o:p></p>
<p class="MsoNormal">But that logic runs before PciIoDevice->VfPciBar[BarIndex].BarType is assigned.<o:p></o:p></p>
<p class="MsoNormal">The key is to reset the BarType to PciBarTypeUnknown so that the resource summary<br>
code doesn’t count this bar.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Ray<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Zhong, Zarcd <<a href="mailto:zarcd.zhong@intel.com">zarcd.zhong@intel.com</a>>
<br>
<b>Sent:</b> Monday, January 4, 2021 5:48 PM<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc:</b> Ni, Ray <<a href="mailto:ray.ni@intel.com">ray.ni@intel.com</a>>; Wu, Hao A <<a href="mailto:hao.a.wu@intel.com">hao.a.wu@intel.com</a>><br>
<b>Subject:</b> [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Sep 17 00:00:00 2001<o:p></o:p></p>
<p class="MsoNormal">From: Zarcd Zhong <<a href="mailto:zarcd.zhong@intel.com">zarcd.zhong@intel.com</a>><o:p></o:p></p>
<p class="MsoNormal">Date: Mon, 4 Jan 2021 17:32:54 +0800<o:p></o:p></p>
<p class="MsoNormal">Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    REF: <a href="https://bugzilla.tianocore.org/show_bug.cgi?id=3149">
https://bugzilla.tianocore.org/show_bug.cgi?id=3149</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    Clear length and alignment for low 32bit of MEM64 BAR if sizing fail in high 32bit.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    Cc: Ray Ni <<a href="mailto:ray.ni@intel.com">ray.ni@intel.com</a>><o:p></o:p></p>
<p class="MsoNormal">    Cc: Hao A Wu <<a href="mailto:hao.a.wu@intel.com">hao.a.wu@intel.com</a>><o:p></o:p></p>
</div>
</div>
</div>
</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/70324">View/Reply Online (#70324)</a> |    |  <a target="_blank" href="https://groups.io/mt/79438989/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>