ia64/xen-unstable

changeset 4009:b8499cab3e04

bitkeeper revision 1.1159.258.25 (422dab6bOBL6I9LRZYfF0ExfT5VXww)

Must always send VIRQ_TIMER to a blocked guest.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 08 13:40:59 2005 +0000 (2005-03-08)
parents e674bd389503
children 48afe8809bec 4755ec1437fb
files xen/arch/x86/time.c xen/common/schedule.c xen/include/xen/time.h
line diff
     1.1 --- a/xen/arch/x86/time.c	Tue Mar 08 09:55:22 2005 +0000
     1.2 +++ b/xen/arch/x86/time.c	Tue Mar 08 13:40:59 2005 +0000
     1.3 @@ -276,13 +276,13 @@ s_time_t get_s_time(void)
     1.4  }
     1.5  
     1.6  
     1.7 -void update_dom_time(struct domain *d)
     1.8 +int update_dom_time(struct domain *d)
     1.9  {
    1.10      shared_info_t *si = d->shared_info;
    1.11      unsigned long flags;
    1.12  
    1.13      if ( d->last_propagated_timestamp == full_tsc_irq )
    1.14 -        return;
    1.15 +        return 0;
    1.16  
    1.17      read_lock_irqsave(&time_lock, flags);
    1.18  
    1.19 @@ -302,7 +302,7 @@ void update_dom_time(struct domain *d)
    1.20  
    1.21      read_unlock_irqrestore(&time_lock, flags);
    1.22  
    1.23 -    send_guest_virq(d, VIRQ_TIMER);
    1.24 +    return 1;
    1.25  }
    1.26  
    1.27  
    1.28 @@ -330,7 +330,8 @@ void do_settime(unsigned long secs, unsi
    1.29  
    1.30      /* Others will pick up the change at the next tick. */
    1.31      current->last_propagated_timestamp = 0; /* force propagation */
    1.32 -    update_dom_time(current);
    1.33 +    (void)update_dom_time(current);
    1.34 +    send_guest_virq(current, VIRQ_TIMER);
    1.35  }
    1.36  
    1.37  
     2.1 --- a/xen/common/schedule.c	Tue Mar 08 09:55:22 2005 +0000
     2.2 +++ b/xen/common/schedule.c	Tue Mar 08 13:40:59 2005 +0000
     2.3 @@ -396,8 +396,8 @@ void __enter_scheduler(void)
     2.4      clear_bit(DF_RUNNING, &prev->flags);
     2.5  
     2.6      /* Ensure that the domain has an up-to-date time base. */
     2.7 -    if ( !is_idle_task(next) )
     2.8 -        update_dom_time(next);
     2.9 +    if ( !is_idle_task(next) && update_dom_time(next) )
    2.10 +        send_guest_virq(next, VIRQ_TIMER);
    2.11  
    2.12      schedule_tail(next);
    2.13  
    2.14 @@ -434,8 +434,8 @@ static void t_timer_fn(unsigned long unu
    2.15  
    2.16      TRACE_0D(TRC_SCHED_T_TIMER_FN);
    2.17  
    2.18 -    if ( !is_idle_task(d) )
    2.19 -        update_dom_time(d);
    2.20 +    if ( !is_idle_task(d) && update_dom_time(d) )
    2.21 +        send_guest_virq(d, VIRQ_TIMER);
    2.22  
    2.23      t_timer[d->processor].expires = NOW() + MILLISECS(10);
    2.24      add_ac_timer(&t_timer[d->processor]);
    2.25 @@ -446,7 +446,8 @@ static void dom_timer_fn(unsigned long d
    2.26  {
    2.27      struct domain *d = (struct domain *)data;
    2.28      TRACE_0D(TRC_SCHED_DOM_TIMER_FN);
    2.29 -    update_dom_time(d);
    2.30 +    (void)update_dom_time(d);
    2.31 +    send_guest_virq(d, VIRQ_TIMER);
    2.32  }
    2.33  
    2.34  /* Initialise the data structures. */
     3.1 --- a/xen/include/xen/time.h	Tue Mar 08 09:55:22 2005 +0000
     3.2 +++ b/xen/include/xen/time.h	Tue Mar 08 13:40:59 2005 +0000
     3.3 @@ -53,7 +53,7 @@ s_time_t get_s_time(void);
     3.4  #define MICROSECS(_us)  (((s_time_t)(_us)) * 1000ULL )
     3.5  
     3.6  struct domain;
     3.7 -extern void update_dom_time(struct domain *d);
     3.8 +extern int update_dom_time(struct domain *d);
     3.9  extern void do_settime(unsigned long secs, unsigned long usecs, 
    3.10                         u64 system_time_base);
    3.11