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

[Xen-changelog] [xen-unstable] [IA64] Fix time_resume()



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1178223699 21600
# Node ID 204046d995621fe88649daaaffa32ee42c18cdd4
# Parent  a141484a91d0c420f1227e0914d61aaf74fb406b
[IA64] Fix time_resume()

Add missing exclusion in time_resume() and steal time accounting
reinitialization after resume.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/kernel/time.c    |   56 ++++++++++++++++++++++++
 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c |   13 -----
 2 files changed, 56 insertions(+), 13 deletions(-)

diff -r a141484a91d0 -r 204046d99562 
linux-2.6-xen-sparse/arch/ia64/kernel/time.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/time.c      Thu May 03 14:14:41 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/time.c      Thu May 03 14:21:39 
2007 -0600
@@ -267,6 +267,62 @@ static void init_missing_ticks_accountin
        per_cpu(processed_stolen_time, cpu) = runstate->time[RUNSTATE_runnable]
                                            + runstate->time[RUNSTATE_offline];
 }
+
+static int xen_ia64_settimefoday_after_resume;
+
+static int __init __xen_ia64_settimeofday_after_resume(char *str)
+{
+       xen_ia64_settimefoday_after_resume = 1;
+       return 1;
+}
+
+__setup("xen_ia64_settimefoday_after_resume",
+        __xen_ia64_settimeofday_after_resume);
+
+/* Called after suspend, to resume time.  */
+void
+time_resume(void)
+{
+       unsigned int cpu;
+       
+       /* Just trigger a tick.  */
+       ia64_cpu_local_tick();
+
+       if (xen_ia64_settimefoday_after_resume) {
+               /* do_settimeofday() resets timer interplator */
+               struct timespec xen_time;
+               int ret;
+               efi_gettimeofday(&xen_time);
+
+               ret = do_settimeofday(&xen_time);
+               WARN_ON(ret);
+       } else {
+#if 0
+               /* adjust EFI time */
+               struct timespec my_time = CURRENT_TIME;
+               struct timespec xen_time;
+               static timespec diff;
+               struct xen_domctl domctl;
+               int ret;
+
+               efi_gettimeofday(&xen_time);
+               diff = timespec_sub(&xen_time, &my_time);
+               domctl.cmd = XEN_DOMCTL_settimeoffset;
+               domctl.domain = DOMID_SELF;
+               domctl.u.settimeoffset.timeoffset_seconds = diff.tv_sec;
+               ret = HYPERVISOR_domctl_op(&domctl);
+               WARN_ON(ret);
+#endif
+               /* Time interpolator remembers the last timer status.
+                  Forget it */
+               write_seqlock_irq(&xtime_lock);
+               time_interpolator_reset();
+               write_sequnlock_irq(&xtime_lock);
+       }
+
+       for_each_online_cpu(cpu)
+               init_missing_ticks_accounting(cpu);
+}
 #else
 #define init_missing_ticks_accounting(cpu) do {} while (0)
 #endif
diff -r a141484a91d0 -r 204046d99562 
linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Thu May 03 14:14:41 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Thu May 03 14:21:39 
2007 -0600
@@ -863,19 +863,6 @@ direct_remap_pfn_range(struct vm_area_st
 }
 
 
-/* Called after suspend, to resume time.  */
-void
-time_resume(void)
-{
-       extern void ia64_cpu_local_tick(void);
-
-       /* Just trigger a tick.  */
-       ia64_cpu_local_tick();
-
-       /* Time interpolator remembers the last timer status.  Forget it */
-       time_interpolator_reset();
-}
-
 ///////////////////////////////////////////////////////////////////////////
 // expose p2m table
 #ifdef CONFIG_XEN_IA64_EXPOSE_P2M

_______________________________________________
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®.