From: Ian Campbell Subject: Re: [RFC Patch v3 02/18] csum the correct page Date: Mon, 8 Sep 2014 12:28:18 +0100 Message-ID: <1410175698.10156.192.camel@kazak.uk.xensource.com> References: <1409908261-18682-1-git-send-email-wency@cn.fujitsu.com> <1409908261-18682-3-git-send-email-wency@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1409908261-18682-3-git-send-email-wency@cn.fujitsu.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: Wen Congyang Cc: Lai Jiangshan , Ian Jackson , Jiang Yunhong , Dong Eddie , xen devel , Yang Hongyang List-Id: xen-devel@lists.xenproject.org On Fri, 2014-09-05 at 17:10 +0800, Wen Congyang wrote: > In verify mode, we map the guest memory, and the guest page is > region_base + i * PAGE_SIZE. So we should csum page (region_base > + i * PAGE_SIZE), not (region_base + (i+curbatch) * PAGE_SIZE) > > Signed-off-by: Wen Congyang Acked-by: Ian Campbell > --- > tools/libxc/xc_domain_restore.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c > index bec716c..fb4ddfc 100644 > --- a/tools/libxc/xc_domain_restore.c > +++ b/tools/libxc/xc_domain_restore.c > @@ -1405,7 +1405,7 @@ static int apply_batch(xc_interface *xch, uint32_t dom, struct restore_ctx *ctx, > > DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx " > "actualcs=%08lx\n", pfn, pagebuf->pfn_types[pfn], > - csum_page(region_base + (i + curbatch)*PAGE_SIZE), > + csum_page(region_base + i * PAGE_SIZE), > csum_page(buf)); > > for ( v = 0; v < 4; v++ )