From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v1 COLO Pre 02/12] libxc/restore: zero ioreq page only one time Date: Tue, 2 Jun 2015 11:16:38 +0100 Message-ID: <556D8286.7000803@citrix.com> References: <1433237180-21181-1-git-send-email-yanghy@cn.fujitsu.com> <1433237180-21181-3-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1433237180-21181-3-git-send-email-yanghy@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: Yang Hongyang , xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, ian.jackson@eu.citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On 02/06/15 10:26, Yang Hongyang wrote: > ioreq page contains evtchn which will be set when we resume the > secondary vm the first time. The hypervisor will check if the > evtchn is corrupted, so we cannot zero the ioreq page more > than one time. > > The ioreq->state is always STATE_IOREQ_NONE after the vm is > suspended, so it is OK if we only zero it one time. > > Signed-off-by: Yang Hongyang > Signed-off-by: Wen congyang > CC: Andrew Cooper Is the qemu process for the secondary running at this point? If so, this is very much unsafe. ~Andrew > --- > tools/libxc/xc_sr_restore_x86_hvm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xc_sr_restore_x86_hvm.c > index 6f5af0e..06177e0 100644 > --- a/tools/libxc/xc_sr_restore_x86_hvm.c > +++ b/tools/libxc/xc_sr_restore_x86_hvm.c > @@ -78,7 +78,8 @@ static int handle_hvm_params(struct xc_sr_context *ctx, > break; > case HVM_PARAM_IOREQ_PFN: > case HVM_PARAM_BUFIOREQ_PFN: > - xc_clear_domain_page(xch, ctx->domid, entry->value); > + if ( !ctx->restore.buffer_all_records ) > + xc_clear_domain_page(xch, ctx->domid, entry->value); > break; > } >