ia64/xen-unstable

changeset 16146:b4278beaf354

hvm: Fix one-shot timers. Do not disable until the interrupt has been
latched by the target VCPU.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Wed Oct 17 13:12:03 2007 +0100 (2007-10-17)
parents d994e6d3136d
children ca2984b17fcf
files xen/arch/x86/hvm/vpt.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vpt.c	Wed Oct 17 11:17:53 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/vpt.c	Wed Oct 17 13:12:03 2007 +0100
     1.3 @@ -46,7 +46,7 @@ static void missed_ticks(struct periodic
     1.4  {
     1.5      s_time_t missed_ticks;
     1.6  
     1.7 -    if ( unlikely(pt->one_shot) )
     1.8 +    if ( pt->one_shot )
     1.9          return;
    1.10  
    1.11      missed_ticks = NOW() - pt->scheduled;
    1.12 @@ -115,12 +115,7 @@ static void pt_timer_fn(void *data)
    1.13  
    1.14      pt->pending_intr_nr++;
    1.15  
    1.16 -    if ( unlikely(pt->one_shot) )
    1.17 -    {
    1.18 -        pt->enabled = 0;
    1.19 -        list_del(&pt->list);
    1.20 -    }
    1.21 -    else
    1.22 +    if ( !pt->one_shot )
    1.23      {
    1.24          pt->scheduled += pt->period;
    1.25          missed_ticks(pt);
    1.26 @@ -212,10 +207,16 @@ void pt_intr_post(struct vcpu *v, struct
    1.27          return;
    1.28      }
    1.29  
    1.30 -    ASSERT(pt->vcpu == v);
    1.31 -
    1.32 -    pt->pending_intr_nr--;
    1.33 -    pt->last_plt_gtime += pt->period_cycles;
    1.34 +    if ( pt->one_shot )
    1.35 +    {
    1.36 +        pt->enabled = 0;
    1.37 +        list_del(&pt->list);
    1.38 +    }
    1.39 +    else
    1.40 +    {
    1.41 +        pt->pending_intr_nr--;
    1.42 +        pt->last_plt_gtime += pt->period_cycles;
    1.43 +    }
    1.44  
    1.45      if ( hvm_get_guest_time(v) < pt->last_plt_gtime )
    1.46          hvm_set_guest_time(v, pt->last_plt_gtime);