public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64.
@ 2021-01-04  9:48 Zhong, Zarcd
  2021-01-13  7:01 ` Ni, Ray
  0 siblings, 1 reply; 16+ messages in thread
From: Zhong, Zarcd @ 2021-01-04  9:48 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Ni, Ray, Wu, Hao A


[-- Attachment #1.1: Type: text/plain, Size: 482 bytes --]

>From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Sep 17 00:00:00 2001
From: Zarcd Zhong <zarcd.zhong@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@intel.com>
    Cc: Hao A Wu <hao.a.wu@intel.com>

[-- Attachment #1.2: Type: text/html, Size: 2526 bytes --]

[-- Attachment #2: 0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch --]
[-- Type: application/octet-stream, Size: 1482 bytes --]

From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Sep 17 00:00:00 2001
From: Zarcd Zhong <zarcd.zhong@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 aligment for low 32bit of MEM64 BAR if sizing fail in high 32bit.

    Cc: Ray Ni <ray.ni@intel.com>
    Cc: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 1b64924b7b..8a827be268 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1686,6 +1686,16 @@ PciIovParseVfBar (
                 );
 
       if (EFI_ERROR (Status)) {
+        //
+        // Reset length/alignment for low 32bit in MEM64 BAR if sizing fail in high 32bit.
+        //
+        PciIoDevice->VfPciBar[BarIndex].BaseAddress = 0;
+        PciIoDevice->VfPciBar[BarIndex].Length      = 0;
+        PciIoDevice->VfPciBar[BarIndex].Alignment   = 0;
+        //
+        // Decrement the offset to lower 32bit of MEM64 BAR.
+        //
+        PciIoDevice->VfPciBar[BarIndex].Offset = (UINT16) (Offset - 4);
         return Offset + 4;
       }
 
-- 
2.16.2.windows.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-01-18  1:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3149>
2021-01-15  9:34 ` [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64 nmd5434
2021-01-15  9:39   ` Zhong, Zarcd
2021-01-18  1:12   ` [edk2-devel] " Wu, Hao A
2021-01-18  1:44     ` Wu, Hao A
2021-01-04  9:48 Zhong, Zarcd
2021-01-13  7:01 ` Ni, Ray
2021-01-14  2:47   ` Zhong, Zarcd
2021-01-14  5:58     ` Ni, Ray
2021-01-14  6:31       ` Zhong, Zarcd
2021-01-14 17:37         ` Kim, Andrew
2021-01-14 18:13           ` Kim, Andrew
2021-01-15  7:52             ` Kim, Andrew
2021-01-15  8:10               ` Zhong, Zarcd
2021-01-15  8:11                 ` Ni, Ray
2021-01-15  8:30                   ` Zhong, Zarcd
2021-01-15  8:36                     ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox