From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web08.10368.1642421872116220795 for ; Mon, 17 Jan 2022 04:17:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IjlCfwS9; spf=pass (domain: kernel.org, ip: 145.40.68.75, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B826CB81011 for ; Mon, 17 Jan 2022 12:17:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C7CDC36AF5 for ; Mon, 17 Jan 2022 12:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642421868; bh=zVDNf2XPpFfvChztfx+xQskKI59kghQJyiaQQMu2W8c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IjlCfwS9JSvl4chIEBC0eZ01aGkXQIqiItAy3LWrOhqfEyBAOhGKAyfXyZhjiYG+n JFXdLLr9ExH+w2vHIhdtr2v62TlISUokFcoSuijs5medohwMx2/Fcl6xy/oZ8AN+Ds AnHHRPYLgLEN8BlAoRrWhTHP9VPADSi7IwwpThMf8h/zcNMOMoEJixNsxDigFdanp3 O1E/x+h61QACfZcV8h6tsbD9b6jg3Jtd8FE76q8h8tkhF5rUHRrgFWVEsswy1FBDRE Ru5VQtrlicMX/YL32/vwctsn3GtdRwMxCGzgi+a01jrrM3Z0OZHzOsnw4kzfeZVLbj 5qdCk3xYZfPMQ== Received: by mail-wm1-f48.google.com with SMTP id 25-20020a05600c231900b003497473a9c4so23884784wmo.5 for ; Mon, 17 Jan 2022 04:17:48 -0800 (PST) X-Gm-Message-State: AOAM530SGgU9j0CVhRPpzL2efExr4pRFKK916pMQOev/9AVuEUZT5ciO uT6CzTrcMFWT6dtJLFiu72xzAQI99y0wQ8OEoiY= X-Google-Smtp-Source: ABdhPJzlIkYVg1SbDUhCCM9xWDMDRx43/PCyuAVrcOjSOKIZJqwZuNmdv0Tl56F3F5sKWO1e1/UR8zsS7JQeYCri8Uw= X-Received: by 2002:a05:600c:3c9c:: with SMTP id bg28mr19695968wmb.190.1642421866775; Mon, 17 Jan 2022 04:17:46 -0800 (PST) MIME-Version: 1.0 References: <20220117100146.1965662-1-kraxel@redhat.com> <20220117100146.1965662-7-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-7-kraxel@redhat.com> From: "Ard Biesheuvel" Date: Mon, 17 Jan 2022 13:17:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v2 6/6] OvmfPkg/Microvm/pcie: add pcie support To: edk2-devel-groups-io , Gerd Hoffmann Cc: Ray Ni , Liming Gao , Abner Chang , Jiewen Yao , Jordan Justen , Leif Lindholm , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Content-Type: text/plain; charset="UTF-8" Hello Gerd, On Mon, 17 Jan 2022 at 11:02, Gerd Hoffmann wrote: > > 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 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/BaseCachingPciExpressLib.inf Please don't add commented out lines like this. > QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf > VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf > > @@ -349,7 +351,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 > @@ -371,7 +375,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 > @@ -387,7 +393,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 > @@ -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/BaseCachingPciExpressLib.inf > > [LibraryClasses.common.SMM_CORE] > PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > @@ -424,7 +434,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 > > ################################################################################ > # > @@ -499,14 +511,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 > @@ -571,6 +575,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 > @@ -668,7 +678,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.34.1 > > > > > >