All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Jan Beulich <JBeulich@suse.com>
Subject: Re: dom0 pvops and rearranging memory layout
Date: Fri, 23 Jan 2015 12:41:20 +0100	[thread overview]
Message-ID: <54C23360.4040603@suse.com> (raw)
In-Reply-To: <54C2321A.7020402@citrix.com>

On 01/23/2015 12:35 PM, Andrew Cooper wrote:
> On 23/01/15 10:32, Juergen Gross wrote:
>> Hi,
>>
>> while testing new patches to support dom0 with more than 512 GB I
>> stumbled over an issue which - I think - is present in pvops for
>> some time now.
>>
>> On boot the kernel rearranges the memory layout to match the host
>> E820 map. This is done to be able to access all I/O areas with
>> identity mapped pfns (pfn == mfn). So basically some memory pages
>> change their pfns while the mfns stay the same.
>>
>> There is no check done whether the moved memory areas are actually
>> in use (e.g. via memblock_is_reserved()). This can lead to cases
>> where memory in use is put to an area which is made available for
>> new memory allocations soon afterwards. Memory in question could
>> be the initrd, the p2m map presented to dom0 by the hypervisor, or
>> (hopefully in theory only) even the kernel itself or it's initial
>> page tables built by the hypervisor.
>>
>> In my test I had a p2m map of nearly 2GB size and the area between
>> 2GB and 4GB had no RAM. So parts of the p2m map and the complete
>> initrd where subject to be remapped which led to an early PANIC.
>>
>> I'll try to add some special handling for the initrd and the p2m
>> map. In case someone has a better idea: please tell me.
>>
>
> The relocation is done based only on the e820 is it not?

Yes.

> I wonder whether it might be reasonable to extend contruct_dom0/libelf
> to avoid constructing a p2m where pfns of built data (kernel, initrd,
> p2m and initial pagetables) aliased with host io regions.

That was my first idea, too. OTOH this would require a rather new
hypervisor with this functionality to be able to run a pvops dom0 on
such a machine.

Ans can we be sure that an existing non-pvops dom0 (or even an old pvops
one) can work with such a change?


Juergen

  reply	other threads:[~2015-01-23 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23 10:32 dom0 pvops and rearranging memory layout Juergen Gross
2015-01-23 11:35 ` Andrew Cooper
2015-01-23 11:41   ` Juergen Gross [this message]
2015-01-23 12:03   ` Jan Beulich
     [not found]   ` <54C246980200007800058C51@suse.com>
2015-01-23 12:08     ` Juergen Gross
2015-01-23 12:42       ` Jan Beulich
2015-01-23 11:58 ` David Vrabel
2015-01-23 15:09 ` Konrad Rzeszutek Wilk
2015-01-23 15:16   ` Juergen Gross

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-all 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=54C23360.4040603@suse.com \
    --to=jgross@suse.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.