From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v3 for 4.5] x86/viridian: Freeze time reference counter when domain is paused Date: Thu, 16 Oct 2014 10:46:00 +0100 Message-ID: <543F93D8.5080009@citrix.com> References: <1413451271-47779-1-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XehdH-0004Vk-5X for xen-devel@lists.xenproject.org; Thu, 16 Oct 2014 09:46:08 +0000 In-Reply-To: <1413451271-47779-1-git-send-email-paul.durrant@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: Paul Durrant , xen-devel@lists.xenproject.org Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 16/10/14 10:21, Paul Durrant wrote: > In XenServer system test it has become apparent that versions of Windows > that make use of the time reference counter enlightenment cannot cope with > large jumps forward in the value read from the MSR. Specifically, > suspending a very large domain took approx. 45 minutes to complete and > when the domain was resumed it was discovered that the WMI (Windows > Management Instrumentation) service had hung. > > The reason a large jump forward is seen by the guest is that, when a guest > is suspended, the guest stops running when the SCHEDOP_suspend hypercall is > made, however the MSR value essentially keeps incrementing until the > tool-stack issues DOMCTL_gethvmcontext. > > This patch adds code to freeze the value of the time reference counter > on domain pause and 'thaw' it on domain unpause, but only thaw it if the > domain is not shutting down. The absolute value of the counter is then > saved in the viridian domain context record. This prevents the guest OS > from experiencing large jumps in the value of the MSR and has been shown > to reliably fix the problem with WMI. > > Signed-off-by: Paul Durrant > Cc: Keir Fraser > Cc: Jan Beulich > Cc: Andrew Cooper Reviewed-by: Andrew Cooper One nit, which could be fixed on commit given --whitespace=fix > diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c > index 6726168..7d55363 100644 > --- a/xen/arch/x86/hvm/viridian.c > +++ b/xen/arch/x86/hvm/viridian.c > @@ -450,9 +484,10 @@ static int viridian_save_domain_ctxt(struct domain *d, hvm_domain_context_t *h) > if ( !is_viridian_domain(d) ) > return 0; > > - ctxt.hypercall_gpa = d->arch.hvm_domain.viridian.hypercall_gpa.raw; > - ctxt.guest_os_id = d->arch.hvm_domain.viridian.guest_os_id.raw; > - > + ctxt.time_ref_count = d->arch.hvm_domain.viridian.time_ref_count.val; > + ctxt.hypercall_gpa = d->arch.hvm_domain.viridian.hypercall_gpa.raw; > + ctxt.guest_os_id = d->arch.hvm_domain.viridian.guest_os_id.raw; > + Introduction of trailing whitespace into the blank line. ~Andrew