From nobody Thu May 16 05:01:35 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+89211+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+89211+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650613041; cv=none; d=zohomail.com; s=zohoarc; b=Yd/18cYczkmprO7tQIPGJ/6YyjA8UbAWrpg33fT0EIbeXuZJTbMh0uZ8PA5qL2yOkupsheVA1uUNzFeFBdy9YOZmMH86zIpyss0oF7M9pK52nuz1GKtqlF2MP3T1SovaDO2krVfx663CmUKv5xDTt5E855iBbzBCkyZwWE38YVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650613041; 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=SkZhjilTPsT9hJ6p83vTwq6gsYtZW9V3pzX7N59lbYY=; b=L1/W1IfAaC3IQSg0iaJUMd1LgR7XegCDMUykcgaXlJ/BiUE6HR0skcn5I6wTdzVojHmG15/zg02oMKtWMveKl+arCWoZ5OQwqAhflu2b35Uc3EawCvxyyFV1QprQUeSjh1SzbIFVk0yq77aHntM1gHdlB5eNRCG1f9Dk6pR2MHQ= 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+89211+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 1650613041825610.6575172338373; Fri, 22 Apr 2022 00:37:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id C6g4YY1788612xoO6vTHqODA; Fri, 22 Apr 2022 00:37:21 -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.5858.1650613040269708136 for ; Fri, 22 Apr 2022 00:37:20 -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-177-JQ55mg7hOn21MGbBIBOGUw-1; Fri, 22 Apr 2022 03:37:16 -0400 X-MC-Unique: JQ55mg7hOn21MGbBIBOGUw-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6592185A7BA; Fri, 22 Apr 2022 07:37:15 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88421416178; Fri, 22 Apr 2022 07:37:15 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A35F41800623; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang , Ard Biesheuvel Subject: [edk2-devel] [PATCH v5 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Date: Fri, 22 Apr 2022 09:37:08 +0200 Message-Id: <20220422073713.2087781-2-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: UejyHrKbnzT8Q5KQYLJM1m1fx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650613041; bh=VB6WNpP3Av2HIoGx8qnVYe0bXZ6UbmNMVfAihrvyb9c=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=SPgXF8Tq98jMhO9kuje+qqojfL/N5T8D0/BzNrt26uO971MMTvUSNfUupPcBze0EAHX fqlhYyBuTzPjjk72pu8e4znCKjCsRSmVJ37Hu1IG0+heZZkqCRgZMmwzAKujTY0y6PF8O 3SA+LBm9gaNOTYvsR/R5KvMbwaQhPFn0gM8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650613042750100001 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 Acked-by: Liming Gao --- 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 (#89211): https://edk2.groups.io/g/devel/message/89211 Mute This Topic: https://groups.io/mt/90623478/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 May 16 05:01:35 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+89218+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+89218+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650619208; cv=none; d=zohomail.com; s=zohoarc; b=QW3ebwLvLcmO2sHvt0vj981HDkA2iHMdt4NQaWfscmJDgkU0qNIFsUQT2YmreKfOXFlJhHgOt1MvK2mLyHQx/iSpfmOKVfQVwSLl+b7P3PtPXnq6VQHtDKJiNrlwRuc1X4ecAcS6vQCZ+FuzT5W3XNqR61mCawbIwRpDzPgs+so= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650619208; 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=+uqw2/09GnXuqK4kfTCjeZvspHn0bunA/ZPITZ1kRoU=; b=CCO4szQ8ZvqXTXBf7kzqr8FPl+3A4Ek68VMaU913LLRfRE80dKknhRxhiRx8FxIVzDSNYAir1OnCq902vo+4OkRCZ+YGktpeoj0+EN9Kdgj2aqVezvCitXy6nv5PVReqPbhDgDmxkLd/h426oIgSOhhmEx7vRJlr+4wptc4D+9o= 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+89218+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 1650619208219263.13335483128344; Fri, 22 Apr 2022 02:20:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xk3SYY1788612x4dotyLKOaa; Fri, 22 Apr 2022 02:20:07 -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.6498.1650619206564877973 for ; Fri, 22 Apr 2022 02:20:06 -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-323-4ec9sZF0OXG_DOS2FW2yXA-1; Fri, 22 Apr 2022 03:37:17 -0400 X-MC-Unique: 4ec9sZF0OXG_DOS2FW2yXA-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 500A91014A62; Fri, 22 Apr 2022 07:37:17 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C005414A7EA; Fri, 22 Apr 2022 07:37:17 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A8E981800790; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v5 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Date: Fri, 22 Apr 2022 09:37:09 +0200 Message-Id: <20220422073713.2087781-3-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-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: KiKgj9bwEl6hyD00TybgvXTYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650619207; bh=0tSEMhyEngQU7eTCwizhcMbVW1VFj1EhwYYo+5+ZAYQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=UzJBAPvGv0Dbx6SwLNEt9+aoqGnkFiFCoeKeuNu6f2l1bvg80xi+xB9yypOvYcHilCD y+WFLKbVCPQwcsbtWDmO1z0yYG894Njsgsx7h3MhnwlVcISfeu7VXmtlnIJONBHEFsgNp yvyUQ08/I01Ht13GqVwki8+6wu1QfOb9I4U= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650619208956100003 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..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 (#89218): https://edk2.groups.io/g/devel/message/89218 Mute This Topic: https://groups.io/mt/90624445/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 May 16 05:01:35 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+89215+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+89215+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650613055; cv=none; d=zohomail.com; s=zohoarc; b=IFMWsynSo/fHwTFEHTV77tKcXr3DcAFgFf2gXtloHbl97lWBPmNzFHk7KxrM8dlt0pW3q5+IMVxgIdCWekjvCXJg8c/TInR+x5rEOEUN7uY5aZ3bLLHC9fxiZyrzbNu1HjtGTCCdactWFpC5ZWSrCE0m13Lq9ovbz0jHMYwRPoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650613055; 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=1675/VcEyVkikNK8cOR3symoNYjhHZlFdKZaKyGSZxw=; b=HlfuXWh2DiabXSxq1rdRtz7UA9ES+Dnrxr1AL32Njw5aIYS1k3FrzZXh7fEYrDH7TvefRrPU7HMNVk8StNggFz8teawd5EOs7B0p8glJssotzy2KkDcukLI1YPOXqzajIiAhrIEbjf5x4I6Vt4bvOGBEqOOn3qayBBDFfpGMYVE= 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+89215+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 1650613055954287.5580836517379; Fri, 22 Apr 2022 00:37:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id g2chYY1788612xqJoO2UmrRi; Fri, 22 Apr 2022 00:37: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.web09.5680.1650613054305445902 for ; Fri, 22 Apr 2022 00:37: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-554-aBgS1xztM4mDiXAJxsJEOA-1; Fri, 22 Apr 2022 03:37:29 -0400 X-MC-Unique: aBgS1xztM4mDiXAJxsJEOA-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1E2980B710; Fri, 22 Apr 2022 07:37:28 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5329C9D7E; Fri, 22 Apr 2022 07:37:18 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id ACA6D1800795; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v5 3/6] OvmfPkg/Platform: unfix PcdPciExpressBaseAddress Date: Fri, 22 Apr 2022 09:37:10 +0200 Message-Id: <20220422073713.2087781-4-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: yifjDO8ah8m47GR94iZnDiftx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650613055; bh=0vo1HdmR7LVB/+JE/bY/+W9AF4GYXCS5uOLzTyIcFag=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=KxcqZ8gPgmFQJGegnSI1jUUcMycGOm36gucqImukM0jU8oolHt0GC+w2NOiHPW1Xfm3 HxtEVa9+uVpkqu3PTwm4oyRnsdayobh38nRE1wjW1QtEaw3xWGEtQTQQhoT1qYp/f6jl2 TJIAUoxEIJmAtnZYFaixx+t3HPcXjigYL5k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650613056887100001 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 (#89215): https://edk2.groups.io/g/devel/message/89215 Mute This Topic: https://groups.io/mt/90623483/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 May 16 05:01:35 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+89212+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+89212+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650613045; cv=none; d=zohomail.com; s=zohoarc; b=I8zFCls67/mNBegRjRDLgnqARi8OdT2DXkXajyTbOOLkT7KwcOmbHfTJtjVSpWc4ti3PXNBO5LI5pcRpgLgG+R/wVK1ix+rLTeEE14/ADElSR5vG3pNiZnQhaxPDOCuitlMh8T9epMq66UEUMQ9csOEz+vUW51hO4XdDlWpGbJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650613045; 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=+RQFQOsfFWFSDgr85/zhpT0NeM/6eey0HgvttOzhbnE=; b=GFzbJXBV+xsWsD3vE8+tXwsy+H/3VX8qpg4IqbysRfOx0rtSb228QEUlfdxujEtsS/z0EiEW6jpeOEfSz189o0S/6ii2KAPhMZWjbvBoelTDjJzWg1ZjG2kRzV9/yG84z86/qhllQ0wNzX/XKCBn2Sblk9ee4xAi0GfYSWMwiio= 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+89212+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 165061304593358.63430160038706; Fri, 22 Apr 2022 00:37:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DfDrYY1788612x6Ztcvhjtlr; Fri, 22 Apr 2022 00:37:25 -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.5859.1650613044204266168 for ; Fri, 22 Apr 2022 00:37:24 -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-347-KPFQBrSZOwGt7mhXB5PXhQ-1; Fri, 22 Apr 2022 03:37:19 -0400 X-MC-Unique: KPFQBrSZOwGt7mhXB5PXhQ-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 BE7413C10AB2; Fri, 22 Apr 2022 07:37:18 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DF73C33B1F; Fri, 22 Apr 2022 07:37:18 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B0BF21800915; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v5 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Fri, 22 Apr 2022 09:37:11 +0200 Message-Id: <20220422073713.2087781-5-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-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: 3CNuy47FbUEDNGhuftNhSfqyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650613045; bh=bsklXsiNQTGBfv/cAJZGsEoocsvgqfuTR4SztykqcKQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=EoRhl71Bn7ihp2+vyems5Q1FzNM5XKMX42dlIj9s+nB/LKBAvR02ABxIxbyuq1eAFou 3PlHzuLJIDWJGpB+QTjfZae2gvzHlhVEULooLbg/dQlW/VEYa9uBuC3MoN3+MCWSdJtmb bu2GiCdo4AC9M7Tu+z6vySsNQ9SRzAzjT5w= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650613046997100007 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 (#89212): https://edk2.groups.io/g/devel/message/89212 Mute This Topic: https://groups.io/mt/90623480/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 May 16 05:01:35 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+89214+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+89214+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650613047; cv=none; d=zohomail.com; s=zohoarc; b=VuRwA7u9fjIWHNKKkyO0hOT7X05QwjpvX+zUTaLwt+moWa4NW7hEoY4tzCi+UppaOAJ6XVF5jJ2fEW87f3sjNarEv9rtTyBQ+wft1AwPwexC4opmP3+000l1Zk6B6iKZjsAWYxZvix9a5BgElt02DiqO8BM1rKIqwaQNkA2QEJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650613047; 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=w02H5obQUAnRBfaIwL0vRyiUWTIS46ti9FNG3BdaEXY=; b=iT6w7xUPECOLf+SeMb1eiUM5ByGg3O6XHEYAJtLjxOZazXQzxv+SUyvvffMBNqhKLucxsq8870BgPz6k7+eaHKm0hui8kULIq1VtCht2hwk4HokTVmCJ5p1QH+4wSj3OHNMlulTenRbzMOh/eetInJHqN8rjn5mnXqk7tmzKdaM= 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+89214+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 1650613047731688.0112168070128; Fri, 22 Apr 2022 00:37:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6cqbYY1788612xSBO4gJXgCu; Fri, 22 Apr 2022 00:37:27 -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.web12.5860.1650613046831784106 for ; Fri, 22 Apr 2022 00:37:27 -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-290-KuQ7qZGjOUCk_LIiGes_Mw-1; Fri, 22 Apr 2022 03:37:20 -0400 X-MC-Unique: KuQ7qZGjOUCk_LIiGes_Mw-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 514113C10AB2; Fri, 22 Apr 2022 07:37:20 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 191FCC28119; Fri, 22 Apr 2022 07:37:20 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B47DA1800987; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v5 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Fri, 22 Apr 2022 09:37:12 +0200 Message-Id: <20220422073713.2087781-6-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-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: HdkzWaw7172u0GH0Bfx5ljodx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650613047; bh=DAdTJSlykjerSPEw9H8qSxMLdTmy+0Pb85JjcW0aFu0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=om+12rsAUIRrqF382Mmf5T9zFoKjCSSUE/l3CJj/LkErHz68D921IlXtvKLpIH+Pa/C LYGzAlSHEU2osYd5xBEbGialbGtiG34Lqg/T1khhdW4Kf+TZNpKSlFId1CErJguHiW+w7 P0SxoLD0Iay6Lmsn4IpdJVVgtuj70WQq3Vo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650613048769100013 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 (#89214): https://edk2.groups.io/g/devel/message/89214 Mute This Topic: https://groups.io/mt/90623482/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 May 16 05:01:35 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+89216+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+89216+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650613094; cv=none; d=zohomail.com; s=zohoarc; b=INm82iFnJjLdsoSc5nfZtmjNGQ0y66wguMFgYJtMANXAF3g+Vx/WaLBHLg9BFdy0JWK3tjacyITfufrnxNoFjHs2Sweo0K8sh0ewXxV3WZ8z3H8WyN/4zvw0/LmRtuQSdVuKs5pVo1IFgIjSjGQUUREmWME3RJCiTE7LJLNh9XU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650613094; 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=ZuhjmgHSr/ANTKzADwQtTfd8johu8B84Tvb7zsHjCQo=; b=fj6xrcOG55U1d0BhrNsycu1+Zlvad+ahvvRi6CpglgdCXd6FzvyepvJeHFb40I7MlgWbJUJFsWzUFeaDGLthDTjV3SdF2n+yn7DP1cHnpJiBV3Uy0jtE9IgDLkwR63vlxY1b0nqAXdSdyQ/E0jYk2K4t537+Rwn4wy33Z7QsQrk= 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+89216+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 1650613094930280.55344942910256; Fri, 22 Apr 2022 00:38:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NA13YY1788612xdl9JogFNkB; Fri, 22 Apr 2022 00:38:14 -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.web08.5668.1650613093666690551 for ; Fri, 22 Apr 2022 00:38:14 -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-531-Rg45zh_mPKiVAVeQnlq0bw-1; Fri, 22 Apr 2022 03:37:29 -0400 X-MC-Unique: Rg45zh_mPKiVAVeQnlq0bw-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A24E1E13789; Fri, 22 Apr 2022 07:37:29 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E2557AE3; Fri, 22 Apr 2022 07:37:21 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B83F8180098B; Fri, 22 Apr 2022 09:37:13 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Ard Biesheuvel , Liming Gao , Hao A Wu , Ray Ni , Oliver Steffen , Leif Lindholm , Jordan Justen , Jiewen Yao , Gerd Hoffmann , Abner Chang , Jian J Wang Subject: [edk2-devel] [PATCH v5 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Fri, 22 Apr 2022 09:37:13 +0200 Message-Id: <20220422073713.2087781-7-kraxel@redhat.com> In-Reply-To: <20220422073713.2087781-1-kraxel@redhat.com> References: <20220422073713.2087781-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: gKAcpMXvNPYFTTimniuc2urox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650613094; bh=mUqAfQzvFUqnLCT/LeIVg3Hn/4VonFU5xFiYRhi6Gus=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JfPilxHYMgTJKMRi2zuXfjyt4DkU5yUU2Zk2qiTmBIH76+xZJbsGWOpTjJQ9PqO8PV8 zluew8s660mrhNsvm0wlgtHpZhj2SRiFJPBalmqYh2nLy5X26Y/QGPPN/MILAlflobwIQ IH88Bh1+PZB4jb1AIyo+9pOr7pbcR47PfnI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650613097315100003 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 (#89216): https://edk2.groups.io/g/devel/message/89216 Mute This Topic: https://groups.io/mt/90623485/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-