From nobody Mon Apr 29 04:42:39 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+85735+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+85735+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413714; cv=none; d=zohomail.com; s=zohoarc; b=mVhwWJ2bjrpxWr2gvwdsz+heXIfaMmtjXVBtbp3Vbbfo8FRhH83X5dk4wo18yAJBI9d9slX/GJx/hrDjqrvR+q60cPouv/vPqQsmtB84oWYbIFcLrMmkZjrQHY0pSvC6VIjbSccBC3pr131lPwrCRKy6IjDfb6uA9LAgczLSEUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413714; 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=iPKsGB/vpKN+hmxa07qTnyR6Vw10lytBFJ30unKPkmo=; b=SVLs9PyKSIuuUcP/GYVVJ1kLwHZcN/S7ei2sDlxoxvI9YxCUfG4UQrSUZlm/XfeLQq4THDXXlVu4pyAx+nzQMI9qhUvdjZ+SF2lBftjUEL9ZhMIH1mJP9ojKYalYDPlkM3zFgwN1afL3vkIzBBXdKblwB3S+A3a48jpimRVmvoU= 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+85735+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 1642413714365810.4727697177212; Mon, 17 Jan 2022 02:01:54 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id nBClYY1788612xeg7Rkm9MC6; Mon, 17 Jan 2022 02:01:54 -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.web08.9336.1642413713338616503 for ; Mon, 17 Jan 2022 02:01:53 -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-356-ge-4dvx1PDuobFFAKhyAlQ-1; Mon, 17 Jan 2022 05:01:51 -0500 X-MC-Unique: ge-4dvx1PDuobFFAKhyAlQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE6421023F4F; Mon, 17 Jan 2022 10:01:49 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A05C570398; Mon, 17 Jan 2022 10:01:48 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B1517180060F; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu , Ard Biesheuvel Subject: [edk2-devel] [PATCH v2 1/6] PciHostBridge: io range is not mandatory Date: Mon, 17 Jan 2022 11:01:41 +0100 Message-Id: <20220117100146.1965662-2-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: n3yZOA83jcfVwswBVnyOfypDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413714; bh=hi2ttSJbCjP5tbElo4BB0VFKpss4hBuf2J1/ef8d028=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=m0GnU49Mkrfg8F7M1yo0D1/1mVvYPFCzxynkexxkeVegRjV8boVLnHCVGe670cqyQax XnF+oSwyysXaycAIjjETPMB2Ugw1N+V7pAn3yVuRgfPYjhmrO/kkj9SQAj9Fvj7cj45kf d5I4rV5Kbcdn2umIRSryJekJnYB1UqWK/Tg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413715225100002 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.34.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 (#85735): https://edk2.groups.io/g/devel/message/85735 Mute This Topic: https://groups.io/mt/88481101/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 Mon Apr 29 04:42:39 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+85740+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+85740+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413723; cv=none; d=zohomail.com; s=zohoarc; b=MxUrKhF6K2r2AEcwOdFqUM54/zqUQSWCsaYa9iWDlZKVHIALpOncsh4zXhI1h4MkLHmD4/RhDFMASDnNXYLbyOiM8JZIb/+cZPvl1BOG5dU6r8t0GtfwE5YjeI7WtwARZtnG4iRa/7zg10L/hp+emUKvKdDeCPVLTYaJ50W4Bg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413723; 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=9N8vA7SFy0gXQe4E/MREYLorSXfaWpMvK62pmvj+mmk=; b=W6UiJDyBFi1Dcx2TlrJ0nnvAVHc9e58vJ8j2c8k+eGnJochh6CfbO0oCDYzT21A+XWp/jvdpvf2GF5hrGcwN5xVSqfo1DwXUhGdJx9IYzw1o++OKA4xLa4PkDOpyZ5MNLzfwCwm6aXyqaBclk+aLkTe4VOV38S5zWiq/B9zaMJc= 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+85740+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 1642413723196524.7863816371234; Mon, 17 Jan 2022 02:02:03 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4H4iYY1788612xLflNwGZwGB; Mon, 17 Jan 2022 02:02:02 -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.9394.1642413722122317624 for ; Mon, 17 Jan 2022 02:02: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-674-X1b19PE3MxOnn5cmXnpktQ-1; Mon, 17 Jan 2022 05:01:52 -0500 X-MC-Unique: X1b19PE3MxOnn5cmXnpktQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC5DA802924; Mon, 17 Jan 2022 10:01:50 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A95810246F4; Mon, 17 Jan 2022 10:01:50 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B70EB1800614; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: [edk2-devel] [PATCH v2 2/6] FdtPciHostBridgeLib: io range is not mandatory Date: Mon, 17 Jan 2022 11:01:42 +0100 Message-Id: <20220117100146.1965662-3-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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: swgz0rmt9cbxAoXUwUSrob9mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413722; bh=lU4yr/XfPa0ymSLdlbBho45vTeu8TKDZLpLoV/XrPd4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=n5ZMDIQszezSE8BRUdMi6mJKAxRzD+DF9SZiVUIQ8/hhhJ2RkrPaTxibiyzWZqSibZK JSZBUT0DLVDaTYUIqB1/lX2tZvYWNumpdg1yAwbQUj+1OkwMvH85FijGGKqqgxzGPWrVK 9anEYlKjHnKRYPK3wgofS2ZTHWdxJ0p7xEE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413725514100014 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.34.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 (#85740): https://edk2.groups.io/g/devel/message/85740 Mute This Topic: https://groups.io/mt/88481107/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 Mon Apr 29 04:42:39 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+85737+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+85737+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413719; cv=none; d=zohomail.com; s=zohoarc; b=L67XZCyMx6CclqOcAEddg/3ChQg20EWUCWPEkGpsbu4OiwsrlXvjliC6Y274M3EeK+VOsIntBTxm1KJ3fKZc9lSseRsy9xYTNRqkVPlvvsC2FvmjrEpCaqojh4MJ0BUG6pbzWv/riKm4dEqzgflljDROKxEjYVvKQKE7c2LIVL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413719; 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=MTlryMU59qFDGXM+3Ac1dgqBSvXuHJRWQd40TePeqvU=; b=ZYAvlD/nnP+3IU2xxzXZq86ZOlJ6asu8THNVBjjHk/ii50q6JcpmzrifUrZ5Q7IMmC6Yg3OTlC06Rx6VvcttJ/M9/K/U8BKAQ76dtkglbc0EOoRzBcpMM9fQt+6DkzX/2j4cKGxlSclV7dYK2XbM8OqXHyXgR1kYHo9rtuulYGY= 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+85737+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 1642413719619690.209360656568; Mon, 17 Jan 2022 02:01:59 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HffLYY1788612x8IMA9DiTeG; Mon, 17 Jan 2022 02:01:59 -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.9296.1642413718665484447 for ; Mon, 17 Jan 2022 02:01:58 -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-5-rpNmZ_tpPr-1jGeBF8jufA-1; Mon, 17 Jan 2022 05:01:54 -0500 X-MC-Unique: rpNmZ_tpPr-1jGeBF8jufA-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E34CE64083; Mon, 17 Jan 2022 10:01:51 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0F7370391; Mon, 17 Jan 2022 10:01:51 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C66351800618; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: [edk2-devel] [PATCH v2 3/6] OvmfPkg/PlatformPei: unfix PcdPciExpressBaseAddress Date: Mon, 17 Jan 2022 11:01:43 +0100 Message-Id: <20220117100146.1965662-4-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: Ltdxb5oaDBtyGfdCsdNwLz9Ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413719; bh=rQ+kEEwqIUi4bZzRbSaUbztCIH0TVB+u8iSPg5Rc0Pg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qh/9AF3fmqPg6LGIRQq1K1mHDHUJ63btoj17VV5+/n+hPCpaZ+F8IzUgoKnXK0+LIdu GlN4hmI6rsW6zvgGfhPkaj9R0yze8FIvBaSfJPOrZded47X8wIUcBF3/o+8Ec+vcTRKtt yFcXOTpEzmuloi11ZRNuNbs+LpwG/TUV48k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413720921100001 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 Reviewed-by: Abner Chang --- 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 1bcb5a08bca6..f87a6f48a1bf 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -155,8 +155,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.34.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 (#85737): https://edk2.groups.io/g/devel/message/85737 Mute This Topic: https://groups.io/mt/88481104/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 Mon Apr 29 04:42:39 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+85739+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+85739+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413721; cv=none; d=zohomail.com; s=zohoarc; b=GXjx8JZgqi/aUfMlNmx0yYMPwEfH27sGR26wneU+/0sdkuijVUJKDJfpP99QQneBGre4v7SHyIxozq5eGqRayReStV0FZWMd6IgfDkmMHPTfupBODgY8RkYWvkIK51SxT/eggwapttNp/nh4XYlMcm1NND72rW2coJ2ZThjYdJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413721; 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=aVj2stS2KvlrpgKbQ3n0Xg+Wr4NbtVzCwMAiGG1CWBw=; b=YQG04GJSRnxZjMN9bgnVJ+AiFQ0QsuBH5aaYi2pEV+SjKDJeU1dPJTTwT8pudkBzCQkPgW5KniT5sK1qXZy9eIOERQM3JRzueIS//VSMAbmApKarOYuli+fa6WSI6i2DKTP1qWNkyCMnZU5slP0KwEKJjnl0sLwTkuNBFIN9S2s= 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+85739+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 1642413721466261.0007372750181; Mon, 17 Jan 2022 02:02:01 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ksVMYY1788612xPiyhHmIFMY; Mon, 17 Jan 2022 02:02:01 -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.web09.9351.1642413720407327795 for ; Mon, 17 Jan 2022 02:02:00 -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-79-6tpe1olZP_C0o_lifGsx9Q-1; Mon, 17 Jan 2022 05:01:54 -0500 X-MC-Unique: 6tpe1olZP_C0o_lifGsx9Q-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA4AD64093; Mon, 17 Jan 2022 10:01:52 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CFD270391; Mon, 17 Jan 2022 10:01:52 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CD2751800620; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: [edk2-devel] [PATCH v2 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Date: Mon, 17 Jan 2022 11:01:44 +0100 Message-Id: <20220117100146.1965662-5-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: w1YUBkOP7NWi7NUJT1MuK1jnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413721; bh=rR7QupxV8I1L2oxhuccbRYCgJkpEZx4rST9Av92YaeA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=k7qRE/szk5sMsWCHBlD/jvToDpEakqxRWnv94MHSPZ5Ru1JyrWgRKNbid8StmumOhqn lMruhofiFGHMjOi8nyk12TBrH3b9A+2PH7FDUlrmUrshQD/R9X0yzS2Y5d/F8REdLGHpU bPiHPlxrl8/GhGscpcH1Bt/ffNvxHDKeFMU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413723070100008 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.34.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 (#85739): https://edk2.groups.io/g/devel/message/85739 Mute This Topic: https://groups.io/mt/88481106/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 Mon Apr 29 04:42:39 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+85738+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+85738+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413720; cv=none; d=zohomail.com; s=zohoarc; b=j6zhbokiF1h5abQPWpdOdlBF+7pIblvUnto8tQaE1PKaqMA7LC5zUEaPaJyiT5csgCSg9XTEFRAGhM+r1xDDm/avH/u+MnYGTiGTMWhdmzWAgrZ/OOmnZ3ctZzVeMsotnT2mTdDn5NZYjL3+tUBGTqYLw8PNyDO/qaGon0lgVl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413720; 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=dYiA/Q2uKdPSQ/Ex+ZIXR6jGuUoL6dMIi/YIojq5KPo=; b=AzgXQW4QSYR0PwR646oOeZYDzl3JjjygTO/fUxGlIhDIeSu/m15dafQaA596wH43AQX7kpruetmlxT6opQMAPIDWZeoARmEmoRzOuPZtoxjzV2g4OR6Be/rcI0wJV/rqqYbcUAhEi8XUR8Vd1rgFlLZXf+mTZLa5RxujWxZbahg= 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+85738+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 1642413720552263.0449466968031; Mon, 17 Jan 2022 02:02:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 45tjYY1788612xbEyqwg7iu5; Mon, 17 Jan 2022 02:02:00 -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.9297.1642413719547278019 for ; Mon, 17 Jan 2022 02:01:59 -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-329-XHMfktOsN3WcpvGv6heE4Q-1; Mon, 17 Jan 2022 05:01:55 -0500 X-MC-Unique: XHMfktOsN3WcpvGv6heE4Q-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E690E1023F50; Mon, 17 Jan 2022 10:01:53 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A85277039E; Mon, 17 Jan 2022 10:01:53 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D2FB41800634; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: [edk2-devel] [PATCH v2 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Date: Mon, 17 Jan 2022 11:01:45 +0100 Message-Id: <20220117100146.1965662-6-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: znBTUiHZqu83qmYExPubEQLix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413720; bh=i1ofd0q7/uyEsdvpufL+ieNq5WqVPyIQ1q9KIW//sDU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LtpsIsc2tKmMOnTCZTPP776tcG3ogPE+GCkOa6c3ln6EQGvONCRmEkiywdbxxoGhOqQ UoUiFrL4fLUmupgRfgCBgMKbSWJOaXQ3ApC+VREINLXw7f4jbJ5Jg1k/J2MTMEpCwaAuK 3dh5YnC1jXs5kSzVQuFPBrb4YS1Y4J6HOLg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413722786100003 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 f87a6f48a1bf..571d02d628f1 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -552,6 +552,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.34.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 (#85738): https://edk2.groups.io/g/devel/message/85738 Mute This Topic: https://groups.io/mt/88481105/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 Mon Apr 29 04:42:39 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+85741+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+85741+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642413734; cv=none; d=zohomail.com; s=zohoarc; b=NE+SjVmoLcrX0fJCRST2wbsBk2z/6LRu4+I0Ljs8uxQl4b21G2Vd9zC/XT8zD8PowWTGgOu0sA9XG1jx1sNKENaUHOXqO36Vd9j0BbRD+9Xjx/1clevaAdnyAi69aYShhBUlMdInMLlo1rHb4WV1yUd81ixmXtG7OsOBQN77WDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642413734; 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=bcKx+l152DFc/tyoxOd50VFPXu/vk77GiMXsBE2n2CY=; b=BTGZP4Ng4FxAqZaF4kHmBB7LAQk9ZXf1B08c/80O5A0WTQM5UledL5GkLOa3c7pHLZ8ecyVhrT5qtYf+VkatvOlq0D7pIT/7RgAsEsP8Ky8m93qxV2f6C8JggLhDxrPHgg5UGCpeJfIE4Pnpy/us5OqGq7AkjCGO0HeTqsqyyQE= 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+85741+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 1642413734394696.114762598101; Mon, 17 Jan 2022 02:02:14 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id po0VYY1788612xixLHsNi5cP; Mon, 17 Jan 2022 02:02:13 -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.9355.1642413733239743727 for ; Mon, 17 Jan 2022 02:02:13 -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-562-AScgJLK9Olisddy9rCFnTg-1; Mon, 17 Jan 2022 05:02:09 -0500 X-MC-Unique: AScgJLK9Olisddy9rCFnTg-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 C1D7B101AFAB; Mon, 17 Jan 2022 10:02:07 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3C3722DFE; Mon, 17 Jan 2022 10:01:54 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D87B5180063C; Mon, 17 Jan 2022 11:01:46 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: [edk2-devel] [PATCH v2 6/6] OvmfPkg/Microvm/pcie: add pcie support Date: Mon, 17 Jan 2022 11:01:46 +0100 Message-Id: <20220117100146.1965662-7-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-1-kraxel@redhat.com> References: <20220117100146.1965662-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: E7Ydgcul4S8kAiPFJ4FgXeufx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642413733; bh=lTNlMhnh+WKrMXiDBFgWWP7/qX9llw0BrB1gnCeG3/k=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=MyOZiQPOMfQbTREafBe338epdoqsWUF01poAVoKKXsG/hQlLuHQnb4KBIcNW6B/cPsN epPx0nY+ZA0nvs8R2DU5jH5BMuO9QduyjsUEN24TZ20iHaHe/E58CCQejkSLIOCcT70UC r+vq7G71/hdbnx9OpHVS/2ZATWqxhsuLrOU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642413736130100002 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 1c2e600febee..218869ac91a4 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -332,7 +332,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 @@ -349,7 +351,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 @@ -371,7 +375,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 @@ -387,7 +393,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 @@ -408,7 +416,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 @@ -424,7 +434,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 ##########################################################################= ###### # @@ -499,14 +511,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 @@ -571,6 +575,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 @@ -668,7 +678,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.34.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 (#85741): https://edk2.groups.io/g/devel/message/85741 Mute This Topic: https://groups.io/mt/88481109/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-