From nobody Mon Feb 9 15:10:23 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+90139+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+90139+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1654159348; cv=none; d=zohomail.com; s=zohoarc; b=EAQ5qg722dHeOFDO12761SNQMsyJ9ADcF9Rk99sXyAtDSA0NRPEp9XOuaPXgXWbICRPUT427XrQj5KZ+Obvrqpe1ZKt+h3aXbyNM9pS4CY1yUPV0Y8Vz5ouBld1/MFF+u3HJ7hmr+dErVCjW2NK6Ed96sUcp7e0w7hbDBy/XJrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654159348; 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=5v6wsacr87EFNfuo/Hd26SEFjsihEyHl56UC/y7kPTE=; b=jXtZWJ83kkJgJBjXUeZaTqyCyPed837wH9SjMml58790LpZWsHDsavCb1iU5erIDSRGk3UizifU/40xrwH88NuykXZQOzzpqctBvvpt0+/lHYHBCpCsOw0GHrO28fu4BRbXBXnxh9XDqelif6K0mI/Tf/E83IJt//Et9sBXTdZ0= 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+90139+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1654159348756582.4747605935212; Thu, 2 Jun 2022 01:42:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id eRksYY1788612xNwGTBaMubE; Thu, 02 Jun 2022 01:42:23 -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.web08.4397.1654159342484779390 for ; Thu, 02 Jun 2022 01:42:22 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-g4S2bb44PsqMx4JcDAjRLg-1; Thu, 02 Jun 2022 04:42:20 -0400 X-MC-Unique: g4S2bb44PsqMx4JcDAjRLg-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24720858F11; Thu, 2 Jun 2022 08:42:20 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.194.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6904140F06B; Thu, 2 Jun 2022 08:42:19 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6CC01180039D; Thu, 2 Jun 2022 10:42:16 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Hao A Wu , Pawel Polawski , Ard Biesheuvel , mateusz.albecki@intel.com, Abner Chang , Ray Ni , Leif Lindholm , Jiewen Yao , Oliver Steffen , Liming Gao , Gerd Hoffmann , Jian J Wang , Jordan Justen Subject: [edk2-devel] [PATCH v7 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Date: Thu, 2 Jun 2022 10:42:12 +0200 Message-Id: <20220602084216.159028-3-kraxel@redhat.com> In-Reply-To: <20220602084216.159028-1-kraxel@redhat.com> References: <20220602084216.159028-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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,kraxel@redhat.com X-Gm-Message-State: zRiYCremJ6r0qFQA9aqQ9BW5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1654159343; bh=TrI4UU+3OFWyAvSBvtdxfo8y+KczEgJ6zCNtWQuBZdU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=jVIQq6KMr/Q1Oylh7XESqR2vY82YMU4FQ/ZHJWHavq6OTTw+Qrrchv1ka5kRnAXFwb0 1Sm2yX3oP0AdXeGBS2UQ0oHUjPLROCbKoSC0mKaqWHdrjsGNNiP49f6sL6jpTFZaDeEQQ JTL0v4sW8N0xOe8+JEsuE81Q2bF9bgVhSMo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1654159350714100004 Content-Type: text/plain; charset="utf-8"; x-default="true" io range is not mandatory according to pcie spec, so allow host bridges without io address space. Signed-off-by: Gerd Hoffmann --- .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/OvmfPk= g/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c index 98828e0b262b..14b41a533e96 100644 --- a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c +++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c @@ -292,13 +292,8 @@ ProcessPciHost ( } } =20 - if ((*IoSize =3D=3D 0) || (*Mmio32Size =3D=3D 0)) { - DEBUG (( - DEBUG_ERROR, - "%a: %a space empty\n", - __FUNCTION__, - (*IoSize =3D=3D 0) ? "IO" : "MMIO32" - )); + if (*Mmio32Size =3D=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: MMIO32 space empty\n", __FUNCTION__)); return EFI_PROTOCOL_ERROR; } =20 @@ -333,13 +328,15 @@ ProcessPciHost ( return Status; } =20 - // - // Map the MMIO window that provides I/O access - the PCI host bridge co= de - // is not aware of this translation and so it will only map the I/O view - // in the GCD I/O map. - // - Status =3D MapGcdMmioSpace (*IoBase + IoTranslation, *IoSize); - ASSERT_EFI_ERROR (Status); + if (*IoSize !=3D 0) { + // + // Map the MMIO window that provides I/O access - the PCI host bridge = code + // is not aware of this translation and so it will only map the I/O vi= ew + // in the GCD I/O map. + // + Status =3D MapGcdMmioSpace (*IoBase + IoTranslation, *IoSize); + ASSERT_EFI_ERROR (Status); + } =20 return Status; } @@ -413,17 +410,21 @@ PciHostBridgeGetRootBridges ( =20 AllocationAttributes =3D EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM; =20 - Io.Base =3D IoBase; - Io.Limit =3D IoBase + IoSize - 1; + if (IoSize !=3D 0) { + Io.Base =3D IoBase; + Io.Limit =3D IoBase + IoSize - 1; + } else { + Io.Base =3D MAX_UINT64; + Io.Limit =3D 0; + } + Mem.Base =3D Mmio32Base; Mem.Limit =3D Mmio32Base + Mmio32Size - 1; =20 - if (sizeof (UINTN) =3D=3D sizeof (UINT64)) { - MemAbove4G.Base =3D Mmio64Base; - MemAbove4G.Limit =3D Mmio64Base + Mmio64Size - 1; - if (Mmio64Size > 0) { - AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; - } + if ((sizeof (UINTN) =3D=3D sizeof (UINT64)) && (Mmio64Size !=3D 0)) { + MemAbove4G.Base =3D Mmio64Base; + MemAbove4G.Limit =3D Mmio64Base + Mmio64Size - 1; + AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; } else { // // UEFI mandates a 1:1 virtual-to-physical mapping, so on a 32-bit --=20 2.36.1 -=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 (#90139): https://edk2.groups.io/g/devel/message/90139 Mute This Topic: https://groups.io/mt/91495636/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-