Skip to content

Commit

Permalink
OvmfPkg/Bhyve: use static PCI32Base address
Browse files Browse the repository at this point in the history
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

Reviewed-by: Peter Grehan <grehan@freebsd.org>
Acked-by: Rebecca Cran <rebecca@bsdio.com>
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Message-Id: <20210705110842.14088-2-c.koehne@beckhoff.com>
  • Loading branch information
ckoehne authored and mergify[bot] committed Jul 5, 2021
1 parent 1e0c441 commit 44ced03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OvmfPkg/Bhyve/BhyveX64.dsc
Expand Up @@ -519,8 +519,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

Expand Down
4 changes: 3 additions & 1 deletion OvmfPkg/Bhyve/PlatformPei/Platform.c
Expand Up @@ -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;
}

//
Expand Down

0 comments on commit 44ced03

Please sign in to comment.