]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: reset TSC to 0 after domain resume from S3
authorTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Fri, 22 Nov 2013 13:47:24 +0000 (14:47 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Nov 2013 13:47:24 +0000 (14:47 +0100)
Host S3 implicitly resets the host TSC to 0, but the tsc offset for hvm
domains is not recalculated when they resume, causing it to go into
negative values. In Linux guest using tsc clocksource, this results in
a hang after wrap back to positive values since the tsc clocksource
implementation expects it reset.

Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
xen/arch/x86/hvm/hvm.c

index 3b353ecaa1c5d867f48b9263158c34a5d04c9a9e..b76f041eb06192e5f90e2a8a9eab25f577ddce3b 100644 (file)
@@ -3737,7 +3737,13 @@ static void hvm_s3_suspend(struct domain *d)
 static void hvm_s3_resume(struct domain *d)
 {
     if ( test_and_clear_bool(d->arch.hvm_domain.is_s3_suspended) )
+    {
+        struct vcpu *v;
+
+        for_each_vcpu( d, v )
+            hvm_set_guest_tsc(v, 0);
         domain_unpause(d);
+    }
 }
 
 static int hvmop_set_isa_irq_level(