From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: citrix.com, ip: 216.71.155.168, mailfrom: anthony.perard@citrix.com) Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by groups.io with SMTP; Thu, 08 Aug 2019 07:27:44 -0700 Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: CNY1BW7vuP7e8rOPo5IrH3OxO6ZA04BTF4d6Ru05dIkVOcRyXCagAa/BOeUn6lzi8ZIdCEQEgy 1/ex3SxfKO2sEcVJwMDh4p/vWhiFljqxNG/h/QrF1VPmKlUUDG0jZfztBebfVGe6P9GERFmWt9 VEmO0sEvpfXkgPTNmApuL4weKntPmnR1GLXIqy8IACNaxik4vrbn18YWtlJXsi/cevhkNmCo1X /q89Lv+oRZqI9coT5afP4aEE72d07WnLc0O7qgAj2wMfNr0/ly9SO0XccFsyMUs9cXLvI3Disf 3fg= X-SBRS: 2.7 X-MesageID: 4169468 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,361,1559534400"; d="scan'208";a="4169468" Date: Thu, 8 Aug 2019 14:53:31 +0100 From: "Anthony PERARD" To: Roger Pau =?iso-8859-1?Q?Monn=E9?= CC: , Julien Grall , , Jordan Justen , Ard Biesheuvel , Laszlo Ersek Subject: Re: [edk2-devel] [PATCH v4 33/35] OvmfPkg: Introduce XenIoPvhDxe to initialize Grant Tables Message-ID: <20190808135331.GV1242@perard.uk.xensource.com> References: <20190729153944.24239-1-anthony.perard@citrix.com> <20190729153944.24239-34-anthony.perard@citrix.com> <20190807160703.2hkbpyvodevuwuhz@Air-de-Roger> MIME-Version: 1.0 In-Reply-To: <20190807160703.2hkbpyvodevuwuhz@Air-de-Roger> User-Agent: Mutt/1.12.1 (2019-06-15) Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Aug 07, 2019 at 06:07:03PM +0200, Roger Pau Monné wrote: > On Mon, Jul 29, 2019 at 04:39:42PM +0100, Anthony PERARD wrote: > > XenIoPvhDxe use XenIoMmioLib to reserve some space to be use by the > > Grant Tables. > > > > The call is only done if it is necessary, we simply detect if the > > guest is PVH, as in this case there is currently no PCI bus, and no > > PCI Xen platform device which would start the XenIoPciDxe and allocate > > the space for the Grant Tables. > > Since I'm not familiar with OVMF code, where is the grant table > physical memory coming from then, is it allocated from a hole in the > memory map? On HVM, we use the first BAR of the Xen platform PCI device. Since there is no such thing on PVH, I simply allocate some memory for it, with AllocateReservedPages() which mean allocate some pages and tell the OS to not touch them. We could deallocate these pages and give them back to the OS but that would need some refactoring. -- Anthony PERARD