Skip to contentSkip to conversation

fix time reporting to guest

PATCH New Jan Beulich 1 participant 1 message Mar 26, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix time reporting to guest

The recent change to guest time handling dropped a call to update_vcpu_system_time(), leading to time-went-backwards messages and guest hangs (the latter were observed only in 2.6.21-rc4 and only when no serial console was in use). Re-adding that missing call, and at once also adding one before raising a single shot timer event.

Debugging the issue also revealed that some commented out debug printk-s in x86's time handling code didn't compile under x86-64.

xen/arch/x86/time.c +2 -2
Index: 2007-03-19/xen/arch/x86/time.c
===================================================================
@@ -771,9 +771,9 @@ static void local_time_calibration(void 
     local_irq_enable();
 
 #if 0
-    printk("PRE%d: tsc=%lld stime=%lld master=%lld\n",
+    printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
            smp_processor_id(), prev_tsc, prev_local_stime, prev_master_stime);
-    printk("CUR%d: tsc=%lld stime=%lld master=%lld -> %lld\n",
+    printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64" -> %"PRId64"\n",
            smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
            curr_master_stime - curr_local_stime);
 #endif
xen/common/schedule.c +2 -0
Index: 2007-03-19/xen/common/schedule.c
===================================================================
@@ -691,6 +691,7 @@ static void s_timer_fn(void *unused)
 static void vcpu_periodic_timer_fn(void *data)
 {
     struct vcpu *v = data;
+    update_vcpu_system_time(v);
     vcpu_periodic_timer_work(v);
 }
 
@@ -698,6 +699,7 @@ static void vcpu_periodic_timer_fn(void 
 static void vcpu_singleshot_timer_fn(void *data)
 {
     struct vcpu *v = data;
+    update_vcpu_system_time(v);
     send_timer_event(v);
 }