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-bugs

[Xen-bugs] [Bug 1098] [version 3.1.0_15042-51] clocksource/0: Time went

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 1098] [version 3.1.0_15042-51] clocksource/0: Time went backwards
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Thu, 1 Nov 2007 20:34:18 -0700
Delivery-date: Thu, 01 Nov 2007 20:34:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <bug-1098-3@xxxxxxxxxxxxxxxxxxxxxxxxxxx/bugzilla/>
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1098





------- Comment #8 from sakaia@xxxxxxxxxxxxxx  2007-11-01 20:34 -------
You should replace the function from opensuse kernel to linux 2.6.23
opensuse code does not consider sync to hypervisor.

====opensuse 2.6.22 xen3-patch-2.6.18 ===
+static cycle_t xen_clocksource_read(void)
+{
+       int cpu = get_cpu();
+       struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
+       cycle_t ret;
+
+       get_time_values_from_xen(cpu);
+
+       ret = shadow->system_timestamp + get_nsec_offset(shadow);
+
+       put_cpu();
+
+#ifdef CONFIG_SMP
+       for (;;) {
+               static cycle_t last_ret;
+#ifndef CONFIG_64BIT
+               cycle_t last = cmpxchg64(&last_ret, 0, 0);
+#else
+               cycle_t last = last_ret;
+#define cmpxchg64 cmpxchg
+#endif
+
+               if ((s64)(ret - last) < 0) {
+                       if (last - ret > permitted_clock_jitter
+                           && printk_ratelimit())
+                               printk(KERN_WARNING "clocksource/%d: "
+                                      "Time went backwards: "
+                                      "delta=%Ld shadow=%Lu offset=%Lu\n",
+                                      cpu, ret - last,
+                                      shadow->system_timestamp,
+                                      get_nsec_offset(shadow));
+                       ret = last;
+               }
+               if (cmpxchg64(&last_ret, last, ret) == last)
+                       break;
+       }
+#endif
+
+       return ret;
+}

==> to Linux 2.6.23 xen_clocksource_read.

static cycle_t xen_clocksource_read(void)
{
        struct shadow_time_info *shadow = &get_cpu_var(shadow_time);
        cycle_t ret;
        unsigned version;

        do {
                version = get_time_values_from_xen();
                barrier();
                ret = shadow->system_timestamp + get_nsec_offset(shadow);
                barrier();
        } while (version != __get_cpu_var(xen_vcpu)->time.version);

        put_cpu_var(shadow_time);

        return ret;
}


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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