]> xenbits.xen.org Git - xenclient/xen-pq.git/commitdiff
Move update rtc to host resume code path. master
authorKamala Narasimhan <kamala.narasimhan@citrix.com>
Fri, 29 Jan 2010 09:45:29 +0000 (04:45 -0500)
committerKamala Narasimhan <kamala.narasimhan@citrix.com>
Fri, 29 Jan 2010 09:45:29 +0000 (04:45 -0500)
As the incorrect guest time issue is encountered only after a host resume from S3, move rtc update to host resume code path.

master/rtc-update-clock-upon-resume-from-s3

index ba31365872df9cf6c707f7bc6f4783389f9bba95..f32269bd0e1389326e745e185bfd955d2ede5a51 100644 (file)
@@ -1,15 +1,33 @@
-diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
-index e7a0d05..0a90f5f 100644
---- a/xen/arch/x86/hvm/hvm.c
-+++ b/xen/arch/x86/hvm/hvm.c
-@@ -2325,7 +2325,10 @@ 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) )
+diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
+index 9e9ff9b..ef60265 100644
+--- a/xen/arch/x86/time.c
++++ b/xen/arch/x86/time.c
+@@ -859,6 +859,19 @@ void update_domain_wallclock_time(struct domain *d)
+     spin_unlock(&wc_lock);
+ }
++static void update_domain_rtc(void)
++{
++    struct domain *d;
++
++    rcu_read_lock(&domlist_read_lock);
++    for_each_domain ( d )
 +    {
-+        rtc_update_clock(d);
-         domain_unpause(d);
++        if ( is_hvm_domain(d) )
++            rtc_update_clock(d);
 +    }
++    rcu_read_unlock(&domlist_read_lock);
++}
++
+ void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+ {
+     d->time_offset_seconds = time_offset_seconds;
+@@ -1370,6 +1383,8 @@ int time_resume(void)
+     update_vcpu_system_time(current);
++    update_domain_rtc();
++
+     return 0;
  }
  
- static int hvmop_set_isa_irq_level(