From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v9 13/15] tools/libxc: noarch restore code Date: Wed, 15 Apr 2015 12:50:25 +0100 Message-ID: <552E5081.4080307@citrix.com> References: <1428686167-8279-1-git-send-email-andrew.cooper3@citrix.com> <1428686167-8279-14-git-send-email-andrew.cooper3@citrix.com> <1429098132.15516.223.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429098132.15516.223.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Wei Liu , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On 15/04/15 12:42, Ian Campbell wrote: > On Fri, 2015-04-10 at 18:16 +0100, Andrew Cooper wrote: >> +/** >> + * Reads a record from the stream, and fills in the record structure. > Doesn't look to be a structured comment of any sort, so only one * > needed on the opening. > >> + * Given a list of pfns, their types, and a block of page data from the >> + * stream, populate and record their types, map the relevent subset and copy > relevant. > > With those two nits addressed: > > Acked-by: Ian Campbell > >> + for ( i = 0; i < count; ++i ) >> + { >> + ctx->restore.ops.set_page_type(ctx, pfns[i], types[i]); >> + >> + switch ( types[i] ) >> + { >> + case XEN_DOMCTL_PFINFO_NOTAB: > For my own enlightenment: > > What is in a NOTAB page and is it correct to uncanonicalise it? Notab is a regular plain ram page. I think the name refers to "not a pagetable". This loop is working out which guest frames to map, so data can be memcpy()'d in. It is a larger set than the pages which subsequently get uncanonicalised. ~Andrew > >> + >> + case XEN_DOMCTL_PFINFO_L1TAB: >> + case XEN_DOMCTL_PFINFO_L1TAB | XEN_DOMCTL_PFINFO_LPINTAB: >> + >> + case XEN_DOMCTL_PFINFO_L2TAB: >> + case XEN_DOMCTL_PFINFO_L2TAB | XEN_DOMCTL_PFINFO_LPINTAB: >> + >> + case XEN_DOMCTL_PFINFO_L3TAB: >> + case XEN_DOMCTL_PFINFO_L3TAB | XEN_DOMCTL_PFINFO_LPINTAB: >> + >> + case XEN_DOMCTL_PFINFO_L4TAB: >> + case XEN_DOMCTL_PFINFO_L4TAB | XEN_DOMCTL_PFINFO_LPINTAB: >> + >> + mfns[nr_pages++] = ctx->restore.ops.pfn_to_gfn(ctx, pfns[i]); >> + break; >> + } >> + }