From: "Jan Beulich" Subject: Re: TSC trouble in hvm linux, after host S3 Date: Wed, 20 Nov 2013 13:14:47 +0000 Message-ID: <528CC3D70200007800105082@nat28.tlf.novell.com> References: <528C95AE.6040308@citrix.com> <528C9FF0.2050706@citrix.com> <528CB0510200007800104FC0@nat28.tlf.novell.com> <528CA323.9040604@citrix.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 1Vj7cL-0006ho-Nv for xen-devel@lists.xenproject.org; Wed, 20 Nov 2013 13:14:53 +0000 In-Reply-To: <528CA323.9040604@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tomasz Wroblewski Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 20.11.13 at 12:55, Tomasz Wroblewski wrote: > On 11/20/2013 12:51 PM, Jan Beulich wrote: >>>>> On 20.11.13 at 12:41, Tomasz Wroblewski wrote: >>> I've since found out that VMCS seems to provide tsc offsetting capabilities; >>> adding something like >>> >>> for_each_vcpu ( d, v ) >>> { >>> if (v->vcpu_id == 0) >>> hvm_set_guest_tsc(v, 0); >>> } >>> >>> inside hvm_s3_resume (xen/arch/x86/hvm/hvm.c) fixed this for me; any comment >>> on such a solution? >> >> This sounds plausible, but I'd prefer it to be done alongside the other >> state resetting done for S3 (which all happen in hvm_s3_suspend()). >> Unless that doesn't work, of course. >> > All right, thanks! I'll try it out and post a patch, I think it should work. > I've only reset the tsc on vcpu 0 since I've noticed same is > done in hvm_vcpu_initialize(), is that enough? Honestly I don't immediately see why it's being done there for vCPU 0 only, and I don't think that's be sufficient for the resume case. Jan