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

On 30/01/2020 12:44, Anthony PERARD wrote:
> 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.

We need to actually tackle the memory problem, and provide something
correct via XENMEM_memory_map (/similar).

So far, noone has actually started to try fixing the problem.  Perhaps
now is a good enough kick to get started.

~Andrew

  reply	other threads:[~2020-01-30 13:10 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
2020-01-30 13:10       ` Andrew Cooper [this message]
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=3a85286d-e90f-c492-64b2-f860ad09efb3@citrix.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