ia64/xen-unstable

changeset 4011:1c258906f43e

bitkeeper revision 1.1236.12.7 (422dacdcZEjp_SXRvSpRKap0KtkBag)

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:47:08 2005 +0000 (2005-03-08)
parents 48afe8809bec
children cb6267631f70
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 13:41:38 2005 +0000
     1.2 +++ b/xen/arch/x86/time.c	Tue Mar 08 13:47:08 2005 +0000
     1.3 @@ -296,17 +296,18 @@ static inline void __update_dom_time(str
     1.4      spin_unlock(&d->time_lock);
     1.5  }
     1.6  
     1.7 -void update_dom_time(struct exec_domain *ed)
     1.8 +int update_dom_time(struct exec_domain *ed)
     1.9  {
    1.10      unsigned long flags;
    1.11  
    1.12 -    if ( ed->domain->shared_info->tsc_timestamp != full_tsc_irq )
    1.13 -    {
    1.14 -        read_lock_irqsave(&time_lock, flags);
    1.15 -        __update_dom_time(ed);
    1.16 -        read_unlock_irqrestore(&time_lock, flags);
    1.17 -        send_guest_virq(ed, VIRQ_TIMER);
    1.18 -    }
    1.19 +    if ( ed->domain->shared_info->tsc_timestamp == full_tsc_irq )
    1.20 +        return 0;
    1.21 +
    1.22 +    read_lock_irqsave(&time_lock, flags);
    1.23 +    __update_dom_time(ed);
    1.24 +    read_unlock_irqrestore(&time_lock, flags);
    1.25 +
    1.26 +    return 1;
    1.27  }
    1.28  
    1.29  /* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
     2.1 --- a/xen/common/schedule.c	Tue Mar 08 13:41:38 2005 +0000
     2.2 +++ b/xen/common/schedule.c	Tue Mar 08 13:47:08 2005 +0000
     2.3 @@ -457,8 +457,8 @@ void __enter_scheduler(void)
     2.4      clear_bit(EDF_RUNNING, &prev->ed_flags);
     2.5  
     2.6      /* Ensure that the domain has an up-to-date time base. */
     2.7 -    if ( !is_idle_task(next->domain) )
     2.8 -        update_dom_time(next);
     2.9 +    if ( !is_idle_task(next->domain) && update_dom_time(next) )
    2.10 +        send_guest_virq(next, VIRQ_TIMER);
    2.11  
    2.12      schedule_tail(next);
    2.13  
    2.14 @@ -495,8 +495,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(ed->domain) )
    2.19 -        update_dom_time(ed);
    2.20 +    if ( !is_idle_task(ed->domain) && update_dom_time(ed) )
    2.21 +        send_guest_virq(ed, VIRQ_TIMER);
    2.22  
    2.23      t_timer[ed->processor].expires = NOW() + MILLISECS(10);
    2.24      add_ac_timer(&t_timer[ed->processor]);
    2.25 @@ -508,7 +508,8 @@ static void dom_timer_fn(unsigned long d
    2.26      struct exec_domain *ed = (struct exec_domain *)data;
    2.27  
    2.28      TRACE_0D(TRC_SCHED_DOM_TIMER_FN);
    2.29 -    update_dom_time(ed);
    2.30 +    (void)update_dom_time(ed);
    2.31 +    send_guest_virq(ed, VIRQ_TIMER);
    2.32  }
    2.33  
    2.34  /* Initialise the data structures. */
     3.1 --- a/xen/include/xen/time.h	Tue Mar 08 13:41:38 2005 +0000
     3.2 +++ b/xen/include/xen/time.h	Tue Mar 08 13:47:08 2005 +0000
     3.3 @@ -54,7 +54,7 @@ s_time_t get_s_time(void);
     3.4  #define MILLISECS(_ms)  (((s_time_t)(_ms)) * 1000000ULL )
     3.5  #define MICROSECS(_us)  (((s_time_t)(_us)) * 1000ULL )
     3.6  
     3.7 -extern void update_dom_time(struct exec_domain *ed);
     3.8 +extern int update_dom_time(struct exec_domain *ed);
     3.9  extern void do_settime(unsigned long secs, unsigned long usecs, 
    3.10                         u64 system_time_base);
    3.11