xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: Elena Ufimtseva <elena.ufimtseva@oracle.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	BorisOstrovsky <boris.ostrovsky@oracle.com>,
	Tim Deegan <tim@xen.org>
Subject: Re: [Draft B] Boot ABI for HVM guests without a device-model
Date: Thu, 27 Aug 2015 11:57:25 +0200	[thread overview]
Message-ID: <55DEDF05.5080509@citrix.com> (raw)
In-Reply-To: <55DEDBAA.9030601@citrix.com>

El 27/08/15 a les 11.43, Andrew Cooper ha escrit:
> On 27/08/15 09:04, Jan Beulich wrote:
>>>>> On 26.08.15 at 16:44, <roger.pau@citrix.com> wrote:
>>> El 26/08/15 a les 14.12, Andrew Cooper ha escrit:
>>>> On 26/08/15 13:00, Jan Beulich wrote:
>>>>>> This structure is guaranteed to always be placed in memory after the
>>>>> DYM "These structures are ..."?
>>>>>
>>>>>> loaded kernel and modules.
>>>> There is no requirement for the command line/module information to be
>>>> after the loaded kernel.  All it needs to do is not overlap.
>>> IMHO, this is helpful in order to get last used physical address, after
>>> which free memory starts. Current FreeBSD implementation relies on this,
>>> if we didn't do it that way I would have to calculate where the symtab +
>>> strtab ends, which is more complex.
>> But the statement leaves open whether there is any free memory at
>> all after those structures, or whether instead all free memory lives
>> at lower addresses. Nor do I consider it appropriate to take a present
>> (one might say overly simplistic) implementation as a basis for setting
>> arbitrary restrictions.

Can we just state that the hvm_start_info structure and associated 
metadata is placed after the loaded kernel and modules?

Whether there's free memory or not after this is something that the 
kernel has to figure out by itself, and I wasn't planning to add such a 
statement to the specification.

> I agree.  This sounds like a FreeBSD bug, and absolutely shouldn't be a
> written restriction in the boot ABI.

Bug? The FreeBSD native loader passes to the FreeBSD kernel the last 
used address, after which free memory starts. IMHO, it is not a bug, 
it's just how FreeBSD boots. I understand that Linux might not pass 
such a parameter, and there are other ways I can use to find this, but 
they are more complex. 

We already did something very similar with PV guests, see the comment 
before the start_info structure:

 *  3. This the order of bootstrap elements in the initial virtual region:
 *      a. relocated kernel image
 *      b. initial ram disk              [mod_start, mod_len]
 *         (may be omitted)
 *      c. list of allocated page frames [mfn_list, nr_pages]
 *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
 *      d. start_info_t structure        [register ESI (x86)]
 *         in case of dom0 this page contains the console info, too
 *      e. unless dom0: xenstore ring page
 *      f. unless dom0: console ring page
 *      g. bootstrap page tables         [pt_base and CR3 (x86)]
 *      h. bootstrap stack               [register ESP (x86)]

IMHO it is important to mention how things are loaded into memory, and 
placing the hvm_start_info struct after the loaded kernel and modules 
is also the most natural way to do it, I don't foresee this changing in 
the future.

Roger.

  reply	other threads:[~2015-08-27  9:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 11:48 [Draft B] Boot ABI for HVM guests without a device-model Roger Pau Monné
2015-08-26 12:00 ` Jan Beulich
2015-08-26 12:12   ` Andrew Cooper
2015-08-26 14:44     ` Roger Pau Monné
2015-08-27  8:04       ` Jan Beulich
2015-08-27  9:43         ` Andrew Cooper
2015-08-27  9:57           ` Roger Pau Monné [this message]
2015-08-27 11:08             ` Jan Beulich
2015-08-26 12:18 ` Andrew Cooper
2015-08-26 15:38   ` Roger Pau Monné

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=55DEDF05.5080509@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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).