From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EG/i31iS; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639648261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cidIi0q1w6gCGmjqCFrkTEOitfrcffEWL6QTo2QJtIs=; b=EG/i31iSf2HKT0mv0kcD+6yTYgRH1MS65cZ3pnrhsc/VthMdkQENumfv++YdQyCkVSAGbb +KyJva1rm7mMF6uhFcqssiLNCzYPRXUHY3idVIvS3C2vjbhaGK0p2Uh/UO5TPvLVQTCZpZ KrYvB1LzLainGGmE6KRCoH1oIVz/NQw= 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 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) 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) 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: [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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Link in pcie and host bridge bits. Enables support for PCIe in microvm (qemu-system-x86_64 -M microvm,pcie=on). Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3777 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/BaseCachingPciExpressLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf @@ -351,7 +353,9 @@ [LibraryClasses.common.UEFI_DRIVER] DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf !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/BaseCachingPciExpressLib.inf [LibraryClasses.common.DXE_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -373,7 +377,9 @@ [LibraryClasses.common.DXE_DRIVER] !if $(SOURCE_DEBUG_ENABLE) == 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/BaseCachingPciExpressLib.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.inf !endif - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf + PciExpressLib|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf [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/BaseCachingPciExpressLib.inf [LibraryClasses.common.SMM_CORE] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -426,7 +436,9 @@ [LibraryClasses.common.SMM_CORE] !else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf !endif - PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf + PciExpressLib|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf ################################################################################ # @@ -501,14 +513,6 @@ [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F !endif - # 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, QEMU - # never lets the RAM below 4 GB exceed 2816 MB. - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xB0000000 - !if $(SOURCE_DEBUG_ENABLE) == TRUE gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 !endif @@ -573,6 +577,12 @@ [PcdsDynamicDefault] gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 + # 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/PciHostBridgeLibNull.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.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 known limitations ----------------- -- 2.33.1