From nobody Thu Apr 25 19:57:28 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+89256+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+89256+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882895; cv=none; d=zohomail.com; s=zohoarc; b=ditxuN2xTFh/qBygyFWzDjYJZl+K/ir/SUlGqwnbT6BGxBHwbhncGMkNlvh/dtOpGN3XFxUhJZDC/DsN85kk9g1jnGu+hJbwXarXXrqIn4Wa6x39rrJspoKXlHSVeNfDobYtcaqcMVogQ+TbIj8ft/a/TI07CV9WTC3b+2xzqtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882895; 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=ng7LkWsrWPxVAwchOsfHw91I7mg5p/o4hZHUXEn7Yy8=; b=Zx0dQcSyUzexvVxGDTIHidkOg3bRBW639bHGmZl4Z99FAFeWfYX23O0YtHvPgbkXkUoVNAQjLtfsIN8Cn54DKizMZGnPuqJxbVKlU04jIBY8lemi7C5yp5BjqdpLkaxOxL3NjImWkapLqQbdD0YmOIv43GiF9Ph6C2BCrZw6a/g= 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+89256+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 1650882895512473.11986324902546; Mon, 25 Apr 2022 03:34:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2F6cYY1788612xPL1LpUQdX3; Mon, 25 Apr 2022 03:34:55 -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.web09.27937.1650882894126860864 for ; Mon, 25 Apr 2022 03:34:54 -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-636-E7CI2SMNPK6FAWgNctdNdw-1; Mon, 25 Apr 2022 06:34:49 -0400 X-MC-Unique: E7CI2SMNPK6FAWgNctdNdw-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 48E76802809; Mon, 25 Apr 2022 10:34:49 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0203540D017A; Mon, 25 Apr 2022 10:34:48 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C9EE218003BA; 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 , Ard Biesheuvel Subject: [edk2-devel] [PATCH v6 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Date: Mon, 25 Apr 2022 12:34:41 +0200 Message-Id: <20220425103446.496763-2-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.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: Nf56Fs3bXnUpkdt2xIFmqUsux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882895; bh=l4w/fjjR/VcX5qWNoFsYBOPFy1BUxIZq4YMpTwCEfb0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nLByEQk7UtTA0dih49lzPMpYqaNxg95ivepAiu4t7ScwQ06KJfwzScJ+Lx0Fu4MRslC HxaHVctlHtHWmGFeSmKZveHi5Lv/jaApNlxOY0iW5vQO0toJJ6tEnY606/ndD5+aFI4Pk OA8sHPHglq+tCNhj78we1IjWphkyfHrAWDQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882896323100002 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 Reviewed-by: Abner Chang --- 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..712662707931 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) && (RootBridge->Io.Base =3D= =3D MAX_UINT64)) { + /* optional on PCIe */ + DEBUG ((DEBUG_INFO, "PCI Root Bridge does not provide IO Res= ources.\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 (#89256): https://edk2.groups.io/g/devel/message/89256 Mute This Topic: https://groups.io/mt/90681713/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 Thu Apr 25 19:57:28 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+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- From nobody Thu Apr 25 19:57:28 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+89258+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+89258+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882897; cv=none; d=zohomail.com; s=zohoarc; b=ShXUNecYQIgzwgmjeQC1Sm6m+8k1LjTSExr9zF5S7batfSS4vAsGxauum3p2/9ngbuMX5M209gucwLupq82N9ce77ebJsXjFbmUQ1yVW9UfvCw5+RSoOsj7deB+EZCZDgViLGvsI04iKsV48Pnh/5mfLgdM0T8JJkRbRe8taRhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882897; 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=t0QW/blLUBcORyeX6k9SI//zjhDFriW/EURrB/bwM4k=; b=jrN0Ab1ASwkwNIw8r/0tspTyhB69UrT16jaaEUTnAydz11N70lx6FQgHM/WeeFsGdUL4QCZc/pq1CDy20mDbi93TeZZFEMr7GaNwjiTtS58NP+lblFUW+N069P/BZc00qdullfxhmmE1oYv7XTtPtVBjaV9W5y92TAOIueYQkjs= 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+89258+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 1650882897834753.8420848141931; Mon, 25 Apr 2022 03:34:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UKbnYY1788612xG0wAqDHWT6; Mon, 25 Apr 2022 03:34:57 -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.web10.27615.1650882896696538021 for ; Mon, 25 Apr 2022 03:34:57 -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-287-_87WnPhLPnmFvShmbWbF9A-1; Mon, 25 Apr 2022 06:34:52 -0400 X-MC-Unique: _87WnPhLPnmFvShmbWbF9A-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 961C21C05AEF; Mon, 25 Apr 2022 10:34:51 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4244540D0165; Mon, 25 Apr 2022 10:34:51 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D2F761800624; 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 3/6] OvmfPkg/Platform: unfix PcdPciExpressBaseAddress Date: Mon, 25 Apr 2022 12:34:43 +0200 Message-Id: <20220425103446.496763-4-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.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: 7abOrb4SunI7F4sW5w5bDRn6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882897; bh=++aIy1CLmpCaYAF+FzEIiq6+HShqo8DQsPka/PksWXA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=U8MTh2mWCyRLmXhnRH7ef4NAx7a73VJC+sDrF5ymAcyjrmGnQEjuCQKwunUtPebJJgm 9Yo74u9t11nT9YsgMGLZ+OIelHeAxi2GwAsQ480FH4kHN0VCjTUR7FC80vk4aPMHMz9IB UsMhRjlGxI80axNO72hwsbT2d9RT6Bn/PLA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882898352100009 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 (#89258): https://edk2.groups.io/g/devel/message/89258 Mute This Topic: https://groups.io/mt/90681715/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 Thu Apr 25 19:57:28 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+89259+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+89259+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882899; cv=none; d=zohomail.com; s=zohoarc; b=Fb6T6Slzy0DsOH9W8V51Jd2VIZYgiurYHz8ZMeCnMdyAx8FOO9egXZLV072ALOpW5MspRv4W1DlBm3QmsJwmxKnlOvrWWDzQxO4oRXKj2QbFnD31atlfbLJgifCwZxTgWK4WG/2Ddat7G3EGNXdXNkaSLmV/La4e8VZi4/BMBEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882899; 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=wBfFJC43ftV4CJXK4qAZryE4EUTen5gXeHC96OXoD4w=; b=BxNNE9sTPVcU10+OxD/JIxoq/mTaA9431xpj+HJ2MWFboCbcIfAAl4vqokxO0gBLspnzhzwrOJ750jAMiALem9vwnkaovLbY5MVjNITfMvExGNNhutz0UEb0W7GFruE9D6omJP1YIK2OZML7btlEMljZzDI5mNqq7M9KLyQElEg= 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+89259+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 1650882899287303.6170824698505; Mon, 25 Apr 2022 03:34:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id euJrYY1788612xR9EOEluRJn; Mon, 25 Apr 2022 03:34:58 -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.27762.1650882897943998406 for ; Mon, 25 Apr 2022 03:34:58 -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-127-lBvd32miPnmL_VMjTg9CcQ-1; Mon, 25 Apr 2022 06:34:53 -0400 X-MC-Unique: lBvd32miPnmL_VMjTg9CcQ-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 1B0E0185A79C; Mon, 25 Apr 2022 10:34:53 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF983404E4AC; Mon, 25 Apr 2022 10:34:52 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D70BA1800628; 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 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Mon, 25 Apr 2022 12:34:44 +0200 Message-Id: <20220425103446.496763-5-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.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: 8D3pzwMJOX9t2EjUrSShzgiAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882898; bh=G9GHxhEpmAPMDv4dXMONlEIdYfc94gScLFiqbKd877Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=rEgt3tysOf88EpVTrGmQ55P5UlJO9T4j4tPb4Y3t60JVTV7LgxxB16K8Q3xpdWR1LoU 5qqzGcfKdG2g8RTL6gw2stKUID3JiXPcHuhvIUOIQwBq5wYPlCl+HvSjoQG8JZ8GhNMss FOO3BDUyedamGslF0lg0aRZ8ryKv9AGYh5Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882900367100013 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 (#89259): https://edk2.groups.io/g/devel/message/89259 Mute This Topic: https://groups.io/mt/90681716/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 Thu Apr 25 19:57:29 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+89260+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+89260+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882901; cv=none; d=zohomail.com; s=zohoarc; b=GkfNHVE4ZA4mhIy0nlhi8xfNCcZU3vn3xRAfdhd8arGisPoWL3jD026BrLaybyGNciv3wKoE4HAdHeqiaE3pDH2/LR2bE9pYxTqL7AThkNGgCV2SjgTvWATo1TEhh3U0YiTxLBt3rc9jB2Fh3FoIpFPpnmuQTMIaT88ZapFXZYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882901; 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=x+6UNmmFCFtjcAGxZnr4AT3Po3ZwvhWFgL3Ho35Ekns=; b=EHvSz39OViq90l145T6EayXEL+1lHjzZRDJd5YvsC/1qnxC8Na09+4x/sSbfLIVz5NK39NOKKp+3YX9H5fOOrVOpuYfhYiUZiseBgW+AZdzL2UuV5riWJFGwcM+K5a6Q/X/kSZIaDE38XdDwZDzaOFof22Rt159JmoIbrj3FClQ= 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+89260+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 1650882901042571.4087608949535; Mon, 25 Apr 2022 03:35:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ZyR5YY1788612x5lScbPZxX5; Mon, 25 Apr 2022 03:35:00 -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.27791.1650882899998265904 for ; Mon, 25 Apr 2022 03:35:00 -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-644-YNmcAYP3MWGqgEc5reD86w-1; Mon, 25 Apr 2022 06:34:55 -0400 X-MC-Unique: YNmcAYP3MWGqgEc5reD86w-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 798D9185A7BA; Mon, 25 Apr 2022 10:34:54 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4051AC27EAE; Mon, 25 Apr 2022 10:34:54 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DA8F7180062F; 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 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Mon, 25 Apr 2022 12:34:45 +0200 Message-Id: <20220425103446.496763-6-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.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: GTPsg4xeodDbJsijcf35oqB5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882900; bh=brflqdUzkCCxi8AUTHxi8TjyrbmDG6t7sv4QN0o5zEs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=AOSmu7+mWq8h639Vol9CwAvWg2rRON0kk/jDAdKS6wgtYgJiW7spvQeYMOn8gk0Vtw8 d58drFLsb12FpcgAMMyNcMtWMkIM8gTW3blysPyqCOefJe11mKN2Za7YWyHJjqynHXjv5 m66mtFMI4JVEUjn7pnucCsQQLgb9O6ZvHwU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882902363100017 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 (#89260): https://edk2.groups.io/g/devel/message/89260 Mute This Topic: https://groups.io/mt/90681717/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 Thu Apr 25 19:57:29 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+89261+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+89261+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650882903; cv=none; d=zohomail.com; s=zohoarc; b=fHzAK6lJwLd5XOAExhoQdXxU7yZaXiHlgDQnb5hQawdz/LCE5NHg8j/Wakr1QDBB4MzL6KAVwTxVHYZDiVJVsuiGv22kzzgRFwGXQA8FlBMFBX+SULg7/EHHVfLFhXiA9og7x3bQZwDlYE1C0fqEvSPhvYcODMpMlMLpgz/F4BE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650882903; 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=KUuerd8VBsjnhH82c3Ep0I22+xHh1ZLDzgQYbAbXiQc=; b=OPDH3DZIeFlHSv4BA9O8an/TMDGbsahqMQtR5iOiJ78x0XqjOHsHVhie0o5j1kDXeaAtw/0QEhZvH3+bASoyYSkXFL1baxMTtKB8ZU0R6YoIF6ypnAQ8R4EW0AaOl+A5PblGpRBX8febC5sjxmQOODuTZmQmoe/xYqX8NInkm+s= 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+89261+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 1650882903787521.5144492221755; Mon, 25 Apr 2022 03:35:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id AygQYY1788612xDoqSen61JH; Mon, 25 Apr 2022 03:35:03 -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.27765.1650882902458403415 for ; Mon, 25 Apr 2022 03:35:02 -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-279-0QjYrR2VPL2JWmnLGnATDA-1; Mon, 25 Apr 2022 06:34:56 -0400 X-MC-Unique: 0QjYrR2VPL2JWmnLGnATDA-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 F3F631C05AE8; Mon, 25 Apr 2022 10:34:55 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B216C28109; Mon, 25 Apr 2022 10:34:55 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DE6621800636; 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 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Mon, 25 Apr 2022 12:34:46 +0200 Message-Id: <20220425103446.496763-7-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.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: uZWQCbmvpV1ynOQO50svd0g6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650882903; bh=b49tboLwu6NIYz5qgumoYpbd3OeN9L+/lI7cTX9IGyU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=J0b6wMP97D1rnpyc2yA8FNJV7sxSKgBSosFtB4AvNYjKM4V9DH/tO7Dm8s0TVz9EJU4 2ukK5ew/ZLdro6kmzAXT84YbdCaFBLL23Z7MEtBNpWHOrY77Oe9EtNYzn5edaKGrN9gQI 25jSKB53Gkhb9odw1+JEX74GeyehF4yByKY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650882904399100021 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 c9c843e116a9..82e3f2195aff 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -336,7 +336,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 @@ -353,7 +355,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 @@ -375,7 +379,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 @@ -391,7 +397,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 @@ -412,7 +420,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 @@ -428,7 +438,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 ##########################################################################= ###### # @@ -503,14 +515,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 @@ -576,6 +580,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 @@ -676,7 +686,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 (#89261): https://edk2.groups.io/g/devel/message/89261 Mute This Topic: https://groups.io/mt/90681718/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-