From: Juergen Gross <jgross@suse.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com,
Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 3/5] libxc: create unmapped initrd in domain builder if supported
Date: Fri, 11 Sep 2015 15:32:04 +0200 [thread overview]
Message-ID: <55F2D7D4.6070704@suse.com> (raw)
In-Reply-To: <22002.52991.787690.357028@mariner.uk.xensource.com>
On 09/11/2015 02:54 PM, Ian Jackson wrote:
> Juergen Gross writes ("[PATCH 3/5] libxc: create unmapped initrd in domain builder if supported"):
>> In case the kernel of a new pv-domU indicates it is supporting an
>> unmapped initrd, don't waste precious virtual space for the initrd,
>> but allocate only guest physical memory for it.
> ...
>
> The name of this ELFNOTE suggests that it applies to all multiboot
> modules, not just ramdisks. In particular, that means perhaps it
> ought to apply to device tree blobs too ?
Hmm, in theory, yes.
AFAIK it is only used for initrd on x86. I think support for other
modules can be added as needed.
>> - /* load ramdisk */
>> - if ( dom->ramdisk_blob )
>> + /* Load ramdisk if initial mapping required. */
>> + if ( dom->ramdisk_blob &&
>> + (!dom->parms.elf_notes[XEN_ELFNOTE_MOD_START_PFN].data.num ||
>> + dom->ramdisk_seg.vstart) )
>
> After this patch the resulting structure of the code is rather
> unfortunate, in that the order of the main processing steps depends on
> this ELFNOTE.
>
> Wouldn't it be better to generalise xc_dom_alloc_segment ?
How?
You have to create (and allocate space for) the page tables after
all allocations which should be covered by those page tables. And
you must not allocate the other stuff before that, as this would
again waste virtual address space, which is 1:1 with guest physical
memory.
The only solution would be to calculate the needed sizes of the
single memory chunks first and then do the allocations either in
the mapped or the unmapped region according to the ELFNOTEs. This
would rip at least the initrd processing into two parts, as the
needed memory size is calculated depending on the initrd being
compressed or not.
I thought about building a table containing the sequence of the
single processing steps dependant on the ELFNOTEs and processing this
table in a generic loop afterwards. If you like this approach, I can
give it a try. I just wanted to avoid a complete rework of the main
building function.
Juergen
next prev parent reply other threads:[~2015-09-11 13:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 12:32 [PATCH 0/5] libxc: support building large pv-domains Juergen Gross
2015-09-11 12:32 ` [PATCH 1/5] libxc: remove allocate member from struct xc_dom_image Juergen Gross
2015-09-11 12:44 ` Ian Jackson
2015-09-25 15:39 ` Ian Campbell
2015-09-28 3:55 ` Juergen Gross
2015-09-28 9:33 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 2/5] libxc: do initrd processing of domain builder in own function Juergen Gross
2015-09-11 12:45 ` Ian Jackson
2015-09-25 15:39 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 3/5] libxc: create unmapped initrd in domain builder if supported Juergen Gross
2015-09-11 12:54 ` Ian Jackson
2015-09-11 13:15 ` Julien Grall
2015-09-11 13:39 ` Juergen Gross
2015-09-25 15:22 ` Ian Campbell
2015-09-11 13:32 ` Juergen Gross [this message]
2015-09-11 15:51 ` Ian Jackson
2015-09-11 12:32 ` [PATCH 4/5] libxc: split p2m allocation in domain builder from other magic pages Juergen Gross
2015-10-01 12:47 ` Ian Campbell
2015-10-02 3:55 ` Juergen Gross
2015-10-02 9:04 ` Ian Campbell
2015-10-02 9:14 ` Juergen Gross
2015-10-02 9:28 ` Ian Campbell
2015-09-11 12:32 ` [PATCH 5/5] libxc: create p2m list outside of kernel mapping if supported Juergen Gross
2015-09-11 13:28 ` [PATCH 0/5] libxc: support building large pv-domains Ian Campbell
2015-09-11 13:42 ` Juergen Gross
2015-09-11 13:53 ` Ian Campbell
2015-09-11 14:01 ` Juergen Gross
2015-09-25 15:40 ` Ian Campbell
2015-09-22 12:12 ` 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=55F2D7D4.6070704@suse.com \
--to=jgross@suse.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).