bitkeeper revision 1.1159.258.25 (422dab6bOBL6I9LRZYfF0ExfT5VXww)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Mar 2005 13:40:59 +0000 (13:40 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Mar 2005 13:40:59 +0000 (13:40 +0000)
Must always send VIRQ_TIMER to a blocked guest.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
xen/arch/x86/time.c
xen/common/schedule.c
xen/include/xen/time.h

index 685160cd14c426eee2141c2cc130e6a9167ca3d7..06b0acf44af18a3b0c42d458f55c038ee80bd9b3 100644 (file)
@@ -276,13 +276,13 @@ s_time_t get_s_time(void)
 }
 
 
-void update_dom_time(struct domain *d)
+int update_dom_time(struct domain *d)
 {
     shared_info_t *si = d->shared_info;
     unsigned long flags;
 
     if ( d->last_propagated_timestamp == full_tsc_irq )
-        return;
+        return 0;
 
     read_lock_irqsave(&time_lock, flags);
 
@@ -302,7 +302,7 @@ void update_dom_time(struct domain *d)
 
     read_unlock_irqrestore(&time_lock, flags);
 
-    send_guest_virq(d, VIRQ_TIMER);
+    return 1;
 }
 
 
@@ -330,7 +330,8 @@ void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
 
     /* Others will pick up the change at the next tick. */
     current->last_propagated_timestamp = 0; /* force propagation */
-    update_dom_time(current);
+    (void)update_dom_time(current);
+    send_guest_virq(current, VIRQ_TIMER);
 }
 
 
index 09c3e77ad9701a9d359d65cb0e9bbc4012ee43ad..62f764e9d9aa73675c943994b5a69f6ebe449b26 100644 (file)
@@ -396,8 +396,8 @@ void __enter_scheduler(void)
     clear_bit(DF_RUNNING, &prev->flags);
 
     /* Ensure that the domain has an up-to-date time base. */
-    if ( !is_idle_task(next) )
-        update_dom_time(next);
+    if ( !is_idle_task(next) && update_dom_time(next) )
+        send_guest_virq(next, VIRQ_TIMER);
 
     schedule_tail(next);
 
@@ -434,8 +434,8 @@ static void t_timer_fn(unsigned long unused)
 
     TRACE_0D(TRC_SCHED_T_TIMER_FN);
 
-    if ( !is_idle_task(d) )
-        update_dom_time(d);
+    if ( !is_idle_task(d) && update_dom_time(d) )
+        send_guest_virq(d, VIRQ_TIMER);
 
     t_timer[d->processor].expires = NOW() + MILLISECS(10);
     add_ac_timer(&t_timer[d->processor]);
@@ -446,7 +446,8 @@ static void dom_timer_fn(unsigned long data)
 {
     struct domain *d = (struct domain *)data;
     TRACE_0D(TRC_SCHED_DOM_TIMER_FN);
-    update_dom_time(d);
+    (void)update_dom_time(d);
+    send_guest_virq(d, VIRQ_TIMER);
 }
 
 /* Initialise the data structures. */
index e725c4ed94efa876cb442a87c1321edefb50cd85..4df2e96a5529d73fde95bfa24a0731583aa2cca3 100644 (file)
@@ -53,7 +53,7 @@ s_time_t get_s_time(void);
 #define MICROSECS(_us)  (((s_time_t)(_us)) * 1000ULL )
 
 struct domain;
-extern void update_dom_time(struct domain *d);
+extern int update_dom_time(struct domain *d);
 extern void do_settime(unsigned long secs, unsigned long usecs, 
                        u64 system_time_base);