[edk2-devel] [PATCH 34/43] OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevId

Laszlo Ersek posted 43 patches 4 years, 8 months ago
[edk2-devel] [PATCH 34/43] OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevId
Posted by Laszlo Ersek 4 years, 8 months ago
The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf"
instance is used in the following platforms in edk2:

  OvmfPkg/Bhyve/BhyveX64.dsc
  OvmfPkg/OvmfXen.dsc

Neither Bhyve nor Xen provide a Q35 board, therefore the expression

  PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID

always evaluates to TRUE, in the PciHostBridgeLibScan instance.

Replace the expression with constant TRUE, eliminating the PCD dependency.

(In effect, this reports that the root bridge being registered does not
support extended PCI config space.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien@xen.org>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf | 4 ----
 OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c             | 4 +---
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf
index 1ba880be6782..199db4cbbd19 100644
--- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf
+++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf
@@ -36,12 +36,8 @@ [Packages]
 
 [LibraryClasses]
   BaseLib
   BaseMemoryLib
   DebugLib
   MemoryAllocationLib
-  PcdLib
   PciHostBridgeUtilityLib
   PciLib
-
-[Pcd]
-  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c b/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c
index a4a61e5836e0..edf993e82dcc 100644
--- a/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c
+++ b/OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c
@@ -6,18 +6,16 @@
 
   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"
@@ -452,13 +450,13 @@ ScanForRootBridges (
         (*NumberOfRootBridges + 1) * sizeof (PCI_ROOT_BRIDGE),
         RootBridges
       );
       ASSERT (RootBridges != NULL);
       PciHostBridgeUtilityInitRootBridge (
         Attributes, Attributes, 0,
-        FALSE, PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID,
+        FALSE, TRUE /* NoExtendedConfigSpace */,
         (UINT8) PrimaryBus, (UINT8) SubBus,
         &Io, &Mem, &MemAbove4G, &mNonExistAperture, &mNonExistAperture,
         &RootBridges[*NumberOfRootBridges]
       );
       RootBridges[*NumberOfRootBridges].ResourceAssigned = TRUE;
       //
-- 
2.19.1.3.g30247aa5d201




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75705): https://edk2.groups.io/g/devel/message/75705
Mute This Topic: https://groups.io/mt/83111024/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 34/43] OvmfPkg/PciHostBridgeLibScan: remove PcdOvmfHostBridgePciDevId
Posted by Philippe Mathieu-Daudé 4 years, 8 months ago
On 5/26/21 10:14 PM, Laszlo Ersek wrote:
> The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf"
> instance is used in the following platforms in edk2:
> 
>   OvmfPkg/Bhyve/BhyveX64.dsc
>   OvmfPkg/OvmfXen.dsc
> 
> Neither Bhyve nor Xen provide a Q35 board, therefore the expression
> 
>   PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID
> 
> always evaluates to TRUE, in the PciHostBridgeLibScan instance.
> 
> Replace the expression with constant TRUE, eliminating the PCD dependency.
> 
> (In effect, this reports that the root bridge being registered does not
> support extended PCI config space.)
> 
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Peter Grehan <grehan@freebsd.org>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf | 4 ----
>  OvmfPkg/Library/PciHostBridgeLibScan/XenSupport.c             | 4 +---
>  2 files changed, 1 insertion(+), 7 deletions(-)

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75774): https://edk2.groups.io/g/devel/message/75774
Mute This Topic: https://groups.io/mt/83111024/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-