From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH Remus v1 5/8] tools/libxc: defer the setting of HVM_PARAM_IDENT_PT Date: Thu, 7 May 2015 11:35:17 +0100 Message-ID: <554B3FE5.2060300@citrix.com> References: <1430980646-316-1-git-send-email-yanghy@cn.fujitsu.com> <1430980646-316-6-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: <1430980646-316-6-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, 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 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. 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);