From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from alto.onthenet.com.au (alto.onthenet.com.au [203.13.68.39]) by mx.groups.io with SMTP id smtpd.web11.2898.1625183173139927427 for ; Thu, 01 Jul 2021 16:46:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: iredmail.onthenet.com.au, ip: 203.13.68.39, mailfrom: srs0=fxgo=lz=freebsd.org=grehan@iredmail.onthenet.com.au) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id 942622094A69 for ; Fri, 2 Jul 2021 09:46:11 +1000 (AEST) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id 6DCC6211FADC for ; Fri, 2 Jul 2021 09:46:11 +1000 (AEST) Received: from iredmail.onthenet.com.au ([127.0.0.1]) by iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id W7ooFexUvxxS for ; Fri, 2 Jul 2021 09:46:11 +1000 (AEST) Received: from MacBook-Air-4.local (unknown [120.29.51.224]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id 22E9E211FAD7; Fri, 2 Jul 2021 09:46:11 +1000 (AEST) Subject: Re: [PATCH v3 2/2] OvmfPkg/Bhyve: use static PCI32Base address To: =?UTF-8?Q?Corvin_K=c3=b6hne?= , devel@edk2.groups.io Cc: p.bruenn@beckhoff.com, rebecca@bsdio.com, lersek@redhat.com, ardb+tianocore@kernel.org, jordan.l.justen@intel.com References: <20210701120152.27482-1-c.koehne@beckhoff.com> <20210701120152.27482-2-c.koehne@beckhoff.com> From: "Peter Grehan" Message-ID: Date: Fri, 2 Jul 2021 09:46:10 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210701120152.27482-2-c.koehne@beckhoff.com> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=Q6BJH7+a c=1 sm=1 tr=0 a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=y5XNLLSx+aZC9npArTYviw==:17 a=IkcTkHD0fZMA:10 a=e_q4qTt1xDgA:10 a=6I5d2MoRAAAA:8 a=uR5iNT-RwcUN-MU1GV4A:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 wl=host:3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Reviewed-by: Peter Grehan > =EF=BB=BFIt's neccessary to allocate a Graphics Stolen Memory area to e= nable > GPU-Passthrough for integrated Intel GPUs. Therefore, use a new > memory layout with a static Pci32Baseaddress. >=20 > 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(-) >=20 > 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 > =20 > diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/Platf= ormPei/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 <=3D MAX_UINT32 - SIZE_256MB); > PciBase =3D (UINT32)(PciExBarBase + SIZE_256MB); > } else { > - PciBase =3D (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; > + PciBase =3D PcdGet64(PcdPciMmio32Base); > + if (PciBase =3D=3D 0) > + PciBase =3D (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam; > } > =20 > // >=20