From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hongyang Yang Subject: Re: [PATCH v2 1/6] xen/hvm: Permit HVM_PARAM_IDENT_PT to be set more than once Date: Mon, 11 May 2015 15:51:45 +0800 Message-ID: <55505F91.3050309@cn.fujitsu.com> References: <1431119675-23847-1-git-send-email-andrew.cooper3@citrix.com> <1431119675-23847-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1431119675-23847-2-git-send-email-andrew.cooper3@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 Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org I've reviewed all of the series, looks good to me in general, I will rebase my patches on top of this series. Would you like me to take this series and send it together with mine? On 05/09/2015 05:14 AM, Andrew Cooper wrote: > There is no conceptual problem with setting this parameter more than once. > Checkpointed migration streams will typically set it once per checkpoint to > the same value. > > The parameter is only actually needed on early-generation VT-x which lacked > the unrestricted guest capability, although it could plausibly be used on > newer VT-x with unusual execution control settings. Short circuit the > expensive operations on non VT-x hardware. > > The parameter itself must always be latched to avoid issues if the VM > eventually migrates to a host which needs to use the pagetable. > > Signed-off-by: Andrew Cooper > CC: Keir Fraser > CC: Jan Beulich > CC: Yang Hongyang > > --- > v2: Don't expose new value prematurely to VT-x > --- > xen/arch/x86/hvm/hvm.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index 8140a27..85dfa52 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -5730,13 +5730,15 @@ static int hvmop_set_param( > rc = -EINVAL; > break; > case HVM_PARAM_IDENT_PT: > - rc = -EINVAL; > - if ( d->arch.hvm_domain.params[a.index] != 0 ) > - break; > - > - rc = 0; > - if ( !paging_mode_hap(d) ) > + /* > + * Only actually required for VT-x lacking unrestricted_guest > + * capabilities. Short circuit the pause if possible. > + */ > + if ( !paging_mode_hap(d) || !cpu_has_vmx ) > + { > + d->arch.hvm_domain.params[a.index] = a.value; > break; > + } > > /* > * Update GUEST_CR3 in each VMCS to point at identity map. > -- Thanks, Yang.