From nobody Mon Feb 9 08:57:12 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+89262+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+89262+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882909; cv=none; d=zohomail.com; s=zohoarc; b=i9BrXAb6wzPCTnB9H3FpLSobfAH/+JVCiOZOmvI1mfLPStjoF5+EhHo9Ml6Tv2WI4RfpFfUmQs2F1p7/IQYPijsdu8JDjHt5L+UunkiaBvMiatEWkBU7LStBDv3Tm70mWztMq1fyRPwgOrELPT/CI1c27SHyxtpVEGoJdqr6uCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882909; 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=fbhzmz5zYkAGOZwRn90EXJlzMfPRcPQbYqLHGq8j0Ao=; b=RgSlf1FxXOUNtwt/uz7uv0yUUf678VFH+vCR5ERBSEL4Jps68DLtIIUGIxePe2SDiFr7zWCz1w72EyMAVKKczEgFg0LUGM9nyw1V7w6iGqRX7p3VSy1mOZNoWBlJc82rAtQ9+Hb9y/c9nDcsmWmBpS++v7R9Cr0gXtxVhBO+s8g= 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+89262+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 1650882909931306.24303158309624; Mon, 25 Apr 2022 03:35:09 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id OE4yYY1788612xh9hMqJWFlP; Mon, 25 Apr 2022 03:35:09 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web09.27941.1650882908880469168 for ; Mon, 25 Apr 2022 03:35:09 -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-401-yMXZzy-jOIS8tPH_ZSTz_Q-1; Mon, 25 Apr 2022 06:35:05 -0400 X-MC-Unique: yMXZzy-jOIS8tPH_ZSTz_Q-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D34B805F46; Mon, 25 Apr 2022 10:35:04 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C215F2166B2F; Mon, 25 Apr 2022 10:34:51 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CF76F1800617; Mon, 25 Apr 2022 12:34:46 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jiewen Yao , Oliver Steffen , Leif Lindholm , Pawel Polawski , Hao A Wu , Abner Chang , Liming Gao , Ray Ni , Jordan Justen , Jian J Wang , Ard Biesheuvel , Gerd Hoffmann Subject: [edk2-devel] [PATCH v6 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Date: Mon, 25 Apr 2022 12:34:42 +0200 Message-Id: <20220425103446.496763-3-kraxel@redhat.com> In-Reply-To: <20220425103446.496763-1-kraxel@redhat.com> References: <20220425103446.496763-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: 7YdVm3uJZHnTnN76fqly5U1ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882909; bh=YS436lnFcrW5F5YCOuIt2X46aLnJgtJ1lJt2WuL9ovA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=f+4pZjJ3V3DakoQmWicvM6bUzluMl1mNiQnttzxxv2E5ctSABY3HSxNUItyrZyehQjY pnXPpaR5OkDFh24zCSEy9XW2sq9HfCj5oS0I9xmMVQ3US2ZbJJIQVDrFFyqx740HW6cA5 aG9awuDNKrX02+9b9FQSB+OVoI1npyanWrY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882910631100001 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 Reviewed-by: Abner Chang --- .../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.35.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 (#89262): https://edk2.groups.io/g/devel/message/89262 Mute This Topic: https://groups.io/mt/90681720/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-