From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v5 7/9] libxc: introduce soft reset for HVM domains Date: Tue, 13 Jan 2015 14:08:34 +0000 Message-ID: <1421158114.19103.73.camel@citrix.com> References: <1418305541-5135-1-git-send-email-vkuznets@redhat.com> <1418305541-5135-8-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB29j-00072L-An for xen-devel@lists.xenproject.org; Tue, 13 Jan 2015 14:09:15 +0000 In-Reply-To: <1418305541-5135-8-git-send-email-vkuznets@redhat.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: Vitaly Kuznetsov Cc: Wei Liu , Andrew Jones , Julien Grall , Keir Fraser , Stefano Stabellini , Andrew Cooper , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-12-11 at 14:45 +0100, Vitaly Kuznetsov wrote: > Add new xc_domain_soft_reset() function which performs so-called 'soft reset' > for an HVM domain. It is being performed in the following way: > - Save HVM context and all HVM params; > - Devour original domain with XEN_DOMCTL_devour; > - Wait till original domain dies or has no pages left; > - Restore HVM context, HVM params, seed grant table. Are any of these operations "slow", per the definition under 'Machinery for asynchronous operations ("ao")' in libxl_internal.h? "Wait till original domain dies" sounds like it might be. That might have implications for the use of this functionality from libxl. > + xc_hvm_param_get(xch, source_dom, HVM_PARAM_IDENT_PT, > + &hvm_params[HVM_PARAM_IDENT_PT]); There's quite a risk of the set of HVM parameters retrieved getting out of sync, either with the hypervisor or with the sets done below. I don't know if any part of the migration infrastructure (specifically Andy Cooper's v2 stuff, or some of the underlying hypercalls) could be reused here to pickle/unpickle the state? Other possibilities: A new hypercall pair to get/set all hvm params. An list of params to save/restore locally here, which would at least stop the get/set parts gettuing out of sync, but doesn't help with the hypervisor getting out of sync (and therefore would not be my preferred solution). Also this function needs to take arch specifics into account. > + while ( 1 ) > + { > + sleep(SLEEP_INT); > + if ( xc_get_tot_pages(xch, source_dom) <= 0 ) > + { > + DPRINTF("All pages were transferred"); > + break; > + } > + } I think we are going to need to find a better solution than this. Changing the nature of the hypercall as I suggested in a previous reply would also remove this, so I'll wait for a verdict on that before worrying about this bit any further. > [...] > + PERROR("Faled to perform soft reset, destroying domain %d", "Failed" Ian.