public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Anthony PERARD" <anthony.perard@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: <devel@edk2.groups.io>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	"Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
	<xen-devel@lists.xenproject.org>,
	Laszlo Ersek <lersek@redhat.com>,
	Liming Gao <liming.gao@intel.com>,
	"Jordan Justen" <jordan.l.justen@intel.com>,
	Julien Grall <julien@xen.org>
Subject: Re: [PATCH 4/5] OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency
Date: Thu, 30 Jan 2020 12:44:31 +0000	[thread overview]
Message-ID: <20200130124431.GO1288@perard.uk.xensource.com> (raw)
In-Reply-To: <20200130091251.GB4679@Air-de-Roger>

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

  reply	other threads:[~2020-01-30 12:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 12:12 [PATCH 0/5] OvmfXen: Set PcdFSBClock at runtime Anthony PERARD
2020-01-29 12:12 ` [PATCH 1/5] OvmfPkg/XenResetVector: Silent a warning from nasm Anthony PERARD
2020-01-29 16:08   ` Laszlo Ersek
2020-01-29 12:12 ` [PATCH 2/5] MdePkg: Allow PcdFSBClock to by Dynamic Anthony PERARD
2020-01-29 16:10   ` Laszlo Ersek
2020-02-03  1:34     ` Liming Gao
2020-02-03 15:34       ` Anthony PERARD
2020-02-03 17:26         ` Anthony PERARD
2020-02-04  6:49           ` [edk2-devel] " Liming Gao
2020-01-29 12:12 ` [PATCH 3/5] OvmfPkg/IndustryStandard/Xen: Apply EDK2 coding style to XEN_VCPU_TIME_INFO Anthony PERARD
2020-01-29 16:14   ` Laszlo Ersek
2020-01-30 10:31     ` Anthony PERARD
2020-01-29 12:12 ` [PATCH 4/5] OvmfPkg/XenPlatformPei: Calibrate APIC timer frequency Anthony PERARD
2020-01-29 16:29   ` Laszlo Ersek
2020-01-30  9:12   ` Roger Pau Monné
2020-01-30 12:44     ` Anthony PERARD [this message]
2020-01-30 13:10       ` [Xen-devel] " Andrew Cooper
2020-01-29 12:12 ` [PATCH 5/5] OvmfPkg/OvmfXen: Set PcdFSBClock Anthony PERARD
2020-01-29 16:36   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130124431.GO1288@perard.uk.xensource.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox