From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by mx.groups.io with SMTP id smtpd.web09.7474.1580388276394543597 for ; Thu, 30 Jan 2020 04:44:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@citrix.com header.s=securemail header.b=HTP6/7As; spf=pass (domain: citrix.com, ip: 216.71.155.144, mailfrom: anthony.perard@citrix.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580388276; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=TdJQiEIT7f81rOy+en2NUwGPnY837+PTewxXMY2sNe8=; b=HTP6/7As2ZnqBq3YuPokverEwU7QMKDBuvvVKryAxnMrwbyyHvOsdRNw jA6O33poWLkLwI45xtfxGFyG89X3tMsOTlgNcKoAPQRHCxiYp2Cc6AUAk KmuHgD5hq2C0+Ox7Co7azmmJFxGWViKC05wRPA03s9syXkb2yEtVzwfOk s=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: kVyJx2F1lEctrHVWptclmBBBGKe0TkuOkTlao5t+Op5rH493fXaedTUI6YhGK2u8zFemNYXhpW +oW8eBSnWIXsLOS7H33YR2UTD7qell+c072QNZ+8ufRaBtYjzLbeRw+3zu/Zw8hAN/dnICoV1T Mba3ARMlUF7oNObRXnbEpAylbRBbb9KHQqBZ5Mqj0ygZiA7rviuwi+2WFx+fw3ebRkT1I4nlcp BB76n0SXYNVKl7nv82shN+udMifmIJxKEhPJV1/ccZ7YV7SIc7bppOzVxHeOc4F7JVtXORp0iO tGk= X-SBRS: 2.7 X-MesageID: 12288024 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,382,1574139600"; d="scan'208";a="12288024" Date: Thu, 30 Jan 2020 12:44:31 +0000 From: "Anthony PERARD" To: Roger Pau =?iso-8859-1?Q?Monn=E9?= CC: , Michael D Kinney , "Ard Biesheuvel" , , Laszlo Ersek , Liming Gao , "Jordan Justen" , Julien Grall Subject: Re: [PATCH 4/5] OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency Message-ID: <20200130124431.GO1288@perard.uk.xensource.com> References: <20200129121235.1814563-1-anthony.perard@citrix.com> <20200129121235.1814563-5-anthony.perard@citrix.com> <20200130091251.GB4679@Air-de-Roger> MIME-Version: 1.0 In-Reply-To: <20200130091251.GB4679@Air-de-Roger> Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Jan 30, 2020 at 10:12:51AM +0100, Roger Pau Monné wrote: > On Wed, Jan 29, 2020 at 12:12:34PM +0000, Anthony PERARD wrote: > > + Parameters.domid = DOMID_SELF; > > + Parameters.gpfn = (UINTN) PagePtr >> EFI_PAGE_SHIFT; > > + ReturnCode = XenHypercallMemoryOp (XENMEM_remove_from_physmap, &Parameters); > > I'm afraid this will leave a hole in the p2m, and hence freeing the > page back to OVMF is wrong (I assume this is what FreePages does in > CalibrateLapicTimer), as the physical address would be unpopulated > after the call to XENMEM_remove_from_physmap. I guess there's more refactoring to do in OVMF, there are other's of this kind of call, mostly in the PV drivers, XenBusDxe. > > + > > + SharedInfo = AllocatePages (1); > > Hm, it's not the best approach to use a regular memory page to map the > shared info: mapping it is very likely to cause superpage shattering, > and once unmapped it leaves a hole in the p2m. :-( > As a reference you could map the shared info page at maximum physical > address allowed (after checking it's not populated) like Wei is doing > for the Xen on HyperV work. I'll look at what can be done with OVMF. Is there some kind of information that Xen could give? Or is it all information that OVMF should keep track of? Or if Xen only have XENMEM_memory_map, then OVMF already have this information. Thanks, -- Anthony PERARD