[edk2-devel] [PATCH v3 2/2] OvmfPkg/Bhyve: use static PCI32Base address

Peter Grehan grehan at freebsd.org
Thu Jul 1 23:46:10 UTC 2021


Reviewed-by: Peter Grehan <grehan at freebsd.org>

> It's neccessary to allocate a Graphics Stolen Memory area to enable
> GPU-Passthrough for integrated Intel GPUs. Therefore, use a new
> memory layout with a static Pci32Baseaddress.
> 
> Old layout:
> 	[...        , lowmemlimit] RAM
> 	[lowmemlimit, 0xE000 0000] PCI Space
> New layout:
> 	[...        , lowmemlimit] RAM
> 	[lowmemlimit, gsmbase    ] Memory hole (may be absent)
> 	[gsmbase    , 0xC000 0000] GSM (may be absent)
> 	[0xC000 0000, 0xE000 0000] PCI Space
> ---
>   OvmfPkg/Bhyve/BhyveX64.dsc           | 4 ++--
>   OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 +++-
>   2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index a0a2071b86..c435dadc0a 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -537,8 +537,8 @@
>     gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
>     gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0
>     gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0
> -  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
> -  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0xC0000000
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x20000000
>     gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
>     gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x800000000
>   
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
> index 3a414ffcb7..f38e74ccfc 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
> +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c
> @@ -191,7 +191,9 @@ MemMapInitialization (
>         ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB);
>         PciBase = (UINT32)(PciExBarBase + SIZE_256MB);
>       } else {
> -      PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
> +      PciBase = PcdGet64(PcdPciMmio32Base);
> +      if (PciBase == 0)
> +        PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
>       }
>   
>       //
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77428): https://edk2.groups.io/g/devel/message/77428
Mute This Topic: https://groups.io/mt/83914139/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list