ia64/xen-unstable

changeset 5940:ac7176771024

While merging my development tree with the latest hg tree I noticed that
VMX support was broken. When you boot an unmodified Linux kernel it gets
stuck in the "Calibrating delay" loop. The reason for this is that the
vmx code is repeatedly delivering timer interrupts.

Correcting the MILLISECS() and friends macros to return s_time_t instead
of ULL fixes this problem. The other changes are just to get rid of
redundant code and variables.

Signed-Off-By: Leendert van Doorn <leendert@watson.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 01 09:16:25 2005 +0000 (2005-08-01)
parents 55a5ad2f028d
children ae51fa1d32b2
files xen/arch/x86/vmx_intercept.c xen/include/xen/time.h
line diff
     1.1 --- a/xen/arch/x86/vmx_intercept.c	Fri Jul 29 11:21:39 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_intercept.c	Mon Aug 01 09:16:25 2005 +0000
     1.3 @@ -197,8 +197,7 @@ int intercept_pit_io(ioreq_t *p)
     1.4  static void pit_timer_fn(void *data)
     1.5  {
     1.6      struct vmx_virpit_t *vpit = data;
     1.7 -    s_time_t   next;
     1.8 -    int        missed_ticks;
     1.9 +    int missed_ticks;
    1.10  
    1.11      missed_ticks = (NOW() - vpit->scheduled) / MILLISECS(vpit->period);
    1.12  
    1.13 @@ -208,12 +207,11 @@ static void pit_timer_fn(void *data)
    1.14  
    1.15      /* pick up missed timer tick */
    1.16      if ( missed_ticks > 0 ) {
    1.17 -        vpit->pending_intr_nr+= missed_ticks;
    1.18 +        vpit->pending_intr_nr += missed_ticks;
    1.19          vpit->scheduled += missed_ticks * MILLISECS(vpit->period);
    1.20      }
    1.21 -    next = vpit->scheduled + MILLISECS(vpit->period);
    1.22 -    set_ac_timer(&vpit->pit_timer, next);
    1.23 -    vpit->scheduled = next;
    1.24 +    vpit->scheduled += MILLISECS(vpit->period);
    1.25 +    set_ac_timer(&vpit->pit_timer, vpit->scheduled);
    1.26  }
    1.27  
    1.28  
     2.1 --- a/xen/include/xen/time.h	Fri Jul 29 11:21:39 2005 +0000
     2.2 +++ b/xen/include/xen/time.h	Mon Aug 01 09:16:25 2005 +0000
     2.3 @@ -51,9 +51,9 @@ typedef s64 s_time_t;
     2.4  s_time_t get_s_time(void);
     2.5  
     2.6  #define NOW()           ((s_time_t)get_s_time())
     2.7 -#define SECONDS(_s)     (((s_time_t)(_s))  * 1000000000ULL )
     2.8 -#define MILLISECS(_ms)  (((s_time_t)(_ms)) * 1000000ULL )
     2.9 -#define MICROSECS(_us)  (((s_time_t)(_us)) * 1000ULL )
    2.10 +#define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
    2.11 +#define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
    2.12 +#define MICROSECS(_us)  ((s_time_t)((_us) * 1000ULL))
    2.13  
    2.14  extern void update_dom_time(struct vcpu *v);
    2.15  extern void do_settime(