WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fixes for S3 suspend resume:
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Jan 2008 15:10:19 -0800
Delivery-date: Tue, 08 Jan 2008 15:10:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Fixes for S3 suspend resume:, Xen patchbot-unstable <=