From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>,
"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: Domain Save Image Format proposal (draft B)
Date: Tue, 11 Feb 2014 13:04:08 +0000 [thread overview]
Message-ID: <52FA1FC8.7010104@citrix.com> (raw)
In-Reply-To: <52FA043B020000780011B10C@nat28.tlf.novell.com>
On 11/02/14 10:06, Jan Beulich wrote:
>>>> On 10.02.14 at 18:20, David Vrabel <david.vrabel@citrix.com> wrote:
>> Fields
>> ------
>>
>> All the fields within the headers and records have a fixed width.
>>
>> Fields are always aligned to their size.
>>
>> Padding and reserved fields are set to zero on save and must be
>> ignored during restore.
>
> Meaning it would be impossible to assign a meaning to these fields
> later. I'd rather mandate that the restore side has to check these
> fields are zero, and bail if they aren't.
Reserved fields/bits can be used but it would require a new record type
and a bump of the format version.
I was aiming to minimize the number of ways the format can be extended.
>> Integer (numeric) fields in the image header are always in big-endian
>> byte order.
>
> Why would big endian be preferable when both currently
> supported architectures use little endian?
Mostly to encourage tools to pay attention to byte order rather than
assuming native and getting away with it...
>> Domain Header
>> -------------
>>
>> The domain header includes general properties of the domain.
>>
>> 0 1 2 3 4 5 6 7 octet
>> +-----------+-----------+-----------+-------------+
>> | arch | type | page_shift| (reserved) |
>> +-----------+-----------+-----------+-------------+
>>
>> --------------------------------------------------------------------
>> Field Description
>> ----------- --------------------------------------------------------
>> arch 0x0000: Reserved.
>>
>> 0x0001: x86.
>>
>> 0x0002: ARM.
>>
>> type 0x0000: Reserved.
>>
>> 0x0001: x86 PV.
>>
>> 0x0002 - 0xFFFF: Reserved.
>
> So how would ARM, x86 HVM, and x86 PVH be expressed?
Something like:
0x0001: x86 PV.
0x0002: x86 HVM.
0x0003: x86 PVH.
0x0004: ARM.
Which does make the arch field a bit redundant, I suppose.
>> P2M
>> ---
>>
>> [ This is a more flexible replacement for the old p2m_size field and
>> p2m array. ]
>>
>> The P2M record contains a portion of the source domain's P2M.
>> Multiple P2M records may be sent if the source P2M changes during the
>> stream.
>>
>> 0 1 2 3 4 5 6 7 octet
>> +-------------------------------------------------+
>> | pfn_begin |
>> +-------------------------------------------------+
>> | pfn_end |
>> +-------------------------------------------------+
>> | mfn[0] |
>> +-------------------------------------------------+
>> ...
>> +-------------------------------------------------+
>> | mfn[N-1] |
>> +-------------------------------------------------+
>>
>> --------------------------------------------------------------------
>> Field Description
>> ----------- --------------------------------------------------------
>> pfn_begin The first PFN in this portion of the P2M
>>
>> pfn_end One past the last PFN in this portion of the P2M.
>
> I'd favor an inclusive range here, such that if we ever reach a
> fully populatable 64-bit PFN space (on some future architecture)
> there'd still be no issue with special casing the then unavoidable
> wraparound.
Ok, but 64-bit PFN space would suggest 76 bit of address space which
seems somewhat far off. Is that something we want to consider now?
>> Legacy Images (x86 only)
>> ========================
>>
>> Restoring legacy images from older tools shall be handled by
>> translating the legacy format image into this new format.
>>
>> It shall not be possible to save in the legacy format.
>>
>> There are two different legacy images depending on whether they were
>> generated by a 32-bit or a 64-bit toolstack. These shall be
>> distinguished by inspecting octets 4-7 in the image. If these are
>> zero then it is a 64-bit image.
>>
>> Toolstack Field Value
>> --------- ----- -----
>> 64-bit Bit 31-63 of the p2m_size field 0 (since p2m_size < 2^32^)
>
> Afaics this is being determined via xc_domain_maximum_gpfn(),
> which I don't think guarantees the result to be limited to 2^32.
> Or in fact the libxc interface wrongly limits the value (by
> truncating the "long" returned from the hypercall to an "int"). So
> in practice consistent images would have the field limited to 2^31
> on 64-bit tool stacks (since for larger values the negative function
> return value would get converted by sign-extension, but all sorts
> of other trouble would result due to the now huge p2m_size).
For the handling of legacy images I think we need to only consider
images that could have been practically generated by older tools.
>> Future Extensions
>> =================
>>
>> All changes to this format require the image version to be increased.
>
> Oh, okay, this partly deals with the first question above. Question
> is whether that's a useful requirement, i.e. whether that wouldn't
> lead to an inflation of versions needing conversion (for a tool stack
> that wants to support more than just migration from N-1).
Only legacy images would be converted to the newest format. I would
expect version V-1 images would be handled by (mostly) the same code as
V images. Particularly if V is V-1 with extra record types.
David
next prev parent reply other threads:[~2014-02-11 13:04 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 17:20 Domain Save Image Format proposal (draft B) David Vrabel
2014-02-10 17:32 ` Andrew Cooper
2014-02-10 17:48 ` Frediano Ziglio
2014-02-10 20:00 ` Shriram Rajagopalan
2014-02-11 1:35 ` Andrew Cooper
2014-02-11 4:12 ` Shriram Rajagopalan
2014-02-11 10:58 ` Zoltan Kiss
2014-02-12 15:34 ` Tim Deegan
2014-02-11 11:58 ` David Vrabel
2014-02-11 16:13 ` Shriram Rajagopalan
2014-02-11 9:30 ` Ian Campbell
2014-02-11 11:40 ` David Vrabel
2014-02-11 12:09 ` Ian Campbell
2014-02-11 13:10 ` Jan Beulich
2014-02-11 13:12 ` Ian Campbell
2014-02-12 15:41 ` Tim Deegan
2014-02-11 10:06 ` Jan Beulich
2014-02-11 13:04 ` David Vrabel [this message]
2014-02-11 13:20 ` Jan Beulich
2014-02-11 16:45 ` Ian Jackson
2014-02-11 17:08 ` Shriram Rajagopalan
2014-02-11 17:15 ` Ian Campbell
2014-02-11 17:30 ` Ian Jackson
2014-02-11 17:31 ` Frediano Ziglio
2014-02-11 17:53 ` Ian Jackson
2014-02-11 17:59 ` Ian Campbell
2014-02-12 9:07 ` Frediano Ziglio
2014-02-12 11:27 ` Frediano Ziglio
2014-02-12 11:34 ` Ian Campbell
2014-02-11 16:38 ` Ian Jackson
2014-02-11 17:04 ` Andrew Cooper
2014-02-11 17:07 ` Ian Jackson
2014-02-11 16:49 ` Ian Jackson
2014-02-11 17:10 ` David Vrabel
2014-02-11 17:28 ` Ian Jackson
2014-02-12 16:36 ` Tim Deegan
2014-02-12 17:09 ` David Vrabel
2014-02-12 18:16 ` Frediano Ziglio
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=52FA1FC8.7010104@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=Xen-devel@lists.xen.org \
--cc=ian.campbell@citrix.com \
--cc=rshriram@cs.ubc.ca \
--cc=stefano.stabellini@eu.citrix.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.