From nobody Sun May 5 21:08:06 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+84976+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+84976+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648248; cv=none; d=zohomail.com; s=zohoarc; b=l0p92J9Wsb+sp+ub3B1w05tVW0tehPpGrK98fNE5REM4vAI++0mmFnjFki/D7vbq3XemCGmWk5xICGZdzkuPrwtK284UH1oIE/uUQgOLn2avlH4+Sg2gSvW0tFDAbp+7vl1MfI3dMXZiFSSHLO9NWK+xd/WTej/CSjEz5WrMMV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648248; 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=1pfG+fT1JOENqyeWu3Y0l9q8SfyR0I8kC8awqRh/j9A=; b=DmsEhGuUXmcKIzMjnPNDR80Yz+THK9EXjRU/TSrjyEWDUlcOZr/kmIbuiqdlYfu955xW6ibRoCGj4TTUxT8ELv+1lO8vHjf6IJEFJal3+3VrkY+Qjf5VAqXZoza5cmtMi39l1p4dJWo7D20QugC5wE2+meoTcedl3kZiS4YMaqU= 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+84976+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 1639648248407926.0119774923774; Thu, 16 Dec 2021 01:50:48 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id lhAKYY1788612xy2h2pKbT0v; Thu, 16 Dec 2021 01:50:47 -0800 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.8733.1639648247049157176 for ; Thu, 16 Dec 2021 01:50:47 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-232--S_DLNqmMxqSswIm5_7q5w-1; Thu, 16 Dec 2021 04:50:42 -0500 X-MC-Unique: -S_DLNqmMxqSswIm5_7q5w-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78ED3100CC87; Thu, 16 Dec 2021 09:50:40 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7E672ED60; Thu, 16 Dec 2021 09:50:39 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9309318003A8; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 1/6] PciHostBridge: io range is not mandatory Date: Thu, 16 Dec 2021 10:50:32 +0100 Message-Id: <20211216095037.1843149-2-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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: 0clDbXFnxxLmzHQCbQC6t9nZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648247; bh=8dfTanmgfv5ihXZRaf9z2ISYnEjm4W2YASTies+qyuQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=DdXgMxLfPYz1jBEArWF32NKzKth6oXYiKgfmdUoD5M1cgr8XVLtHtTLNnqp5wqq7wVp nj0N9f8e+mYsZS+3BeyNsna1ZdxxgosX2SxVLn3o2FK1+fZh7SpQuaNuNVWJkvHO5fxfn gQbYPwy5i1h36foOuBIBsUt53c36gJTMqS4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648249733100002 Content-Type: text/plain; charset="utf-8" io range is not mandatory according to pcie spec, so allow bridge configurations without io address space assigned. Signed-off-by: Gerd Hoffmann Reviewed-by: Ard Biesheuvel --- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeMod= ulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c index b20bcd310ad5..51a3b987967f 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c @@ -1085,6 +1085,9 @@ NotifyPhase ( RootBridge->ResAllocNode[Index].Base =3D BaseAddress; RootBridge->ResAllocNode[Index].Status =3D ResAllocated; DEBUG ((DEBUG_INFO, "Success\n")); + } else if (Index =3D=3D TypeIo) { + /* optional on PCIe */ + DEBUG ((DEBUG_INFO, "No IO\n")); } else { ReturnStatus =3D EFI_OUT_OF_RESOURCES; DEBUG ((DEBUG_ERROR, "Out Of Resource!\n")); --=20 2.33.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 (#84976): https://edk2.groups.io/g/devel/message/84976 Mute This Topic: https://groups.io/mt/87764063/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 Sun May 5 21:08:06 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+84982+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+84982+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648283; cv=none; d=zohomail.com; s=zohoarc; b=Hqw01kuFR1zrOkK60pf2RJeN99WhFDVR5oDz9FZvKUJhVH7xWFBO1hs8HJsLkRxc4n/Fi0dRNjEbERrx3EnyEZUw5yosby8dADKYiDM+sjTUGZPYenh7EsGouQropsIM/KBJttrZEFXikWrDVAhRSPOvML4qzh6NhBQFuBCL4HU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648283; 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=NxU8RY3pnhF1F1yzo/E4Psl8LqjMJFAREeQCWKKByYc=; b=TePHZ8uL7Nr01jFf6miWIVcT3FvGmiyv0henD+7b90DQjVQrRVDcztAcspT7JS9+jlGPFoHBzPo0XCr3hOL9PgcMMyX2i94oBqaEGmWFzH2eWYoLUCtYUHTgEqvlUsqRAowVP1qbk85+GX2lyK+Bb7c28avA2KVTxzqfSKC48uQ= 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+84982+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 1639648283719579.5903076495779; Thu, 16 Dec 2021 01:51:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id TkflYY1788612xiqBkA6R9Nc; Thu, 16 Dec 2021 01:51:23 -0800 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.web10.8800.1639648282665757929 for ; Thu, 16 Dec 2021 01:51:22 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-452-jrhZybWlNHu0Jnh0VWo5uA-1; Thu, 16 Dec 2021 04:51:18 -0500 X-MC-Unique: jrhZybWlNHu0Jnh0VWo5uA-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1284F81CCB4; Thu, 16 Dec 2021 09:51:17 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8B5085F0B; Thu, 16 Dec 2021 09:50:43 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9894B18003A9; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 2/6] FdtPciHostBridgeLib: io range is not mandatory Date: Thu, 16 Dec 2021 10:50:33 +0100 Message-Id: <20211216095037.1843149-3-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: fkgTn8qGiSdBd960X3DAB1cux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648283; bh=hr4Q/dFGD14VLk2VwN4OGiC86SwNVmv7PzhMRZ9cLJ0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TZYS9bcTVgD3mrRnILOioSpZupcSdA10efid4k+zMmD7FOsPQwAWIUl2sbHJk5Mx59F xltVmwXvKSrsbqfhX2BBZw3aN1E3J/kLV01SsLWgP9GSSo0w+32lh2pFzhSlB2MvEkk3q /Fecm5qdb84oBkregC+1UhjPRa1rrU2/Dmo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648284156100002 Content-Type: text/plain; charset="utf-8" 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.33.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 (#84982): https://edk2.groups.io/g/devel/message/84982 Mute This Topic: https://groups.io/mt/87764074/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 Sun May 5 21:08:06 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+84978+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+84978+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648255; cv=none; d=zohomail.com; s=zohoarc; b=XldUgiTBgtFg93omfb4UOxpbKmPk8RK096zMPUOy+sPw73UnG/PxQGfaQiH/71TaJW9a59YcjIFHaA83SlJsLbTYBHDpM7mDZ572Lt9Kv8T0O1DasCDuJV51nbWDlXPKmm1/2l0ar0a3I35ZAA0HWSEba9fRhB+MCsN8EPjfUa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648255; 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=iN7A+StXWDlCuA057nF8CCw2S7F394k2z+oN19WLjH8=; b=TsIo8Zah+M95BjFb34qGEP1JbToj2P18JZ0djlHpC3zM5+GGgz2FJbhzBYVJy1MwjkPktKBbeCiUuJGgBcgF3a7PeB37ClCL8Y7HABwQg4Vws0ARFhqo6lZUMVU3aJNTxCbmDH2EajVGQtdNTQPSxY/Zexcc7TZSyrZbfNnxdyg= 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+84978+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 163964825580135.77765305191008; Thu, 16 Dec 2021 01:50:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id NKVjYY1788612xOtugQXkemo; Thu, 16 Dec 2021 01:50:55 -0800 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.8719.1639648249608716433 for ; Thu, 16 Dec 2021 01:50:49 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-njESkJJIMVG05SBdPdcpcg-1; Thu, 16 Dec 2021 04:50:45 -0500 X-MC-Unique: njESkJJIMVG05SBdPdcpcg-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03CC11934100; Thu, 16 Dec 2021 09:50:44 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A77777A40A; Thu, 16 Dec 2021 09:50:43 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9BADB18003B6; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 3/6] OvmfPkg/PlatformPei: unfix PcdPciExpressBaseAddress Date: Thu, 16 Dec 2021 10:50:34 +0100 Message-Id: <20211216095037.1843149-4-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: UROEJxO6JMU9TvbrJ7jEX91fx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648255; bh=qMWeOsEoEpe0vnEM/vgIMpdBjTyhpsANZjMc4p3m8YI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=q4RclU2Gmk/sKYarBBMrGNl2YShzsY5TGhRBK3xMtE+GWhgKBv40Zpj7ROHBrbrTd1H NsclmhgAO9HPBS0eH3Hy8+FU/xveDtq32v8hzWRzDLrm1MFCSHo+eTdXHjmHguzWVg0Ji +ocfV6HmkHV5TU51M7FFEiD3JRMukC385ns= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648256602100011 Content-Type: text/plain; charset="utf-8" Will be set by FdtPciHostBridgeLib, so it can't be an fixed when we want use that library. Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/PlatformPei.inf | 2 +- OvmfPkg/PlatformPei/MemDetect.c | 4 ++-- OvmfPkg/PlatformPei/Platform.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 8ef404168c45..44bf482e855a 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -92,6 +92,7 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved @@ -114,7 +115,6 @@ [Pcd] [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index fb38e3c39d8e..81378eaf9b4c 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -154,8 +154,8 @@ QemuUc32BaseInitialization ( // [PcdPciExpressBaseAddress, 4GB) range require a very small number of // variable MTRRs (preferably 1 or 2). // - ASSERT (FixedPcdGet64 (PcdPciExpressBaseAddress) <=3D MAX_UINT32); - mQemuUc32Base =3D (UINT32)FixedPcdGet64 (PcdPciExpressBaseAddress); + ASSERT (PcdGet64 (PcdPciExpressBaseAddress) <=3D MAX_UINT32); + mQemuUc32Base =3D (UINT32)PcdGet64 (PcdPciExpressBaseAddress); return; } =20 diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index d0323c645162..27ada0c17577 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -171,7 +171,7 @@ MemMapInitialization ( // 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); @@ -302,7 +302,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.33.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 (#84978): https://edk2.groups.io/g/devel/message/84978 Mute This Topic: https://groups.io/mt/87764066/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 Sun May 5 21:08:06 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+84979+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+84979+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648255; cv=none; d=zohomail.com; s=zohoarc; b=drD16W/xW+TSHuQjkFGLAWui2/sDrf22dpAKZ6MkueHotv3J5tjfFTxwKe0VFsw9KF/EVjJh6ut3VxKu3Jma61+RyI62Q2iosz/EcHFNejvApJ77U2drtmeaV7jS26JxGlH5MaBBbciirOtyasMbWXeMapgDmVFq3kNm6L7a+tM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648255; 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=QYHn0BtWEiztO0V3diq8utv5dks9/zmjb4k26fAOuaM=; b=MJL7sEGyukuYbeiBv3YQV++Wf5JSkarQucGApshk04yj7OH979+h8qH6IqoDAFlWwhpKozt52lIA2oYGJMwFZxl7ZpIpfsFllbSV1j3MDuVRcrW+1l2pD6zAYyxpSPMkoN4zUGy/U0Q6W2cfMSFS4KdPEydb+cW48HP6nbuQBH0= 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+84979+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 1639648255443757.9712649519117; Thu, 16 Dec 2021 01:50:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id waKXYY1788612xDEV9VZjAWu; Thu, 16 Dec 2021 01:50:55 -0800 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.8720.1639648254451790964 for ; Thu, 16 Dec 2021 01:50:54 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-f9-h5ZyfPJCxgfuL6VsTTw-1; Thu, 16 Dec 2021 04:50:50 -0500 X-MC-Unique: f9-h5ZyfPJCxgfuL6VsTTw-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81794101AFCF; Thu, 16 Dec 2021 09:50:47 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FFE67A424; Thu, 16 Dec 2021 09:50:47 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9EAE118003B8; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Thu, 16 Dec 2021 10:50:35 +0100 Message-Id: <20211216095037.1843149-5-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: ZYDPNXw844LFZZ8KA3CmiW3px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648255; bh=s8YCub3Xyg6nW7dSvTu1TRA6NVqvYQo22VFE0YUEQ4Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=FPqMIYUnB53lB9LmqRmY7r0ZLUluRWdaiZkCESa2LWgGQVXorm//Fo09haBn+fO72Xn atOGXt4ccuQ0O51JMj9lR3/TXNMUL8l+ZPwYTpUyyE5ZInBVyN/LazbPpmM2M4u4otkZt wniv3LRB0cZySH56Yp5kIv2IpihZJ902MH8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648256586100010 Content-Type: text/plain; charset="utf-8" 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.33.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 (#84979): https://edk2.groups.io/g/devel/message/84979 Mute This Topic: https://groups.io/mt/87764067/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 Sun May 5 21:08:06 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+84980+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+84980+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648256; cv=none; d=zohomail.com; s=zohoarc; b=XKLF+Stgk3PsWABkFqlBxo52plLR+zvHUW3wuiJiHOFWS1ufMTcfvsbJv7/VQzXLQicZsH6E45089Y+DG3Gz3t84dGjRCLfGcZgq8vh3dZmkOOGFUuk0O+vQ0hR9bhyct404RLehoXBJAY1usKC0bea/X1g6hSylGKNJ7ZCnz4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648256; 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=ONucoMjqlIcMHtMq1dKx84c2UoK3KjhsI0U2CEW+H2A=; b=hWae7/0Ls+BkGFIjT8AXSlRc6wgg31tu8yZeEKQbvJKtCuvF9wDEQhu5Y8bWWHjkBTstRc6L5CCLm9FMrWgVvswNgpnD00cGKymOXfivO5fa6NPilBtv0A+vqXBoCjzV6aL4eRGnZX0w0/pPM4vnOwqerPR7gM9gRk89hvfz1WQ= 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+84980+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 1639648256386632.0488176865879; Thu, 16 Dec 2021 01:50:56 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id f0EcYY1788612xnimfsSVtru; Thu, 16 Dec 2021 01:50:56 -0800 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.8683.1639648255239899263 for ; Thu, 16 Dec 2021 01:50:55 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-XjmxlACRNuSuArCVOjCfWA-1; Thu, 16 Dec 2021 04:50:51 -0500 X-MC-Unique: XjmxlACRNuSuArCVOjCfWA-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03D77801B0C; Thu, 16 Dec 2021 09:50:50 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF1CD2BCC1; Thu, 16 Dec 2021 09:50:49 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A218018003BC; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Thu, 16 Dec 2021 10:50:36 +0100 Message-Id: <20211216095037.1843149-6-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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: 91mMREJ54vOc3s2cgxUzuhIIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648256; bh=aRcH3E4ZT8462mVTG2FHWLuPLUjA0bWUTh5QX3qCazQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=O9WEOWd93GHX6FyjQhUC+bB5PKxFdaPgGIPnQRqnWCHRCdgRt+zUnvhKzNj3K7mTu/G 0/kKewjl0arbyAfUJfm+9yBxj+NYNGlfuX5DEMRBvnfU9WUm8WQe+YkV9+NuIWQA6n14q GY7ekPZpat4yKgHgGLbNCHHYNgiCwmtee5s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648256681100016 Content-Type: text/plain; charset="utf-8" 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/PlatformPei/MemDetect.c | 21 +++++++++++++++++++++ OvmfPkg/PlatformPei/Platform.c | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index 81378eaf9b4c..ba8f2d4b3269 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -508,6 +508,27 @@ AddressWidthInitialization ( { UINT64 FirstNonAddress; =20 + if (mHostBridgeDevId =3D=3D 0xffff /* microvm */) { + UINT32 RegEax; + + /* NOTE: microvm phys-bits are reliable. */ + AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); + if (RegEax >=3D 0x80000008) { + AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL); + mPhysMemAddressWidth =3D (UINT8)RegEax; + } else { + mPhysMemAddressWidth =3D 36; + } + + DEBUG (( + DEBUG_INFO, + "%a: microvm: phys-bits is %d\n", + __FUNCTION__, + mPhysMemAddressWidth + )); + 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 27ada0c17577..b8cc0c31dd64 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -821,12 +821,12 @@ InitializePlatform ( =20 S3Verification (); BootModeInitialization (); - AddressWidthInitialization (); =20 // // Query Host Bridge DID // mHostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); + AddressWidthInitialization (); =20 MaxCpuCountInitialization (); =20 --=20 2.33.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 (#84980): https://edk2.groups.io/g/devel/message/84980 Mute This Topic: https://groups.io/mt/87764068/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 Sun May 5 21:08:06 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+84981+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+84981+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639648262; cv=none; d=zohomail.com; s=zohoarc; b=cuuzWSoHiidCWevy3TA8WUM+Lei3FNdnZvIsP/h3qceqzyVIN2dl2fs59o5MZOpAMlBlzORCXfy4LQbYQqAjVhJHkkqriAvnDUeXkDzgJD0+Lvb1W67qsxpB8KiXeDwwLe9GCACo5kC9KjONifP0vv3lGLNKSgq5Tf+fEYxvCZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639648262; 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=Q9KML2bIdanGfcqS0JFSNrnN2IJwQ/3Zb9RAd3pv6U4=; b=bXaE22IeIRr0btvG/zYRD3KyIgYxP3XRqX1W8lqM3tG6ncPQ+W0dd+WJPUkGRScuiBTwU2yMgTq1zQIO7Y0mJdz7pJhwuV0ZB0gR4ZxqWQySoXQucSROs6IHtsrcBxad5OKUSXhN5duEuPdzY59ALTWyXOXcFQ7Wcf1mqOnFgtc= 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+84981+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 163964826270455.114737800071794; Thu, 16 Dec 2021 01:51:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Va7qYY1788612xVgTlJnPcgk; Thu, 16 Dec 2021 01:51:02 -0800 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.8795.1639648261819992653 for ; Thu, 16 Dec 2021 01:51:02 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-57-qzfIllOMO1ONk6hSV88sHg-1; Thu, 16 Dec 2021 04:50:55 -0500 X-MC-Unique: qzfIllOMO1ONk6hSV88sHg-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDC3E2F25; Thu, 16 Dec 2021 09:50:53 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E82F7D3D3; Thu, 16 Dec 2021 09:50:53 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A520D180060B; Thu, 16 Dec 2021 10:50:37 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiewen Yao , Abner Chang , Ard Biesheuvel , Ray Ni , Gerd Hoffmann , Hao A Wu , Jian J Wang , Jordan Justen , Leif Lindholm Subject: [edk2-devel] [PATCH 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Thu, 16 Dec 2021 10:50:37 +0100 Message-Id: <20211216095037.1843149-7-kraxel@redhat.com> In-Reply-To: <20211216095037.1843149-1-kraxel@redhat.com> References: <20211216095037.1843149-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: J85hvQWPHkbVMPzFOSsRGGaOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639648262; bh=U9cNnd5caDQqsuop9c9pith6526wXxAk14upGWCN1XM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=GlVAunwGO3Nk7HLe1fVrY0lnWNWq8ezU9KpclNQhzrE4CaYZLETuIRHykZ5hy6d8JsN d3ZXlrExUUZAf9VlbuMy22nfK/XXQZvIpjL9PMmgzXvPuE+WVIG5i3Bu/h6SNjoFuP4XD 5SdI3xdqt7s1ElRXEnTYzA86k142xbQPqk0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639648263319100001 Content-Type: text/plain; charset="utf-8" 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 bb256fd3c640..ce6f3043f4b2 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -334,7 +334,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPc= iExpressLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf =20 @@ -351,7 +353,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPci= ExpressLib.inf =20 [LibraryClasses.common.DXE_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -373,7 +377,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPci= ExpressLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib= .inf @@ -389,7 +395,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPci= ExpressLib.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -410,7 +418,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPci= ExpressLib.inf =20 [LibraryClasses.common.SMM_CORE] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -426,7 +436,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|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPci= ExpressLib.inf =20 ##########################################################################= ###### # @@ -501,14 +513,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 @@ -573,6 +577,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 @@ -670,7 +680,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.33.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 (#84981): https://edk2.groups.io/g/devel/message/84981 Mute This Topic: https://groups.io/mt/87764069/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-