public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io
Cc: "Andrew Fish" <afish@apple.com>,
	"Ard Biesheuvel" <ardb+tianocore@kernel.org>,
	"Jordan Justen" <jordan.l.justen@intel.com>,
	"Leif Lindholm" <leif@nuviainc.com>,
	"Michael D Kinney" <michael.d.kinney@intel.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 32/43] OvmfPkg/PciHostBridgeLib: remove Bhyve and Xen support
Date: Wed, 26 May 2021 22:14:35 +0200	[thread overview]
Message-ID: <20210526201446.12554-33-lersek@redhat.com> (raw)
In-Reply-To: <20210526201446.12554-1-lersek@redhat.com>

The "OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf" instance is
used by the following platforms in edk2:

  OvmfPkg/AmdSev/AmdSevX64.dsc
  OvmfPkg/OvmfPkgIa32.dsc
  OvmfPkg/OvmfPkgIa32X64.dsc
  OvmfPkg/OvmfPkgX64.dsc

All these platforms statically inherit PcdPciDisableBusEnumeration=FALSE
from "MdeModulePkg.dec". Remove the the PCD and everything that depends on
it from the PciHostBridgeLib instance. Namely, remove the logic that
determines the root bridge apertures by (a) scanning the entire bus,
device and function number space, and (b) parsing the BAR values that were
pre-set by the Bhyve or Xen machinery.

"XenSupport.c" used to be listed explicitly in "Maintainers.txt", remove
it from that spot too.

Cc: Andrew Fish <afish@apple.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf |   7 -
 Maintainers.txt                                       |   1 -
 OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h      |  13 -
 OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c   |   6 -
 OvmfPkg/Library/PciHostBridgeLib/XenSupport.c         | 471 --------------------
 5 files changed, 498 deletions(-)

diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
index 622780888472..f9f182557453 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
@@ -22,32 +22,25 @@ [Defines]
 # tools.
 #
 #  VALID_ARCHITECTURES           = IA32 X64 EBC
 #
 
 [Sources]
-  PciHostBridge.h
   PciHostBridgeLib.c
-  XenSupport.c
 
 [Packages]
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
 
 [LibraryClasses]
-  BaseLib
   BaseMemoryLib
-  DebugLib
-  MemoryAllocationLib
   PcdLib
   PciHostBridgeUtilityLib
-  PciLib
 
 [Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base
diff --git a/Maintainers.txt b/Maintainers.txt
index a273409a923f..e5f419e67f0c 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -490,13 +490,12 @@ F: OvmfPkg/Include/Guid/XenInfo.h
 F: OvmfPkg/Include/IndustryStandard/Xen/
 F: OvmfPkg/Include/Library/XenHypercallLib.h
 F: OvmfPkg/Include/Library/XenIoMmioLib.h
 F: OvmfPkg/Include/Library/XenPlatformLib.h
 F: OvmfPkg/Include/Protocol/XenBus.h
 F: OvmfPkg/Include/Protocol/XenIo.h
-F: OvmfPkg/Library/PciHostBridgeLib/XenSupport.c
 F: OvmfPkg/Library/PciHostBridgeLibScan/
 F: OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
 F: OvmfPkg/Library/XenConsoleSerialPortLib/
 F: OvmfPkg/Library/XenHypercallLib/
 F: OvmfPkg/Library/XenIoMmioLib/
 F: OvmfPkg/Library/XenPlatformLib/
diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h
deleted file mode 100644
index a2e4d8696281..000000000000
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridge.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/** @file
-  Header file of OVMF instance of PciHostBridgeLib.
-
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-PCI_ROOT_BRIDGE *
-ScanForRootBridges (
-  UINTN      *NumberOfRootBridges
-);
diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 6db91fb7e20c..835efffccaf5 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -13,14 +13,12 @@
 #include <Library/PcdLib.h>                           // PcdGet64()
 #include <Library/PciHostBridgeLib.h>                 // PCI_ROOT_BRIDGE_APE...
 #include <Library/PciHostBridgeUtilityLib.h>          // PciHostBridgeUtilit...
 #include <Protocol/PciHostBridgeResourceAllocation.h> // EFI_PCI_HOST_BRIDGE...
 #include <Protocol/PciRootBridgeIo.h>                 // EFI_PCI_ATTRIBUTE_I...
 
-#include "PciHostBridge.h"
-
 STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture = { MAX_UINT64, 0 };
 
 
 /**
   Return all the root bridge instances in an array.
 
@@ -39,16 +37,12 @@ PciHostBridgeGetRootBridges (
   UINT64               Attributes;
   UINT64               AllocationAttributes;
   PCI_ROOT_BRIDGE_APERTURE Io;
   PCI_ROOT_BRIDGE_APERTURE Mem;
   PCI_ROOT_BRIDGE_APERTURE MemAbove4G;
 
-  if (PcdGetBool (PcdPciDisableBusEnumeration)) {
-    return ScanForRootBridges (Count);
-  }
-
   ZeroMem (&Io, sizeof (Io));
   ZeroMem (&Mem, sizeof (Mem));
   ZeroMem (&MemAbove4G, sizeof (MemAbove4G));
 
   Attributes = EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO |
     EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO |
diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c
deleted file mode 100644
index 07c498dd0ea2..000000000000
--- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/** @file
-  Scan the entire PCI bus for root bridges to support OVMF above Xen.
-
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <IndustryStandard/Pci.h>            // EFI_PCI_COMMAND_IO_SPACE
-#include <IndustryStandard/Q35MchIch9.h>     // INTEL_Q35_MCH_DEVICE_ID
-#include <Library/BaseLib.h>                 // DisableInterrupts()
-#include <Library/BaseMemoryLib.h>           // ZeroMem()
-#include <Library/DebugLib.h>                // ASSERT()
-#include <Library/MemoryAllocationLib.h>     // ReallocatePool()
-#include <Library/PcdLib.h>                  // PcdGet16()
-#include <Library/PciHostBridgeLib.h>        // PCI_ROOT_BRIDGE_APERTURE
-#include <Library/PciHostBridgeUtilityLib.h> // PciHostBridgeUtilityInitRoot...
-#include <Library/PciLib.h>                  // PciRead32()
-#include <Protocol/PciRootBridgeIo.h>        // EFI_PCI_ATTRIBUTE_ISA_IO
-
-#include "PciHostBridge.h"
-
-STATIC
-VOID
-PcatPciRootBridgeBarExisted (
-  IN  UINTN                          Address,
-  OUT UINT32                         *OriginalValue,
-  OUT UINT32                         *Value
-  )
-{
-  //
-  // Preserve the original value
-  //
-  *OriginalValue = PciRead32 (Address);
-
-  //
-  // Disable timer interrupt while the BAR is probed
-  //
-  DisableInterrupts ();
-
-  PciWrite32 (Address, 0xFFFFFFFF);
-  *Value = PciRead32 (Address);
-  PciWrite32 (Address, *OriginalValue);
-
-  //
-  // Enable interrupt
-  //
-  EnableInterrupts ();
-}
-
-#define PCI_COMMAND_DECODE ((UINT16)(EFI_PCI_COMMAND_IO_SPACE | \
-                                     EFI_PCI_COMMAND_MEMORY_SPACE))
-STATIC
-VOID
-PcatPciRootBridgeDecodingDisable (
-  IN  UINTN                          Address
-  )
-{
-  UINT16                             Value;
-
-  Value = PciRead16 (Address);
-  if (Value & PCI_COMMAND_DECODE) {
-    PciWrite16 (Address, Value & ~(UINT32)PCI_COMMAND_DECODE);
-  }
-}
-
-STATIC
-VOID
-PcatPciRootBridgeParseBars (
-  IN UINT16                         Command,
-  IN UINTN                          Bus,
-  IN UINTN                          Device,
-  IN UINTN                          Function,
-  IN UINTN                          BarOffsetBase,
-  IN UINTN                          BarOffsetEnd,
-  IN PCI_ROOT_BRIDGE_APERTURE       *Io,
-  IN PCI_ROOT_BRIDGE_APERTURE       *Mem,
-  IN PCI_ROOT_BRIDGE_APERTURE       *MemAbove4G
-
-)
-{
-  UINT32                            OriginalValue;
-  UINT32                            Value;
-  UINT32                            OriginalUpperValue;
-  UINT32                            UpperValue;
-  UINT64                            Mask;
-  UINTN                             Offset;
-  UINT64                            Base;
-  UINT64                            Length;
-  UINT64                            Limit;
-  PCI_ROOT_BRIDGE_APERTURE          *MemAperture;
-
-  // Disable address decoding for every device before OVMF starts sizing it
-  PcatPciRootBridgeDecodingDisable (
-    PCI_LIB_ADDRESS (Bus, Device, Function, PCI_COMMAND_OFFSET)
-  );
-
-  for (Offset = BarOffsetBase; Offset < BarOffsetEnd; Offset += sizeof (UINT32)) {
-    PcatPciRootBridgeBarExisted (
-      PCI_LIB_ADDRESS (Bus, Device, Function, Offset),
-      &OriginalValue, &Value
-    );
-    if (Value == 0) {
-      continue;
-    }
-    if ((Value & BIT0) == BIT0) {
-      //
-      // IO Bar
-      //
-      if (Command & EFI_PCI_COMMAND_IO_SPACE) {
-        Mask = 0xfffffffc;
-        Base = OriginalValue & Mask;
-        Length = ((~(Value & Mask)) & Mask) + 0x04;
-        if (!(Value & 0xFFFF0000)) {
-          Length &= 0x0000FFFF;
-        }
-        Limit = Base + Length - 1;
-
-        if (Base < Limit) {
-          if (Io->Base > Base) {
-            Io->Base = Base;
-          }
-          if (Io->Limit < Limit) {
-            Io->Limit = Limit;
-          }
-        }
-      }
-    } else {
-      //
-      // Mem Bar
-      //
-      if (Command & EFI_PCI_COMMAND_MEMORY_SPACE) {
-
-        Mask = 0xfffffff0;
-        Base = OriginalValue & Mask;
-        Length = Value & Mask;
-
-        if ((Value & (BIT1 | BIT2)) == 0) {
-          //
-          // 32bit
-          //
-          Length = ((~Length) + 1) & 0xffffffff;
-
-          MemAperture = Mem;
-        } else {
-          //
-          // 64bit
-          //
-          Offset += 4;
-          PcatPciRootBridgeBarExisted (
-            PCI_LIB_ADDRESS (Bus, Device, Function, Offset),
-            &OriginalUpperValue,
-            &UpperValue
-          );
-
-          Base = Base | LShiftU64 ((UINT64) OriginalUpperValue, 32);
-          Length = Length | LShiftU64 ((UINT64) UpperValue, 32);
-          Length = (~Length) + 1;
-
-          if (Base < BASE_4GB) {
-            MemAperture = Mem;
-          } else {
-            MemAperture = MemAbove4G;
-          }
-        }
-
-        Limit = Base + Length - 1;
-        if (Base < Limit) {
-          if (MemAperture->Base > Base) {
-            MemAperture->Base = Base;
-          }
-          if (MemAperture->Limit < Limit) {
-            MemAperture->Limit = Limit;
-          }
-        }
-      }
-    }
-  }
-}
-
-STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture = { MAX_UINT64, 0 };
-
-PCI_ROOT_BRIDGE *
-ScanForRootBridges (
-  UINTN      *NumberOfRootBridges
-  )
-{
-  UINTN      PrimaryBus;
-  UINTN      SubBus;
-  UINT8      Device;
-  UINT8      Function;
-  UINTN      NumberOfDevices;
-  UINTN      Address;
-  PCI_TYPE01 Pci;
-  UINT64     Attributes;
-  UINT64     Base;
-  UINT64     Limit;
-  UINT64     Value;
-  PCI_ROOT_BRIDGE_APERTURE Io, Mem, MemAbove4G, *MemAperture;
-  PCI_ROOT_BRIDGE *RootBridges;
-  UINTN      BarOffsetEnd;
-
-
-  *NumberOfRootBridges = 0;
-  RootBridges = NULL;
-
-  //
-  // After scanning all the PCI devices on the PCI root bridge's primary bus,
-  // update the Primary Bus Number for the next PCI root bridge to be this PCI
-  // root bridge's subordinate bus number + 1.
-  //
-  for (PrimaryBus = 0; PrimaryBus <= PCI_MAX_BUS; PrimaryBus = SubBus + 1) {
-    SubBus = PrimaryBus;
-    Attributes = 0;
-
-    ZeroMem (&Io, sizeof (Io));
-    ZeroMem (&Mem, sizeof (Mem));
-    ZeroMem (&MemAbove4G, sizeof (MemAbove4G));
-    Io.Base = Mem.Base = MemAbove4G.Base = MAX_UINT64;
-    //
-    // Scan all the PCI devices on the primary bus of the PCI root bridge
-    //
-    for (Device = 0, NumberOfDevices = 0; Device <= PCI_MAX_DEVICE; Device++) {
-
-      for (Function = 0; Function <= PCI_MAX_FUNC; Function++) {
-
-        //
-        // Compute the PCI configuration address of the PCI device to probe
-        //
-        Address = PCI_LIB_ADDRESS (PrimaryBus, Device, Function, 0);
-
-        //
-        // Read the Vendor ID from the PCI Configuration Header
-        //
-        if (PciRead16 (Address) == MAX_UINT16) {
-          if (Function == 0) {
-            //
-            // If the PCI Configuration Read fails, or a PCI device does not
-            // exist, then skip this entire PCI device
-            //
-            break;
-          } else {
-            //
-            // If PCI function != 0, VendorId == 0xFFFF, we continue to search
-            // PCI function.
-            //
-            continue;
-          }
-        }
-
-        //
-        // Read the entire PCI Configuration Header
-        //
-        PciReadBuffer (Address, sizeof (Pci), &Pci);
-
-        //
-        // Increment the number of PCI device found on the primary bus of the
-        // PCI root bridge
-        //
-        NumberOfDevices++;
-
-        //
-        // Look for devices with the VGA Palette Snoop enabled in the COMMAND
-        // register of the PCI Config Header
-        //
-        if ((Pci.Hdr.Command & EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) != 0) {
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO;
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16;
-        }
-
-        BarOffsetEnd = 0;
-
-        //
-        // PCI-PCI Bridge
-        //
-        if (IS_PCI_BRIDGE (&Pci)) {
-          //
-          // Get the Bus range that the PPB is decoding
-          //
-          if (Pci.Bridge.SubordinateBus > SubBus) {
-            //
-            // If the subordinate bus number of the PCI-PCI bridge is greater
-            // than the PCI root bridge's current subordinate bus number,
-            // then update the PCI root bridge's subordinate bus number
-            //
-            SubBus = Pci.Bridge.SubordinateBus;
-          }
-
-          //
-          // Get the I/O range that the PPB is decoding
-          //
-          Value = Pci.Bridge.IoBase & 0x0f;
-          Base = ((UINT32) Pci.Bridge.IoBase & 0xf0) << 8;
-          Limit = (((UINT32) Pci.Bridge.IoLimit & 0xf0) << 8) | 0x0fff;
-          if (Value == BIT0) {
-            Base |= ((UINT32) Pci.Bridge.IoBaseUpper16 << 16);
-            Limit |= ((UINT32) Pci.Bridge.IoLimitUpper16 << 16);
-          }
-          if (Base < Limit) {
-            if (Io.Base > Base) {
-              Io.Base = Base;
-            }
-            if (Io.Limit < Limit) {
-              Io.Limit = Limit;
-            }
-          }
-
-          //
-          // Get the Memory range that the PPB is decoding
-          //
-          Base = ((UINT32) Pci.Bridge.MemoryBase & 0xfff0) << 16;
-          Limit = (((UINT32) Pci.Bridge.MemoryLimit & 0xfff0) << 16) | 0xfffff;
-          if (Base < Limit) {
-            if (Mem.Base > Base) {
-              Mem.Base = Base;
-            }
-            if (Mem.Limit < Limit) {
-              Mem.Limit = Limit;
-            }
-          }
-
-          //
-          // Get the Prefetchable Memory range that the PPB is decoding
-          // and merge it into Memory range
-          //
-          Value = Pci.Bridge.PrefetchableMemoryBase & 0x0f;
-          Base = ((UINT32) Pci.Bridge.PrefetchableMemoryBase & 0xfff0) << 16;
-          Limit = (((UINT32) Pci.Bridge.PrefetchableMemoryLimit & 0xfff0)
-                   << 16) | 0xfffff;
-          MemAperture = &Mem;
-          if (Value == BIT0) {
-            Base |= LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32);
-            Limit |= LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32);
-            MemAperture = &MemAbove4G;
-          }
-          if (Base < Limit) {
-            if (MemAperture->Base > Base) {
-              MemAperture->Base = Base;
-            }
-            if (MemAperture->Limit < Limit) {
-              MemAperture->Limit = Limit;
-            }
-          }
-
-          //
-          // Look at the PPB Configuration for legacy decoding attributes
-          //
-          if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_ISA)
-              == EFI_PCI_BRIDGE_CONTROL_ISA) {
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_IO;
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_IO_16;
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO;
-          }
-          if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA)
-              == EFI_PCI_BRIDGE_CONTROL_VGA) {
-            Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO;
-            Attributes |= EFI_PCI_ATTRIBUTE_VGA_MEMORY;
-            Attributes |= EFI_PCI_ATTRIBUTE_VGA_IO;
-            if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA_16)
-                != 0) {
-              Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16;
-              Attributes |= EFI_PCI_ATTRIBUTE_VGA_IO_16;
-            }
-          }
-
-          BarOffsetEnd = OFFSET_OF (PCI_TYPE01, Bridge.Bar[2]);
-        } else {
-          //
-          // Parse the BARs of the PCI device to get what I/O Ranges, Memory
-          // Ranges, and Prefetchable Memory Ranges the device is decoding
-          //
-          if ((Pci.Hdr.HeaderType & HEADER_LAYOUT_CODE) == HEADER_TYPE_DEVICE) {
-            BarOffsetEnd = OFFSET_OF (PCI_TYPE00, Device.Bar[6]);
-          }
-        }
-
-        PcatPciRootBridgeParseBars (
-          Pci.Hdr.Command,
-          PrimaryBus,
-          Device,
-          Function,
-          OFFSET_OF (PCI_TYPE00, Device.Bar),
-          BarOffsetEnd,
-          &Io,
-          &Mem, &MemAbove4G
-        );
-
-        //
-        // See if the PCI device is an IDE controller
-        //
-        if (IS_CLASS2 (&Pci, PCI_CLASS_MASS_STORAGE,
-                       PCI_CLASS_MASS_STORAGE_IDE)) {
-          if (Pci.Hdr.ClassCode[0] & 0x80) {
-            Attributes |= EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO;
-            Attributes |= EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO;
-          }
-          if (Pci.Hdr.ClassCode[0] & 0x01) {
-            Attributes |= EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO;
-          }
-          if (Pci.Hdr.ClassCode[0] & 0x04) {
-            Attributes |= EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO;
-          }
-        }
-
-        //
-        // See if the PCI device is a legacy VGA controller or
-        // a standard VGA controller
-        //
-        if (IS_CLASS2 (&Pci, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA) ||
-            IS_CLASS2 (&Pci, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA)
-            ) {
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO;
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16;
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_MEMORY;
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_IO;
-          Attributes |= EFI_PCI_ATTRIBUTE_VGA_IO_16;
-        }
-
-        //
-        // See if the PCI Device is a PCI - ISA or PCI - EISA
-        // or ISA_POSITIVE_DECODE Bridge device
-        //
-        if (Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) {
-          if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA ||
-              Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_EISA ||
-              Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE) {
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_IO;
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_IO_16;
-            Attributes |= EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO;
-          }
-        }
-
-        //
-        // If this device is not a multi function device, then skip the rest
-        // of this PCI device
-        //
-        if (Function == 0 && !IS_PCI_MULTI_FUNC (&Pci)) {
-          break;
-        }
-      }
-    }
-
-    //
-    // If at least one PCI device was found on the primary bus of this PCI
-    // root bridge, then the PCI root bridge exists.
-    //
-    if (NumberOfDevices > 0) {
-      RootBridges = ReallocatePool (
-        (*NumberOfRootBridges) * sizeof (PCI_ROOT_BRIDGE),
-        (*NumberOfRootBridges + 1) * sizeof (PCI_ROOT_BRIDGE),
-        RootBridges
-      );
-      ASSERT (RootBridges != NULL);
-      PciHostBridgeUtilityInitRootBridge (
-        Attributes, Attributes, 0,
-        FALSE, PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID,
-        (UINT8) PrimaryBus, (UINT8) SubBus,
-        &Io, &Mem, &MemAbove4G, &mNonExistAperture, &mNonExistAperture,
-        &RootBridges[*NumberOfRootBridges]
-      );
-      RootBridges[*NumberOfRootBridges].ResourceAssigned = TRUE;
-      //
-      // Increment the index for the next PCI Root Bridge
-      //
-      (*NumberOfRootBridges)++;
-    }
-  }
-
-  return RootBridges;
-}
-- 
2.19.1.3.g30247aa5d201



  parent reply	other threads:[~2021-05-26 20:48 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 20:14 [PATCH 00/43] OvmfPkg: remove Xen support from OvmfPkg*.dsc, in favor of OvmfXen.dsc Laszlo Ersek
2021-05-26 20:14 ` [PATCH 01/43] OvmfPkg: remove the Xen drivers from the IA32, IA32X64, and X64 platforms Laszlo Ersek
2021-05-27  8:22   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 02/43] OvmfPkg: remove the Xen drivers from the AmdSev platform Laszlo Ersek
2021-05-27  8:22   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 03/43] OvmfPkg: switch IA32, IA32X64, X64 to the fw_cfg-only ACPI platform driver Laszlo Ersek
2021-05-27 10:15   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 04/43] OvmfPkg: switch the AmdSev platform " Laszlo Ersek
2021-05-27 10:15   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 05/43] OvmfPkg/README: bump minimum QEMU version to 1.7.1, machine types to 1.7 Laszlo Ersek
2021-05-27  8:24   ` Philippe Mathieu-Daudé
2021-05-27  8:56     ` Laszlo Ersek
2021-05-26 20:14 ` [PATCH 06/43] OvmfPkg/AcpiPlatformDxe: fix header file warts Laszlo Ersek
2021-05-27  8:24   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 07/43] OvmfPkg/AcpiPlatformDxe: sort #includes and [LibraryClasses] Laszlo Ersek
2021-05-27  8:25   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 08/43] OvmfPkg/AcpiPlatformDxe/QemuLoader.h: remove QemuFwCfgLib class dependency Laszlo Ersek
2021-05-27  8:26   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 09/43] OvmfPkg/AcpiPlatformDxe: move "QemuLoader.h" to IndustryStandard Laszlo Ersek
2021-05-27  8:26   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 10/43] OvmfPkg/AcpiPlatformDxe: consolidate #includes and [LibraryClasses] Laszlo Ersek
2021-05-27  8:41   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 11/43] OvmfPkg/XenAcpiPlatformDxe: create from AcpiPlatformDxe Laszlo Ersek
2021-05-27 10:16   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 12/43] OvmfPkg/AcpiPlatformDxe: remove the "AcpiPlatformDxe.inf" driver Laszlo Ersek
2021-05-27 10:17   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 13/43] OvmfPkg/XenAcpiPlatformDxe: remove the QEMU ACPI linker/loader client Laszlo Ersek
2021-05-27  8:38   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 14/43] OvmfPkg/XenAcpiPlatformDxe: remove QEMU fw_cfg dependency Laszlo Ersek
2021-05-27  8:39   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 15/43] OvmfPkg/XenAcpiPlatformDxe: remove the InstallAcpiTable() helper function Laszlo Ersek
2021-05-27  9:39   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 16/43] OvmfPkg/XenAcpiPlatformDxe: remove OVMF's built-in ACPI tables Laszlo Ersek
2021-05-27  8:40   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 17/43] OvmfPkg/Bhyve/AcpiPlatformDxe: fix file path typo in comment Laszlo Ersek
2021-05-26 20:40   ` Rebecca Cran
2021-05-27  8:40   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 18/43] OvmfPkg/AcpiTables: remove unused module Laszlo Ersek
2021-05-27  8:27   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 19/43] OvmfPkg/OvmfXen: make "PcdPciDisableBusEnumeration" Fixed-at-Build Laszlo Ersek
2021-05-27  8:42   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 20/43] OvmfPkg/XenAcpiPlatformDxe: remove delayed ACPI table installation Laszlo Ersek
2021-05-27  8:28   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 21/43] OvmfPkg/PlatformPei: remove Xen support Laszlo Ersek
2021-05-27 10:20   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 22/43] OvmfPkg: drop PcdPciDisableBusEnumeration from the IA32, IA32X64, X64 DSCs Laszlo Ersek
2021-05-27  8:29   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 23/43] OvmfPkg: drop PcdPciDisableBusEnumeration from the AmdSev platform Laszlo Ersek
2021-05-27 10:21   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 24/43] OvmfPkg/Bhyve: make "PcdPciDisableBusEnumeration" Fixed-at-Build Laszlo Ersek
2021-05-26 20:41   ` Rebecca Cran
2021-05-27  8:43   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 25/43] OvmfPkg/OvmfXen: remove IncompatiblePciDeviceSupport DXE driver Laszlo Ersek
2021-05-27  8:29   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 26/43] OvmfPkg/Bhyve: " Laszlo Ersek
2021-05-27 10:23   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 27/43] OvmfPkg/IncompatiblePciDeviceSupportDxe: remove PcdPciDisableBusEnumeration Laszlo Ersek
2021-05-27  8:30   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 28/43] OvmfPkg/PciHostBridgeLib: consolidate #includes and INF file sections Laszlo Ersek
2021-05-27  8:31   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 29/43] OvmfPkg/PciHostBridgeLibScan: create from PciHostBridgeLib Laszlo Ersek
2021-05-31 14:52   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 30/43] OvmfPkg/Bhyve: consume PciHostBridgeLibScan Laszlo Ersek
2021-05-26 22:46   ` Rebecca Cran
2021-05-27  8:31   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 31/43] OvmfPkg/OvmfXen: " Laszlo Ersek
2021-05-27  8:31   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` Laszlo Ersek [this message]
2021-05-27  8:32   ` [PATCH 32/43] OvmfPkg/PciHostBridgeLib: remove Bhyve and Xen support Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 33/43] OvmfPkg/PciHostBridgeLibScan: remove QEMU (fw_cfg) support Laszlo Ersek
2021-05-27 10:25   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 34/43] OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevId Laszlo Ersek
2021-05-27  8:33   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 35/43] OvmfPkg/PciHostBridgeLibScan: clean up file names and file-top comments Laszlo Ersek
2021-05-27  8:34   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 36/43] OvmfPkg/SmbiosPlatformDxe: clean up #includes and INF Laszlo Ersek
2021-05-27  8:34   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 37/43] OvmfPkg/SmbiosPlatformDxe: return EFI_NOT_FOUND if there is no SMBIOS data Laszlo Ersek
2021-05-27  8:45   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 38/43] OvmfPkg/SmbiosPlatformDxe: locate SMBIOS protocol in InstallAllStructures() Laszlo Ersek
2021-05-27  8:35   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 39/43] OvmfPkg/SmbiosPlatformDxe: split GetXenSmbiosTables() decl. to new header Laszlo Ersek
2021-05-31 14:54   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 40/43] OvmfPkg/SmbiosPlatformDxe: declare InstallAllStructures() in header file Laszlo Ersek
2021-05-31 15:00   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 41/43] OvmfPkg/SmbiosPlatformDxe: create Xen-specific module INF file Laszlo Ersek
2021-05-31 14:56   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 42/43] OvmfPkg/SmbiosPlatformDxe: split Xen entry point from QEMU entry point Laszlo Ersek
2021-05-31 15:03   ` Philippe Mathieu-Daudé
2021-05-26 20:14 ` [PATCH 43/43] OvmfPkg: restrict XenPlatformLib to BdsDxe in the IA32, IA32X64, X64 DSCs Laszlo Ersek
2021-05-31 14:58   ` Philippe Mathieu-Daudé
2021-05-27  7:34 ` [PATCH 00/43] OvmfPkg: remove Xen support from OvmfPkg*.dsc, in favor of OvmfXen.dsc Ard Biesheuvel
2021-05-27  8:55   ` Laszlo Ersek
2021-05-31 15:06     ` Philippe Mathieu-Daudé
2021-06-01  7:41       ` Laszlo Ersek
2021-05-27 13:07 ` Leif Lindholm
2021-05-27 13:09   ` Leif Lindholm
2021-05-27 16:30   ` Laszlo Ersek
2021-06-02  8:36 ` [edk2-devel] " Laszlo Ersek
2021-06-04 14:02   ` Anthony PERARD
2021-06-04 14:19     ` Laszlo Ersek
2021-06-04 16:05     ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526201446.12554-33-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox