From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hongyang Yang Subject: Re: [PATCH Remus v1 5/8] tools/libxc: defer the setting of HVM_PARAM_IDENT_PT Date: Thu, 7 May 2015 21:59:41 +0800 Message-ID: <554B6FCD.3030804@cn.fujitsu.com> References: <1430980646-316-1-git-send-email-yanghy@cn.fujitsu.com> <1430980646-316-6-git-send-email-yanghy@cn.fujitsu.com> <554B3FE5.2060300@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <554B3FE5.2060300@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 , xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, eddie.dong@intel.com, yunhong.jiang@intel.com, ian.jackson@eu.citrix.com, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On 05/07/2015 06:35 PM, Andrew Cooper wrote: > On 07/05/15 07:37, Yang Hongyang wrote: >> Set the hvm param HVM_PARAM_IDENT_PT second time will fail. >> So defer the setting of HVM_PARAM_IDENT_PT. >> >> Signed-off-by: Yang Hongyang > > I would argue that this is a Xen bug, not a migration bug. There is > nothing conceptually wrong with setting this param multiple times. I noticed that in legacy migration, this was set multiple times, so this patch is only a workaround that will avoid the fail in my test. will try your hypervisor patch tomorrow. > > Please try the following hypervisor patch instead: > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index 3a09439..9ee56b3 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -5748,12 +5748,13 @@ long do_hvm_op(unsigned long op, > XEN_GUEST_HANDLE_PARAM(void) arg) > if ( curr_d == d ) > break; > > - rc = -EINVAL; > - if ( d->arch.hvm_domain.params[a.index] != 0 ) > - break; > - > rc = 0; > - if ( !paging_mode_hap(d) ) > + d->arch.hvm_domain.params[a.index] = a.value; > + /* > + * Only actually required for VT-x lacking > unrestricted_guest > + * capabilities. Short circuit the pause if possible. > + */ > + if ( !paging_mode_hap(d) || !cpu_has_vmx ) > break; > > /* > @@ -5767,7 +5768,6 @@ long do_hvm_op(unsigned long op, > XEN_GUEST_HANDLE_PARAM(void) arg) > > rc = 0; > domain_pause(d); > - d->arch.hvm_domain.params[a.index] = a.value; > for_each_vcpu ( d, v ) > paging_update_cr3(v); > domain_unpause(d); > > . > -- Thanks, Yang.