From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v9 08/15] tools/libxc: x86 PV save code Date: Wed, 15 Apr 2015 12:13:32 +0100 Message-ID: <1429096412.15516.205.camel@citrix.com> References: <1428686167-8279-1-git-send-email-andrew.cooper3@citrix.com> <1428686167-8279-9-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1428686167-8279-9-git-send-email-andrew.cooper3@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: Andrew Cooper Cc: Wei Liu , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, 2015-04-10 at 18:16 +0100, Andrew Cooper wrote: > Save the x86 PV specific parts of a domain. This is the X86_PV_INFO record, > the P2M_FRAMES, the X86_PV_SHARED_INFO, the three different VCPU context > records, and the MSR records. > > The normalise_page callback used by the common code when writing the PAGE_DATA > records, converts MFNs in page tables to PFNs. > > Signed-off-by: Andrew Cooper Acked-by: Ian Campbell With one question: > +#ifdef __x86_64__ > + /* 64bit toolstack, 32bit guest. Expand any INVALID_MFN. */ > + uint32_t s = ((uint32_t *)src)[x]; > + > + dst[x] = s == ~0U ? INVALID_MFN : s; > +#else > + /* 32bit toolstack, 64bit guest. Truncate their pointers */ > + dst[x] = ((uint64_t *)src)[x]; > +#endif Would it not be better to propagate an error instead of truncating? Or at least log the first instance of such? Ian.