[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: Fixes for S3 suspend resume:



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1199787191 0
# Node ID 4fcc8b64c2b5719e542e2d1be3dc93f8a29e6c0a
# Parent  25771a7c290703a232625892b147651f011703df
x86: Fixes for S3 suspend resume:
 - Fix wallclock resume by remembering the offset from CMOS time to
   UTC time
 - Restore dom0's CPU affinity (lost during
   continue_hypercall_on_cpu())

Signed-off-by: Xu Dongxiao <dongxiao.xu@xxxxxxxxx>
---
 xen/arch/x86/domain.c |    1 +
 xen/arch/x86/time.c   |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff -r 25771a7c2907 -r 4fcc8b64c2b5 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Jan 08 09:57:59 2008 +0000
+++ b/xen/arch/x86/domain.c     Tue Jan 08 10:13:11 2008 +0000
@@ -1420,6 +1420,7 @@ static void continue_hypercall_on_cpu_he
     regs->eax = info->func(info->data);
 
     v->arch.schedule_tail = info->saved_schedule_tail;
+    v->cpu_affinity = info->saved_affinity;
     v->arch.continue_info = NULL;
 
     xfree(info);
diff -r 25771a7c2907 -r 4fcc8b64c2b5 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Tue Jan 08 09:57:59 2008 +0000
+++ b/xen/arch/x86/time.c       Tue Jan 08 10:13:11 2008 +0000
@@ -971,8 +971,14 @@ unsigned long get_localtime(struct domai
         + d->time_offset_seconds;
 }
 
+/* "cmos_utc_offset" is the difference between UTC time and CMOS time. */
+static long cmos_utc_offset; /* in seconds */
+
 int time_suspend(void)
 {
+    cmos_utc_offset = (wc_sec + (wc_nsec + NOW()) / 1000000000ULL)
+        - get_cmos_time();
+
     /* Better to cancel calibration timer for accuracy. */
     kill_timer(&this_cpu(cpu_time).calibration_timer);
 
@@ -986,7 +992,8 @@ int time_resume(void)
     set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
 
     resume_platform_timer();
-    do_settime(get_cmos_time(), 0, read_platform_stime());
+
+    do_settime(get_cmos_time() + cmos_utc_offset, 0, read_platform_stime());
 
     init_percpu_time();
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.