[edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Zhong, Zarcd zarcd.zhong at intel.com
Fri Jan 15 08:30:02 UTC 2021


Hi Hao,

Please help to review this patch and push it to open source EDKii. Thanks

From: Ni, Ray <ray.ni at intel.com>
Sent: Friday, January 15, 2021 4:12 PM
To: Zhong, Zarcd <zarcd.zhong at intel.com>
Cc: Wu, Hao A <hao.a.wu at intel.com>; Kinney, Michael D <michael.d.kinney at intel.com>; devel at edk2.groups.io; Kim, Andrew <andrew.kim at intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Reviewed-by: Ray Ni <ray.ni at intel.com<mailto:ray.ni at intel.com>>

From: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Sent: Friday, January 15, 2021 4:11 PM
To: Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>; Kim, Andrew <andrew.kim at intel.com<mailto:andrew.kim at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Hi Ray,

  Your suggestion for one line patch test PASS.

Attached file is the patch. Please help to review.

From: Kim, Andrew <andrew.kim at intel.com<mailto:andrew.kim at intel.com>>
Sent: Friday, January 15, 2021 3:53 PM
To: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>; Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Hi Zarcd,

It works fine with this Ray's solution. Customer confirmed it.

-Andrew

From: Kim, Andrew
Sent: Thursday, January 14, 2021 10:14 AM
To: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>; Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

BTW, to be clear for this to try.
Could you confirm if this is right update with your suggestion?


      if (EFI_ERROR (Status)) {
        PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;

        return Offset + 4;
      }


-Andrew

From: Kim, Andrew
Sent: Thursday, January 14, 2021 9:38 AM
To: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>; Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Hi Zarcd,

Thanks for this update.

Sure, I will let you know once it has been verified.

-Andrew

From: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Sent: Wednesday, January 13, 2021 10:32 PM
To: Kim, Andrew <andrew.kim at intel.com<mailto:andrew.kim at intel.com>>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>; Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Hi Kim,

Ray suggests  a one line patch instead of google's solution.
+        PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;

Could you help to verify Ray's solution on that card?




From: Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Sent: Thursday, January 14, 2021 1:59 PM
To: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Zarcd,
I may not say very clearly. I prefer to just keep below line. Can you check whether that can work?
+        PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;

Thanks,
Ray

From: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Sent: Thursday, January 14, 2021 10:48 AM
To: Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Hi Ray,

Attached patch is updated with below add. Thanks for your remind.

PciIoDevice->VfPciBar[BarIndex].BarType = PciBarTypeUnknown;


From: Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>
Sent: Wednesday, January 13, 2021 3:01 PM
To: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>; devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

Zarcd,
I can understand that this patch is needed for some buggy pci devices whose
VF bar behaves strangely. Incompatible PCI protocol can only deal with normal
PCI bar. And this patch is just to enhance the error handling logic.

Can you please use below code for error handling?
+        PciIoDevice->VfPciBar[BarIndex].BarType     = PciBarTypeUnknown

I understand that your change is aligned to existing error handling in the beginning
of PciIovParseVfBar().
But that logic runs before PciIoDevice->VfPciBar[BarIndex].BarType is assigned.
The key is to reset the BarType to PciBarTypeUnknown so that the resource summary
code doesn't count this bar.

Thanks,
Ray

From: Zhong, Zarcd <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Sent: Monday, January 4, 2021 5:48 PM
To: devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Cc: Ni, Ray <ray.ni at intel.com<mailto:ray.ni at intel.com>>; Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>
Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

>From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Sep 17 00:00:00 2001
From: Zarcd Zhong <zarcd.zhong at intel.com<mailto:zarcd.zhong at intel.com>>
Date: Mon, 4 Jan 2021 17:32:54 +0800
Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.

    REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3149

    Clear length and alignment for low 32bit of MEM64 BAR if sizing fail in high 32bit.

    Cc: Ray Ni <ray.ni at intel.com<mailto:ray.ni at intel.com>>
    Cc: Hao A Wu <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70409): https://edk2.groups.io/g/devel/message/70409
Mute This Topic: https://groups.io/mt/79438989/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20210115/c0de8d67/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch
Type: application/octet-stream
Size: 1062 bytes
Desc: 0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20210115/c0de8d67/attachment.obj>


More information about the edk2-devel-archive mailing list