From nobody Fri May 17 05:26:37 2024 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+88509+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+88509+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649323993; cv=none; d=zohomail.com; s=zohoarc; b=XyVIolInh2ROHlEhsHqv4hSNjVGVedyvLbnVwR+lEt1INlOHMap70itAX83t4MBpWDDjTE9Ypah/IaJ2vnd7a3Oih1kCMqMP4RTcUfK0JbZDvZBZCnBkgjq3METtZKWWjBiqw/BY22b/m6s2Jaw0bhqDNWLWfAib9H4mBZn3Kxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649323993; 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=xlWHSFVVENhvYYEy5lEFH3Jp/M1+CRkfdEVp5n7R0ao=; b=ZoLBfCkrCkOMM6roG/BWy6rblCtYcxOcHCrKJpceATze/OIhBJxdtDH2qQYt+5YI4fHQSVILg95A6tUxvPuOYmTWGcQluzi9JBm8+BxK5pROynhUu2rfUO4j0/KWIZyZda9H9yASZtl3cRl49426bqXH5XxF4XeyJdgbObF5JN8= 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+88509+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 1649323993563350.9182815021551; Thu, 7 Apr 2022 02:33:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Sj44YY1788612xV5b1VqYKzH; Thu, 07 Apr 2022 02:33:12 -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.web12.4575.1649323990945035792 for ; Thu, 07 Apr 2022 02:33:11 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-fsTVFnHiOfurdnAdnR4a_w-1; Thu, 07 Apr 2022 05:33:07 -0400 X-MC-Unique: fsTVFnHiOfurdnAdnR4a_w-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82DC338008B7; Thu, 7 Apr 2022 09:33:06 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C0CDC28119; Thu, 7 Apr 2022 09:33:05 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AB216180060F; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen , Ard Biesheuvel Subject: [edk2-devel] [PATCH v3 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Date: Thu, 7 Apr 2022 11:32:59 +0200 Message-Id: <20220407093304.1551182-2-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: Iy8DuJ3UhPPzTLY0IEVj9JCqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649323992; bh=rOWarOz8HVigdJz6pKeb/4qXkLdCDM2BXS7hgPDc9e4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=oOEWJNkfQPLPlOXPdm5Wi6z2geF+f8HwZh5fPGmYbjEcMdaPNR+8EvbdYKNwKsqupAs FuWEZHfSFakAg9ucJRpnzAuyacSMcyRpxiTYtweTXrPN8BRN3ec9ZRpHnh77MmlOZk24T QTFkCFKo5TQpp0IHuMl2qssHFx0ujsYz+F4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649323995133100003 Content-Type: text/plain; charset="utf-8"; x-default="true" io range is not mandatory according to pcie spec, so allow bridge configurations without io address space assigned. Signed-off-by: Gerd Hoffmann Reviewed-by: Ard Biesheuvel --- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeMod= ulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c index b20bcd310ad5..51a3b987967f 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c @@ -1085,6 +1085,9 @@ NotifyPhase ( RootBridge->ResAllocNode[Index].Base =3D BaseAddress; RootBridge->ResAllocNode[Index].Status =3D ResAllocated; DEBUG ((DEBUG_INFO, "Success\n")); + } else if (Index =3D=3D TypeIo) { + /* optional on PCIe */ + DEBUG ((DEBUG_INFO, "No IO\n")); } else { ReturnStatus =3D EFI_OUT_OF_RESOURCES; DEBUG ((DEBUG_ERROR, "Out Of Resource!\n")); --=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 (#88509): https://edk2.groups.io/g/devel/message/88509 Mute This Topic: https://groups.io/mt/90309345/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- From nobody Fri May 17 05:26:37 2024 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+88513+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+88513+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649323999; cv=none; d=zohomail.com; s=zohoarc; b=JoKJwZ/wgVY/xIFHopv6584HIrfEZpHP0egpleKPFXEepbIL9Q9gaxD9n6Mrx30GfMmZl1ARfNJn5UK1RpD2dbVvdA7fAWFygTL6HeP+jofli0iLmA/PKcLTvKAXPa9A1+qQn3mNoSa+y50+orLgbqPRw2dSa2kzuG78dN4uAx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649323999; 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=iB7TdweUGZwR8s1dxa/weCz5l9Tx4KeaN1Y1KFqrbic=; b=hGGy8di96F8YLrBSmu3jyni4Xrvh1v/76XTDeuiafLGruFzYYjNl+a+JcJISnZ4E7hmDm1KSGbyTcq7uQB3hMW5BKG/ndNT7DKF8u2mQKb44AxMRDRZ1aTOD1Ep8zKRrsX3Hp0+LYc4hsD/4KHjQ+HdDsKTnu0+eNwuYvrQNqTg= 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+88513+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 16493239990811002.3095247945364; Thu, 7 Apr 2022 02:33:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id emSgYY1788612xr7MxzYFwxG; Thu, 07 Apr 2022 02:33:18 -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.4646.1649323994666643430 for ; Thu, 07 Apr 2022 02:33:14 -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-82-v-stDVZtNm-OAHqDp4H6Fg-1; Thu, 07 Apr 2022 05:33:08 -0400 X-MC-Unique: v-stDVZtNm-OAHqDp4H6Fg-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 080F81815D07; Thu, 7 Apr 2022 09:33:08 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5E87407E1C1; Thu, 7 Apr 2022 09:33:07 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B0AD91800614; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen Subject: [edk2-devel] [PATCH v3 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Date: Thu, 7 Apr 2022 11:33:00 +0200 Message-Id: <20220407093304.1551182-3-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: MJQZlbhe6kASDnhHhntWvux9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649323998; bh=fEeeL70D96DWAsZzIPd/0TRV/bnY7qOYMuCdGtqwsb4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Vx+sqY18z0mofAus/7oksD+PJsMTmNDxuaKahUcA//7vETG6wwdMMSDn5ZhbMFRg1ID qSorydVwgmwqo1cOWb7cPXpqEFW47HzXvswSD4CGZoIuFDN5JWPcs2wloDiGn9RHiJqs/ +aedoyzwbzQ5L56cPvjO0G0eHN2B5vtgRPM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649324001183100022 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..823ea47c80a3 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) { + // + // 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) { + 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) { + 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 (#88513): https://edk2.groups.io/g/devel/message/88513 Mute This Topic: https://groups.io/mt/90309349/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- From nobody Fri May 17 05:26:37 2024 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+88511+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+88511+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649323996; cv=none; d=zohomail.com; s=zohoarc; b=IYBJg5B4L7RcXFbnEVG1pIzdLwlyRr+x0jwIRcEsEwl6U/zWdeynl2HhG/YU9jzwYwI4ksntaBFSDVa+kz7a4XXasOIulMNM5jZsTyd/0VuG41c4omxKyLS1GDqWdPboxogx/Y1a7k/MngiptbWEH+GLobUki+GeeqviWhqrmsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649323996; 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=mW1FGJpxV7rNOy44sIxhje1dmZNblbJ/pjs2AVbSrJ4=; b=KJqiGbvmKcU/GGyuVGdaMdHPAwDn7aRc2ENqGfC+gU0uyyvfHtIbl4kQR4sX8ZydBxvdEdnGpEs5NcyYEs+uT8fFu2Pl+CFpAzYBLlsEMguZM5putcx0I2qch5YZYTk901ozeXh1r90DLtKTNfQzBr9+8q20vIrm7d0SKdY2HOM= 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+88511+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 1649323996534280.8957682094084; Thu, 7 Apr 2022 02:33:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ejjCYY1788612xDK7ThPd4hc; Thu, 07 Apr 2022 02:33:15 -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.4656.1649323993085422288 for ; Thu, 07 Apr 2022 02:33:13 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-189-o1F9rcJUN7CtH_3Xr9MI4A-1; Thu, 07 Apr 2022 05:33:08 -0400 X-MC-Unique: o1F9rcJUN7CtH_3Xr9MI4A-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EE203C13949; Thu, 7 Apr 2022 09:33:08 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8516407F762; Thu, 7 Apr 2022 09:33:07 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B46791800617; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen Subject: [edk2-devel] [PATCH v3 3/6] OvmfPkg/Platform: unfix PcdPciExpressBaseAddress Date: Thu, 7 Apr 2022 11:33:01 +0200 Message-Id: <20220407093304.1551182-4-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: JSz7YqhXDaeqTq64NFOeGOvOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649323995; bh=qG/QQTpKpaEhR90I9tubpMn8IMmIiUXTHBCRaIwe9Qw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=X6eg6V9cXFOsO+5xgh8M+geAbQ0mfTNvuG8iMzpPZqzfVyvwGIsdUOByT2IsPMlt5uS 1/lswsAxJVl4p3t+wKV6J3Bhv8di2Bo0FoXa0KSTHDtH1nsD/U2+NpDU7WB4j/BtnftqJ MrgUgSdcb/HhJuymv2VTtMTLUYmqwI5pFok= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649323997179100008 Content-Type: text/plain; charset="utf-8"; x-default="true" Will be set by FdtPciHostBridgeLib, so it can't be an fixed when we want use that library. Signed-off-by: Gerd Hoffmann --- OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 4 +++- OvmfPkg/PlatformPei/PlatformPei.inf | 2 +- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 4 ++-- OvmfPkg/Library/PlatformInitLib/Platform.c | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/= Library/PlatformInitLib/PlatformInitLib.inf index d0fab5cc1f4f..d2a0bec43452 100644 --- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf +++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf @@ -54,8 +54,10 @@ [LibraryClasses] [LibraryClasses.X64] TdxLib =20 -[FixedPcd] +[Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress + +[FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 00372fa0ebb5..3cd83e6ec3e5 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -95,6 +95,7 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved @@ -118,7 +119,6 @@ [Pcd] [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/MemDetect.c index 4c1dedf863c3..83a7b6726bb7 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -61,8 +61,8 @@ PlatformQemuUc32BaseInitialization ( // [PcdPciExpressBaseAddress, 4GB) range require a very small number of // variable MTRRs (preferably 1 or 2). // - ASSERT (FixedPcdGet64 (PcdPciExpressBaseAddress) <=3D MAX_UINT32); - PlatformInfoHob->Uc32Base =3D (UINT32)FixedPcdGet64 (PcdPciExpressBase= Address); + ASSERT (PcdGet64 (PcdPciExpressBaseAddress) <=3D MAX_UINT32); + PlatformInfoHob->Uc32Base =3D (UINT32)PcdGet64 (PcdPciExpressBaseAddre= ss); return; } =20 diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/P= latformInitLib/Platform.c index 101074f6100d..60a30a01f3b5 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -154,7 +154,7 @@ PlatformMemMapInitialization ( // The MMCONFIG area is expected to fall between the top of low RAM and // the base of the 32-bit PCI host aperture. // - PciExBarBase =3D FixedPcdGet64 (PcdPciExpressBaseAddress); + PciExBarBase =3D PcdGet64 (PcdPciExpressBaseAddress); ASSERT (TopOfLowRam <=3D PciExBarBase); ASSERT (PciExBarBase <=3D MAX_UINT32 - SIZE_256MB); PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); @@ -278,7 +278,7 @@ PciExBarInitialization ( // determined in AddressWidthInitialization(), i.e., 36 bits, will suffi= ce // for DXE's page tables to cover the MMCONFIG area. // - PciExBarBase.Uint64 =3D FixedPcdGet64 (PcdPciExpressBaseAddress); + PciExBarBase.Uint64 =3D PcdGet64 (PcdPciExpressBaseAddress); ASSERT ((PciExBarBase.Uint32[1] & MCH_PCIEXBAR_HIGHMASK) =3D=3D 0); ASSERT ((PciExBarBase.Uint32[0] & MCH_PCIEXBAR_LOWMASK) =3D=3D 0); =20 --=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 (#88511): https://edk2.groups.io/g/devel/message/88511 Mute This Topic: https://groups.io/mt/90309347/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- From nobody Fri May 17 05:26:37 2024 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+88512+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+88512+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649323998; cv=none; d=zohomail.com; s=zohoarc; b=fIPxn6mDBkfGPymyabijkWBP7uyuowfRwkO/npR356V+vxo4v6+MrqFCKupnuunM9tdH9PFQyORNZ5ENLlG2V27cDCcefmwMyq55tYgbgq5xIU80BUuHEmMyYIpnAP0x9VjAQDuf7Fw2eR8BPHVN110D3wfikkzck9DRLqrJ0pU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649323998; 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=POjXoZicIUHBgvwdWJm4nnE7Smi/7sVFgTbuGGnzKAs=; b=XQpB/sdQbRCbivPy8yB8zWI6rqwdimtKBRgtwsFWF/Guqe6lJZEKaUqEuRsQglRT5uycxnWkO+pXz1/XGMXIAMI75cUJP4/0CFPpZP27WX/L+oBmJh2SrZI/AnN7XRAXE71tb71zKoeV0fhqzORq7hKwXOSR0u6BOfHtB05zI2k= 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+88512+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 16493239982381007.6279922479438; Thu, 7 Apr 2022 02:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kLW5YY1788612xSgf71shTXS; Thu, 07 Apr 2022 02:33:16 -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.4657.1649323993920192401 for ; Thu, 07 Apr 2022 02:33:14 -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-331-4SpZVOVCPdWkLo9k9DtFEA-1; Thu, 07 Apr 2022 05:33:10 -0400 X-MC-Unique: 4SpZVOVCPdWkLo9k9DtFEA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DED38339A3; Thu, 7 Apr 2022 09:33:09 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 407D440CF91D; Thu, 7 Apr 2022 09:33:09 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B7CC7180061B; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen Subject: [edk2-devel] [PATCH v3 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Thu, 7 Apr 2022 11:33:02 +0200 Message-Id: <20220407093304.1551182-5-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: WxPtbyLTeRMgJsn9uIvSkkrex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649323996; bh=J1zuZKXNNUWAeqhg02aGY/Mou2fG5IWWQf67aRI0NNU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=QNhOaFibsyBYsA6NTdccNs/VUVYViMVLQ7J23EqOzJtp11QF7NVW7320Kmb5K5mU7wv YaBiol/kUDZLGwXTPY2Jom+UNmDEqQcpMiuJOPwqWf0Gym183FJFXNWpgkdaG1WomTPSY CAkFUWZXpbeU4sGKO6l+5NmRUspvmt8WrwE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649323999197100015 Content-Type: text/plain; charset="utf-8"; x-default="true" Those old windows versions which need the vbeshim hack will not run on microvm anyway. Signed-off-by: Gerd Hoffmann --- OvmfPkg/QemuVideoDxe/VbeShim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OvmfPkg/QemuVideoDxe/VbeShim.c b/OvmfPkg/QemuVideoDxe/VbeShim.c index 8faa146b6cce..2a048211a823 100644 --- a/OvmfPkg/QemuVideoDxe/VbeShim.c +++ b/OvmfPkg/QemuVideoDxe/VbeShim.c @@ -156,6 +156,8 @@ InstallVbeShim ( case INTEL_Q35_MCH_DEVICE_ID: Pam1Address =3D DRAMC_REGISTER_Q35 (MCH_PAM1); break; + case MICROVM_PSEUDO_DEVICE_ID: + return; default: DEBUG (( DEBUG_ERROR, --=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 (#88512): https://edk2.groups.io/g/devel/message/88512 Mute This Topic: https://groups.io/mt/90309348/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- From nobody Fri May 17 05:26:37 2024 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+88514+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+88514+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649324000; cv=none; d=zohomail.com; s=zohoarc; b=EaIql5VEf50ynevjGGMKo20gvbg5Vf2omyLRxZhGCILoAT/dUwbeMt2+6inqSeIzVpduNn7K+0+OGVREPlPpOJWAqffV7vxHcuF0zqsCQToKp5SUqaJNwr7J/12SEND6X7Mswx3/K4sJAL+USTGIUa0y879a+UtPU8O7T+wLVus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649324000; 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=dYlbZK2SVS6KSgbQ7a6sPHqjfR0SA5FlaiAyINNLFYI=; b=hDYc2dDHDqpTRZOHxoZ70mbYeOT0ndzcK9Dh0sp5LM3R5x+fmb2GuQieglTO6hh5llRatKyqHsyyxGe1ZSP7VvQxOdV92//MHwBTFhfyjkDnXaYFvIFV4fOiALTyeAXHEv8NH4mqaHuU6ZAMSCFsRTXMpBlPpq01V0/r+pBD3OY= 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+88514+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 1649324000039720.8602081954889; Thu, 7 Apr 2022 02:33:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id S5FdYY1788612xPWIdihcr1x; Thu, 07 Apr 2022 02:33:18 -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.4658.1649323994884114807 for ; Thu, 07 Apr 2022 02:33:15 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-o4IDWfYxOlyHbKa8rwBlcQ-1; Thu, 07 Apr 2022 05:33:10 -0400 X-MC-Unique: o4IDWfYxOlyHbKa8rwBlcQ-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 91C223C13946; Thu, 7 Apr 2022 09:33:09 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41AD5401E6C; Thu, 7 Apr 2022 09:33:09 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BB684180061C; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen Subject: [edk2-devel] [PATCH v3 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Thu, 7 Apr 2022 11:33:03 +0200 Message-Id: <20220407093304.1551182-6-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-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: JsoNfgGzTbp8HVCCSOKZkltQx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649323999; bh=YpIXyipM6NYcUwljj/iZF2Z3teRs2NFctz7zDeaWt4Q=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=jMDQcpTIeMLl1HhQYuBbIn/a2cQGcHJfhN/J/AChKPyyBvCT+LzwxwpQevdTUI3iZ6w Lo838xeAjRYuN/a8KnLS5N76Wfz9EwjyUKOhn5vK8Qvs8IHM6XUgD0CcQ7vvAQVqsCMtA kIFexzvPNIneEPMP4rbi4PatuFqCem6nurM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649324001176100021 Content-Type: text/plain; charset="utf-8"; x-default="true" microvm places the 64bit mmio space at the end of the physical address space. So mPhysMemAddressWidth must be correct, otherwise the pci host bridge setup throws an error because it thinks the 64bit mmio window is not addressable. On microvm we can simply use standard cpuid to figure the address width because the host-phys-bits option (-cpu ${name},host-phys-bits=3Don) is forced to be enabled. Side note: For 'pc' and 'q35' this is not the case for backward compatibility reasons. Signed-off-by: Gerd Hoffmann --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 41 +++++++++++++++++++++ OvmfPkg/PlatformPei/Platform.c | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/MemDetect.c index 83a7b6726bb7..c28d7601f87e 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -491,6 +491,42 @@ PlatformGetFirstNonAddress ( return FirstNonAddress; } =20 +/* + * Use CPUID to figure physical address width. Does *not* work + * reliable on qemu. For historical reasons qemu returns phys-bits=3D40 + * even in case the host machine supports less than that. + * + * qemu has a cpu property (host-phys-bits=3D{on,off}) to change that + * and make sure guest phys-bits are not larger than host phys-bits., + * but it is off by default. Exception: microvm machine type + * hard-wires that property to on. + */ +VOID +EFIAPI +PlatformAddressWidthFromCpuid ( + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob + ) +{ + UINT32 RegEax; + + AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); + if (RegEax >=3D 0x80000008) { + AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL); + PlatformInfoHob->PhysMemAddressWidth =3D (UINT8)RegEax; + } else { + PlatformInfoHob->PhysMemAddressWidth =3D 36; + } + + PlatformInfoHob->FirstNonAddress =3D LShiftU64 (1, PlatformInfoHob->Phys= MemAddressWidth); + + DEBUG (( + DEBUG_INFO, + "%a: cpuid: phys-bits is %d\n", + __FUNCTION__, + PlatformInfoHob->PhysMemAddressWidth + )); +} + /** Initialize the PhysMemAddressWidth field in PlatformInfoHob based on gue= st RAM size. **/ @@ -503,6 +539,11 @@ PlatformAddressWidthInitialization ( UINT64 FirstNonAddress; UINT8 PhysMemAddressWidth; =20 + if (PlatformInfoHob->HostBridgeDevId =3D=3D 0xffff /* microvm */) { + PlatformAddressWidthFromCpuid (PlatformInfoHob); + return; + } + // // As guest-physical memory size grows, the permanent PEI RAM requiremen= ts // are dominated by the identity-mapping page tables built by the DXE IP= L. diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index f006755d5fdb..009db67ee60a 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -357,12 +357,12 @@ InitializePlatform ( =20 S3Verification (); BootModeInitialization (&mPlatformInfoHob); - AddressWidthInitialization (&mPlatformInfoHob); =20 // // Query Host Bridge DID // mPlatformInfoHob.HostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); + AddressWidthInitialization (&mPlatformInfoHob); =20 MaxCpuCountInitialization (&mPlatformInfoHob); =20 --=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 (#88514): https://edk2.groups.io/g/devel/message/88514 Mute This Topic: https://groups.io/mt/90309350/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- From nobody Fri May 17 05:26:37 2024 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+88515+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+88515+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649324001; cv=none; d=zohomail.com; s=zohoarc; b=MyGxevnrqH+EF0mj6oktyKdf29VnsdnYuXooGAUkXCclz4zr4YdTTmogXpTKN+5pXyuZIuUoPKMurZSCIijDNxZVO0omHxoou64A511shbkDHe7uoDf62JEKlHObfm7k3uEYsQHo5vldAK4bn6ooNBup82EVm9z8jZBe8TWNhao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649324001; 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=EaEye9aLFP3EIRGyU2uhWUbRi/LCgOeyWP5YIKlKNCc=; b=A4Ou7NZTajXQ0DM9Br48RTwXNAbA5kOIs/sfne4Ye52/8thJNFnTRvq4d01z4vqnXSvSGW4fvC+WXZvQzSXbjEfCN9Hg7q1kWei7TA8o7kytjprrGA+hmbAIY5vtvphdS+FbYkfl5doMAwpeNn70S6iww6vEKYJtJJsJKtbnO/A= 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+88515+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 1649324001533172.08093331704924; Thu, 7 Apr 2022 02:33:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ACQDYY1788612xlKlTlruhc7; Thu, 07 Apr 2022 02:33:20 -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.web11.4813.1649323995547578164 for ; Thu, 07 Apr 2022 02:33:16 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-389-U7YwmDj4MmuQZEPJXJzbwA-1; Thu, 07 Apr 2022 05:33:11 -0400 X-MC-Unique: U7YwmDj4MmuQZEPJXJzbwA-1 X-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 53A4338008AD; Thu, 7 Apr 2022 09:33:11 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED2A240D2822; Thu, 7 Apr 2022 09:33:10 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BF4311800623; Thu, 7 Apr 2022 11:33:04 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jordan Justen , Jian J Wang , Ray Ni , Hao A Wu , Gerd Hoffmann , Jiewen Yao , Liming Gao , Pawel Polawski , Abner Chang , Oliver Steffen Subject: [edk2-devel] [PATCH v3 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Thu, 7 Apr 2022 11:33:04 +0200 Message-Id: <20220407093304.1551182-7-kraxel@redhat.com> In-Reply-To: <20220407093304.1551182-1-kraxel@redhat.com> References: <20220407093304.1551182-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: HwVHWCcCLyJa4pcYym1Klp2hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649324000; bh=Lnuks3WrtI0Tu5uvWVmSKoUX26G1iGKbRdp7qDUNptQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=kU/f5BwgVVEDcjxlwN8aX/XtFlVnCWUUrCLeD22ldkCVv7XrbucHbuHOaS9x5kFnOhK 6v9zwgEfM7EbY6DaZ6pMt2cvrM5f0AisP2goPijCxIFDnhd+y+y/eT9JuH/I74XIW3zKL 3/8bWeIQTHz+DYLUJ1PWT/wk33auU+fdDwU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649324003251100027 Content-Type: text/plain; charset="utf-8"; x-default="true" Link in pcie and host bridge bits. Enables support for PCIe in microvm (qemu-system-x86_64 -M microvm,pcie=3Don). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3777 Signed-off-by: Gerd Hoffmann --- OvmfPkg/Microvm/MicrovmX64.dsc | 40 +++++++++++++++++++++------------- OvmfPkg/Microvm/README | 2 +- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 59580ccd4691..4ea7295e78e2 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -335,7 +335,9 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] !endif UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf +# PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf +# PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib= .inf +# PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciEx= pressLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf =20 @@ -352,7 +354,9 @@ [LibraryClasses.common.UEFI_DRIVER] DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf + PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 [LibraryClasses.common.DXE_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -374,7 +378,9 @@ [LibraryClasses.common.DXE_DRIVER] !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf !endif - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf + PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib= .inf @@ -390,7 +396,9 @@ [LibraryClasses.common.UEFI_APPLICATION] !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf + PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -411,7 +419,9 @@ [LibraryClasses.common.DXE_SMM_DRIVER] DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf !endif BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf + PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 [LibraryClasses.common.SMM_CORE] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -427,7 +437,9 @@ [LibraryClasses.common.SMM_CORE] !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf !endif - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf + PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExp= ressLib.inf =20 ##########################################################################= ###### # @@ -502,14 +514,6 @@ [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F !endif =20 - # This PCD is used to set the base address of the PCI express hierarchy.= It - # is only consulted when OVMF runs on Q35. In that case it is programmed= into - # the PCIEXBAR register. - # - # On Q35 machine types that QEMU intends to support in the long term, QE= MU - # never lets the RAM below 4 GB exceed 2816 MB. - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xB0000000 - !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 !endif @@ -575,6 +579,12 @@ [PcdsDynamicDefault] gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 =20 + # set PcdPciExpressBaseAddress to MAX_UINT64, which signifies that this + # PCD and PcdPciDisableBusEnumeration below have not been assigned yet + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE + # Set video resolution for text setup. gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480 @@ -675,7 +685,7 @@ [Components] OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { - PciHostBridgeLib|MdeModulePkg/Library/PciHostBridgeLibNull/PciHostBr= idgeLibNull.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib= .inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciH= ostBridgeUtilityLib.inf NULL|OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf } diff --git a/OvmfPkg/Microvm/README b/OvmfPkg/Microvm/README index 540d39f2ec21..813920d92a60 100644 --- a/OvmfPkg/Microvm/README +++ b/OvmfPkg/Microvm/README @@ -29,7 +29,7 @@ features [working] serial console [working] direct kernel boot [working] virtio-mmio support - [in progress] pcie support + [working] pcie support =20 known limitations ----------------- --=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 (#88515): https://edk2.groups.io/g/devel/message/88515 Mute This Topic: https://groups.io/mt/90309351/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-