From nobody Wed May 15 03:47:10 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+89188+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+89188+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544083; cv=none; d=zohomail.com; s=zohoarc; b=irlj1o0oDqBSeauxsbTCYiNRdFKy8QeMo4sYAJ2KgY8A/NmhjhpmJEtlFMT0W3aYKnxqNrIg6/aOCtGI7IRENstTCen2Z0JoYt0ij15fojCtlwAkOjpE2Q3AgUPTlMYFU77XwE61Qm46qBpIV3IPyz/0cXNb8jen15dE4UKbTP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544083; 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=E7UVrLWeFGrs5m6S7q8ffZo758GglBtBP0PpUFZbnW0=; b=bWZZDy7ZG5C+q7EyghQ8k3crbth/uPFrUfxGwq40iVNLbIJx4WetXeY3HOQU3+DDe90w5k8aGCkYYsBQHjRyQWBldoyUNvOjYnebTTQHTjErE1Ex4inxPCxYu7JcH4f8Zx5OGXi3eHTUXGfW0d+SRT4+sbjZyqpyv5dorfLq3P4= 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+89188+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 1650544083398665.3223763272761; Thu, 21 Apr 2022 05:28:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xmDqYY1788612x4d6n7VZjKS; Thu, 21 Apr 2022 05:28:03 -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.web11.20630.1650544082266396295 for ; Thu, 21 Apr 2022 05:28:02 -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-146-KqquXeGWONWj1N7g2lgu8Q-1; Thu, 21 Apr 2022 08:27:58 -0400 X-MC-Unique: KqquXeGWONWj1N7g2lgu8Q-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 D3660185A7BA; Thu, 21 Apr 2022 12:27:57 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BD73C44AE9; Thu, 21 Apr 2022 12:27:56 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 428B6180039F; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang , Ard Biesheuvel Subject: [edk2-devel] [PATCH v4 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Date: Thu, 21 Apr 2022 14:27:50 +0200 Message-Id: <20220421122755.1436026-2-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-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: uRbssLMQ6Zkrohq786zg2UCSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544083; bh=xrpWZ4t+Yx32SNdevxOanh+IO0gdxOQFsgsyYdAGOzw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Z8jL7cXhfyMn2TVp8tRetyPkikdZ/OrTs7mbKl/CGP/hPrlgNWDUHDbiQTukPnqpdUF rQwC2e5PmvMlbFfa8X6C0IQKE2Z+GCFuS5qR+5hhJxj1FtHqKRe4HNo12Zwh04wctUDoa sFpoMsXXLtCtPJxYERsoxwFEasfAz8iKk9M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544084012100001 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..b83761721e4b 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 M= AX_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 (#89188): https://edk2.groups.io/g/devel/message/89188 Mute This Topic: https://groups.io/mt/90604427/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 Wed May 15 03:47:10 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+89191+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+89191+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544087; cv=none; d=zohomail.com; s=zohoarc; b=UKcpgXBFT2d7E8LIR6ON1U5+xFlG3N2q949pH6WdXMmeGRm0zVS23vfBt49NdPakHi9BRhP+ncFvDpViFZr6abJY9WX+mTqQp+EvP+Q8X8kaIo1JyCaMjcCB6n1GsWVOwMFAmyUv6f+3CSP7AD41adS6pyaSm7+OukRuN8GuhHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544087; 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=9cYrvEjTWb1bA5WaTR15DUK7ZK5rXxlBhbf1+mtaBd8=; b=WdGRagMUaFP3Xk7OIvZvKDYF0UvAkEsNNVyPpuD8TVecKwpAzM5z5C7/Qovt74Lt35Pba2HXa9/ET7MlIMwLgwsDnOzgm7jX7lOryQpv7sA+z4uks0nCdM4BwtauZzN4HvNDzw+3RSWIGjSJjba1xBY1iGQM5TXeHfVh6fdYzLA= 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+89191+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 1650544087671198.63767296025617; Thu, 21 Apr 2022 05:28:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PRpoYY1788612xSuWVUFgT9T; Thu, 21 Apr 2022 05:28:06 -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.20729.1650544086153745763 for ; Thu, 21 Apr 2022 05:28:06 -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-45-iJ27lcTyNMujun7Fjk3tPA-1; Thu, 21 Apr 2022 08:28:00 -0400 X-MC-Unique: iJ27lcTyNMujun7Fjk3tPA-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9578A1C09067; Thu, 21 Apr 2022 12:27:59 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 628FE14A4F80; Thu, 21 Apr 2022 12:27:59 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4814F180079D; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v4 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Date: Thu, 21 Apr 2022 14:27:51 +0200 Message-Id: <20220421122755.1436026-3-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 8o39LLJDQz7I5U7u06K9Xafkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544086; bh=7vbNVjCUYEfKIh+Ela8mqyTJHrsAHC5UPFHA5ngaDe0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=B3GYGo3RTzsgsVrs4hX5mlDm5JzMxQ54R+nJ9lmNvxGK/e/1NWZjfgIQ46+7S57DDxZ nVHR9upBL2OQLGcUHx+YSYgyj5sW3jMqvMTNY+zEW9ljhL5X7Qx7Asbh/+HnUxUVaIJV/ H+rf4EVS9str/sRfodMbqRge0nrIWe0z4OQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544088042100013 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 (#89191): https://edk2.groups.io/g/devel/message/89191 Mute This Topic: https://groups.io/mt/90604432/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 Wed May 15 03:47:10 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+89190+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+89190+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544085; cv=none; d=zohomail.com; s=zohoarc; b=QeDAF8t0SnyMXk1c5hxPO/qb3HItVlOHt2Sdaw9sLtxxEYnNT3I2bvMLlSawvDddOxqSsAwoEGZnl99cBrcp1pIWIdwbjgK561/j2wKopjxwiVFfz/ueYRh/dRfjYFToUwmbhtfOsYysshowM/zFyFue+S1oHgv6sliWGbkBxQU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544085; 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=pRSV9Stzdf6X8PJpsxK4+HDau9o0K5Pa1yfL73rQduY=; b=Qp4LdRgKZVFd7w7jCn6JPrJjgeGY/IlT5I2nK4e+BMXXbNT3aTxAhkS4q5BmJqeI2GOYNfc/NSCJ4HL8GC6sePvQ7TzV39EPO7FLyRyUO0iVNlqzXJfV2BVLJlAcm/9eeU1E7Hh3kSyQ47bljuHmRVewysXVCawcqIZnzDeVyN4= 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+89190+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 1650544085221387.0228038750215; Thu, 21 Apr 2022 05:28:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tVnxYY1788612xpEu9wkNxYM; Thu, 21 Apr 2022 05:28:04 -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.20685.1650544084085996953 for ; Thu, 21 Apr 2022 05:28:04 -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-528-tPkWH-k_PK24Xx2xViAppw-1; Thu, 21 Apr 2022 08:28:00 -0400 X-MC-Unique: tPkWH-k_PK24Xx2xViAppw-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 9C6061C00ACF; Thu, 21 Apr 2022 12:27:59 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63E8840D016E; Thu, 21 Apr 2022 12:27:59 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4BA23180084D; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v4 3/6] OvmfPkg/Platform: unfix PcdPciExpressBaseAddress Date: Thu, 21 Apr 2022 14:27:52 +0200 Message-Id: <20220421122755.1436026-4-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-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: GNS4URwlEGHF3a58i2fWAJxcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544084; bh=Mai5lEpRSkmcHNFn8fyFT3AjRgFu6TK6z2Z31geD8M8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=V7oHYc5S/KdH3WDdApfSA7NCo13SBFEoXDcLsO+o5bTtwtMmayxDzJXzQXeu5TYaukp POj3ywkbo82B+5OH8mv+s6DFmO/pRPyKRbyR4DpQgzAGjVQfWTt7OPaPINke//oYwkdgH h8LMGB+pnlPtSvMj5OHqbP2dqZsJMQlXCVU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544086033100009 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 (#89190): https://edk2.groups.io/g/devel/message/89190 Mute This Topic: https://groups.io/mt/90604429/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 Wed May 15 03:47:10 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+89194+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+89194+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544115; cv=none; d=zohomail.com; s=zohoarc; b=bfuomTr526tpYNUpYg+pmbpPfKADE6eSq9nBw/31UUkesh1NYBiQQotmSUTsspdEBMED8Of+3bnt5O3/U6sD+/oTm/G5yT0qMBxygzd6f+DHJRoQx2c6j6ZBraCZtX4n52ZTc2u1DdCKqXAVRV93bGwCz6zc4ZEn5hz40fJs41w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544115; 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=AbAgO63af4FrLFYdd2HJ+UKcaMAPdGDeZpwUEg9nxDE=; b=f/kO8UPcIyoS0mjSF1JwyiHS78Zg15+9U13BhqJrPOQx/BItaOKiudzR4GJ2Q2JYSn/loeZpcAv8ugQRev9R3OoBBELYGGDPio8PpfL8OMHgGbZtf9hqyUcUK4BMLqeb2Jc6odx8/x7BG1qb9AfEKA5KDHNySuTIcnsgXu5ql1k= 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+89194+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 1650544115315812.4332032047586; Thu, 21 Apr 2022 05:28:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jGd1YY1788612xDqqTQpKzCh; Thu, 21 Apr 2022 05:28:35 -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.web11.20635.1650544113912844864 for ; Thu, 21 Apr 2022 05:28:34 -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-464-du5_jdzeNZ2t088-hFgjKw-1; Thu, 21 Apr 2022 08:28:22 -0400 X-MC-Unique: du5_jdzeNZ2t088-hFgjKw-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E92311C0BF2B; Thu, 21 Apr 2022 12:28:21 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 222CD20296A2; Thu, 21 Apr 2022 12:28:01 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4F4BC1800865; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v4 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Thu, 21 Apr 2022 14:27:53 +0200 Message-Id: <20220421122755.1436026-5-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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: 9vsnGLzflXKaREf7OFKBLe6Nx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544115; bh=4p8F1CBPoLOhm1CRqhu9BbRn3VRBF0DBxr7+dKBSgQQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=WgIIqGFsiUSF2Aw3EZGmCAZmo9Ej7s9hSiH0ieUQzn3TKjU+dxNXkU7CkZiY6mwn1hr Dx5BbgeEu6aiV2qM4Rd7+Da1x9Q/DdN6vhIq3bf6/SdfE/eEIvU8nrOBjpweQ+qUIUuWL pAybFV9MERSpz5y1YalHL1MDMBkEuMIk5Gw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544116149100001 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 (#89194): https://edk2.groups.io/g/devel/message/89194 Mute This Topic: https://groups.io/mt/90604447/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 Wed May 15 03:47:10 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+89192+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+89192+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544099; cv=none; d=zohomail.com; s=zohoarc; b=YnC2QwzX9ZZ+1lmonqJYPm06fe2nvl3jejeofdikBPuHcnRMSxvRnAOktULSKmQiV0UQt9eYG7M9A1stW1LWQA+j4b5Xna4GS9bqEDzIcp66Zkj3mC+886t9/5g6gXbCf2vj4N8a8o6BcvK+yTD6va4zI++e2vc9ItVWHkCx0p4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544099; 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=94O0H2Qrasx2m7hWUfd1vxaP2GpyV1q6gfHfPjutZZg=; b=JGIdH1ol6w7P7MUm0Px6xF+AhggUkdF9pwkBqeMglF0XxELXNwhr/+HJSH4vER2wwlRi8H4qPOYdQYccXonqPeJNR79CEHpTYThwxZ/CAWQ5r+KgPCijBHpg9neY0J5ouJA0sb3ue33uvwuaSXcIYDDNm3r2MRyBOFRov+FS7a8= 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+89192+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 1650544099277789.4174925919464; Thu, 21 Apr 2022 05:28:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Jrj0YY1788612x4DjphS0pma; Thu, 21 Apr 2022 05:28: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.web12.20733.1650544098141888200 for ; Thu, 21 Apr 2022 05:28:18 -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-439-aaPLL6FGOeauIpmKCnzBSQ-1; Thu, 21 Apr 2022 08:28:14 -0400 X-MC-Unique: aaPLL6FGOeauIpmKCnzBSQ-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B97D480346E; Thu, 21 Apr 2022 12:28:13 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23C2A20296A5; Thu, 21 Apr 2022 12:28:01 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 52BBB180086C; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v4 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Thu, 21 Apr 2022 14:27:54 +0200 Message-Id: <20220421122755.1436026-6-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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: S2cxDiZuRJ6OAo3amix5f0M1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544098; bh=DrNOX9Re/kPrepEntT4+fSaKFMqCvdlWWFVVDEHWycM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mjqwidieCBuAQn/BjXUV8k47LjcLGcLY6BC4gPUZwgBwdxliWFFouzlO1GxMSvEMVX5 JcbjiyT68OET+C6RWjEpqvPfRMyzswX4okAJC8zYWxrjaF64r3Z9Tg7rPLgwsrO2KrkEt zNhOUVnKjPQKXLyVrscvQoLjfHleiZDN92M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544100087100001 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 (#89192): https://edk2.groups.io/g/devel/message/89192 Mute This Topic: https://groups.io/mt/90604438/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 Wed May 15 03:47:10 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+89193+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+89193+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650544115; cv=none; d=zohomail.com; s=zohoarc; b=PxHbC756oM6TR4mBDoez0wkXlEGHiSmm6UlIjZ4+0JZkTnzxximS5NgPy3mtA604TSbUhJ0p7rxE31txUBnQZ1vbtAy3YnLypQ6rV2/L2ovdikUZVaHw/ylgFiSnYtKwOHbNQyJumZEvtwrEtuny6/aJnLTjB1A6iF+vH4x76+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650544115; 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=mZj3xciwQGGMRmCmtRe9BJ3MAqeew9RAtq2ncf5ofKs=; b=jWAmWshgt/O7dJA/5z3OPZPEL8cTUtAhlKuCORIzXqMzo096dM5+xUC1d75/eisJxdV0NC+sCPtkMpjTOFU5yMjPtynMCurrTI5e3BCa8BJTho/3vG/O2fnIDfgyvGzhHtbY7QEbn4EAGTlAQXVTy9nfbTq/DNg/8odRNqzbbVc= 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+89193+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 1650544115283467.2816874608392; Thu, 21 Apr 2022 05:28:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VHjPYY1788612xYaQPKq3Hwz; Thu, 21 Apr 2022 05:28:34 -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.20631.1650544113820439799 for ; Thu, 21 Apr 2022 05:28:34 -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-153-mBJvhQvsPaeZe9jIW1RWWA-1; Thu, 21 Apr 2022 08:28:30 -0400 X-MC-Unique: mBJvhQvsPaeZe9jIW1RWWA-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F67D85A5A8; Thu, 21 Apr 2022 12:28:29 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD795111E3F2; Thu, 21 Apr 2022 12:28:20 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 569111800935; Thu, 21 Apr 2022 14:27:55 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Gerd Hoffmann , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jiewen Yao , Jordan Justen , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v4 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Thu, 21 Apr 2022 14:27:55 +0200 Message-Id: <20220421122755.1436026-7-kraxel@redhat.com> In-Reply-To: <20220421122755.1436026-1-kraxel@redhat.com> References: <20220421122755.1436026-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: TcAM99gS8rAy4K6MZY2D7hPwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650544114; bh=29mXY1X75RiptHY3dICanWn1arrW9Mx1GA+fYd+YGlg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=rAS6qhft4zM06sxngo2uz1fcCmc6Majmr1gCNzk4nBDHOUmYk297t6JiY2urUxXZdrS 7a43UTYC/7TUufU+2d64JMKsx2wJOJj8T442IUrPlUpQRgxNs56pnpcuRb8EGB5Aeloyo kXkC5Qnx1zTNWhy7XaPt9BE3r2MLieM6khA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650544116199100002 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 (#89193): https://edk2.groups.io/g/devel/message/89193 Mute This Topic: https://groups.io/mt/90604446/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-