ia64/xen-unstable

changeset 9195:766817372cab

Fix call to set_timer in vlapic.c. Should not set timer.expires
outside set_timer, since set_timer will do that for the caller.

Signed-off-by: Xin Li <xin.b.li@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 08 15:49:04 2006 +0100 (2006-03-08)
parents 53b0dc1cb1db
children aae274b4c1a7
files xen/arch/x86/hvm/vlapic.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vlapic.c	Wed Mar 08 15:39:59 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/vlapic.c	Wed Mar 08 15:49:04 2006 +0100
     1.3 @@ -239,9 +239,7 @@ static int vlapic_accept_irq(struct vcpu
     1.4  
     1.5      case VLAPIC_DELIV_MODE_INIT:
     1.6          if ( !level && trig_mode == 1 )     //Deassert
     1.7 -        {
     1.8              printk("This hvm_vlapic is for P4, no work for De-assert init\n");
     1.9 -        }
    1.10          else
    1.11          {
    1.12              /* FIXME How to check the situation after vcpu reset? */
    1.13 @@ -529,7 +527,6 @@ static void vlapic_read_aligned(struct v
    1.14  
    1.15              counter_passed = passed /
    1.16                               (APIC_BUS_CYCLE_NS * vlapic->timer_divide_count);
    1.17 -
    1.18              vlapic->timer_current_count -= counter_passed;
    1.19              if ( vlapic->timer_current_count <= 0 )
    1.20              {
    1.21 @@ -769,16 +766,15 @@ static void vlapic_write(struct vcpu *v,
    1.22              offset = APIC_BUS_CYCLE_NS *
    1.23                       vlapic->timer_divide_count *
    1.24                       vlapic->timer_initial_count;
    1.25 -            vlapic->vlapic_timer.expires = now + offset;
    1.26  
    1.27 -            set_timer(&vlapic->vlapic_timer, vlapic->vlapic_timer.expires);
    1.28 +            set_timer(&vlapic->vlapic_timer, now + offset);
    1.29  
    1.30              HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
    1.31                          "bus cycle is %"PRId64"ns, now 0x%016"PRIx64", "
    1.32                          "timer initial count 0x%x, offset 0x%016"PRIx64", "
    1.33                          "expire @ 0x%016"PRIx64".",
    1.34                          APIC_BUS_CYCLE_NS, now, vlapic->timer_initial_count,
    1.35 -                        offset, vlapic->vlapic_timer.expires);
    1.36 +                        offset, now + offset);
    1.37          }
    1.38          break;
    1.39  
    1.40 @@ -873,8 +869,7 @@ void vlapic_timer_fn(void *data)
    1.41          offset = APIC_BUS_CYCLE_NS *
    1.42                   vlapic->timer_divide_count *
    1.43                   vlapic->timer_initial_count;
    1.44 -        vlapic->vlapic_timer.expires = now + offset;
    1.45 -        set_timer(&vlapic->vlapic_timer, vlapic->vlapic_timer.expires);
    1.46 +        set_timer(&vlapic->vlapic_timer, now + offset);
    1.47      }
    1.48      else
    1.49          vlapic->timer_current_count = 0;
    1.50 @@ -890,7 +885,8 @@ void vlapic_timer_fn(void *data)
    1.51                  "now 0x%016"PRIx64", expire @ 0x%016"PRIx64", "
    1.52                  "timer initial count 0x%x, timer current count 0x%x.",
    1.53                  now, vlapic->vlapic_timer.expires,
    1.54 -                vlapic->timer_initial_count, vlapic->timer_current_count);
    1.55 +                vlapic->timer_initial_count,
    1.56 +                vlapic->timer_current_count);
    1.57  }
    1.58  
    1.59  #if 0