From nobody Mon Feb 9 23:14:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75704+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75704+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622062181; cv=none; d=zohomail.com; s=zohoarc; b=e4evSfiGFj0U2oETlbnjchqxLGWlC+PHBYYmW4vVq5mQWpPqbjlT+RYHMZ36cQX5hY+i36Dd2ygjBd7UpicZktHrVlCEW8dBWWteqUoKmF7+vvlcr/oUJHaYTgoqnLT9Ddm8SEI9vhZ7XWn/Gw5QzBJeRcwQXqzaaIocYCXVlA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622062181; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=EyN1982TJIlBnH6xPBe2QqSBTMz/bIGPpMIeqVEkKwE=; b=aSn1VeyAPJ5uwLr3LwaaNGzON8s22+XAQG6CjCqPcwpoXZIqfgUkGzyFg+CmyMND1ZS+fNJ1cdzmvFB1xBjLKTRiYZGAuL0UYJdeReFwwbNs1QT6SfgpIhYqa+FzIPr/aSA46JEVJOmTrbDM0E9BDg5h6TjMIfLcFx9aSfWRoQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75704+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622062181791703.9516923538941; Wed, 26 May 2021 13:49:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id M7x0YY1788612xHLITuDcfBn; Wed, 26 May 2021 13:49:41 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.3244.1622062175841630487 for ; Wed, 26 May 2021 13:49:36 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-38-BSv55bihNwaWKqflACJZvQ-1; Wed, 26 May 2021 16:49:32 -0400 X-MC-Unique: BSv55bihNwaWKqflACJZvQ-1 X-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BCFF91009E3F; Wed, 26 May 2021 20:49:30 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-61.ams2.redhat.com [10.36.114.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD04E61156; Wed, 26 May 2021 20:49:28 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Jordan Justen , Julien Grall , Peter Grehan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rebecca Cran Subject: [edk2-devel] [PATCH 33/43] OvmfPkg/PciHostBridgeLibScan: remove QEMU (fw_cfg) support Date: Wed, 26 May 2021 22:14:36 +0200 Message-Id: <20210526201446.12554-34-lersek@redhat.com> In-Reply-To: <20210526201446.12554-1-lersek@redhat.com> References: <20210526201446.12554-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com X-Gm-Message-State: TgdPPelE3XhfUAyTkN1Rz7gZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622062181; bh=EyN1982TJIlBnH6xPBe2QqSBTMz/bIGPpMIeqVEkKwE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=PORMPaRV1JIbRhrXWO47XKgJ/mD4j3Jpz9alRARkNfjFuvmqiHd1dm5iQ+Frc6CasDK wFVjNjFdHSF0T9APNlq+1CNx/9szIR0J8L2SklM8Bu5jh3Ig04msABHPcYuHmOhnsrCMn iTtAysu5DkT6YhuAG+W7dCZWm97PMqAwBXc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The "OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf" instance is used in the following platforms in edk2: OvmfPkg/Bhyve/BhyveX64.dsc OvmfPkg/OvmfXen.dsc Both platforms define "PcdPciDisableBusEnumeration" with Fixed-at-Build access method, and TRUE value. Remove the PCD from the PciHostBridgeLibScan instance, and everything else that is useful only when the PCD is FALSE. In practice, this removes the PciHostBridgeUtilityGetRootBridges() function call, which is based on fw-cfg; see "OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c". (Note that the dependency on PciHostBridgeUtilityLib remains in place, given that the PciHostBridgeLibScan instance continues using lower-level functions from the library that do not depend on fw-cfg.) Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Peter Grehan Cc: Philippe Mathieu-Daud=C3=A9 Cc: Rebecca Cran Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2122 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf | 7 --- OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c | 63 +------= ------------- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf = b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf index 46859388870f..1ba880be6782 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLibScan.inf @@ -41,14 +41,7 @@ [LibraryClasses] MemoryAllocationLib PcdLib PciHostBridgeUtilityLib PciLib =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId - gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase - gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base - gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size diff --git a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c b/Ovmf= Pkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c index 6c2acc9f99bc..f0166e0f7279 100644 --- a/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLibScan/PciHostBridgeLib.c @@ -4,26 +4,17 @@ Copyright (C) 2016-2021, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ -#include // PCI_MAX_BUS -#include // INTEL_Q35_MCH_DEV= IC... -#include // ZeroMem() -#include // PcdGet64() -#include // PCI_ROOT_BRIDGE_A= PE... +#include // PCI_ROOT_BRIDGE #include // PciHostBridgeUtil= it... -#include // EFI_PCI_HOST_BRID= GE... -#include // EFI_PCI_ATTRIBUTE= _I... =20 #include "PciHostBridge.h" =20 -STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D { MAX_UINT64, 0 }; - - /** Return all the root bridge instances in an array. =20 @param Count Return the count of root bridge instances. =20 @return All the root bridge instances in an array. @@ -33,63 +24,13 @@ STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture =3D {= MAX_UINT64, 0 }; PCI_ROOT_BRIDGE * EFIAPI PciHostBridgeGetRootBridges ( UINTN *Count ) { - 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 =3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | - EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO | - EFI_PCI_ATTRIBUTE_ISA_IO_16 | - EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO | - EFI_PCI_ATTRIBUTE_VGA_MEMORY | - EFI_PCI_ATTRIBUTE_VGA_IO_16 | - EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - - AllocationAttributes =3D EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM; - if (PcdGet64 (PcdPciMmio64Size) > 0) { - AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; - MemAbove4G.Base =3D PcdGet64 (PcdPciMmio64Base); - MemAbove4G.Limit =3D PcdGet64 (PcdPciMmio64Base) + - PcdGet64 (PcdPciMmio64Size) - 1; - } else { - CopyMem (&MemAbove4G, &mNonExistAperture, sizeof (mNonExistAperture)); - } - - Io.Base =3D PcdGet64 (PcdPciIoBase); - Io.Limit =3D PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1); - Mem.Base =3D PcdGet64 (PcdPciMmio32Base); - Mem.Limit =3D PcdGet64 (PcdPciMmio32Base) + (PcdGet64 (PcdPciMmio32Size)= - 1); - - return PciHostBridgeUtilityGetRootBridges ( - Count, - Attributes, - AllocationAttributes, - FALSE, - PcdGet16 (PcdOvmfHostBridgePciDevId) !=3D INTEL_Q35_MCH_DEVICE_ID, - 0, - PCI_MAX_BUS, - &Io, - &Mem, - &MemAbove4G, - &mNonExistAperture, - &mNonExistAperture - ); + return ScanForRootBridges (Count); } =20 =20 /** Free the root bridge instances array returned from PciHostBridgeGetRootBridges(). --=20 2.19.1.3.g30247aa5d201 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75704): https://edk2.groups.io/g/devel/message/75704 Mute This Topic: https://groups.io/mt/83111003/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-