ia64/xen-unstable

changeset 16289:eaa8014ef779

x86, hvm: Fix 'no_missed_tick_accoutning' timer mode.
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Wed Oct 31 09:14:49 2007 +0000 (2007-10-31)
parents 7eb68d995aa7
children c7d5d229f191
files xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/vpt.c
line diff
     1.1 --- a/xen/arch/x86/hvm/hvm.c	Tue Oct 30 16:25:58 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/hvm.c	Wed Oct 31 09:14:49 2007 +0000
     1.3 @@ -1849,7 +1849,8 @@ long do_hvm_op(unsigned long op, XEN_GUE
     1.4              case HVM_PARAM_TIMER_MODE:
     1.5                  rc = -EINVAL;
     1.6                  if ( (a.value != HVMPTM_delay_for_missed_ticks) &&
     1.7 -                     (a.value != HVMPTM_no_delay_for_missed_ticks) )
     1.8 +                     (a.value != HVMPTM_no_delay_for_missed_ticks) &&
     1.9 +                     (a.value != HVMPTM_no_missed_tick_accounting) )
    1.10                      goto param_fail;
    1.11                  break;
    1.12              }
     2.1 --- a/xen/arch/x86/hvm/vpt.c	Tue Oct 30 16:25:58 2007 +0000
     2.2 +++ b/xen/arch/x86/hvm/vpt.c	Wed Oct 31 09:14:49 2007 +0000
     2.3 @@ -118,7 +118,14 @@ void pt_restore_timer(struct vcpu *v)
     2.4      list_for_each_entry ( pt, head, list )
     2.5      {
     2.6          if ( !mode_is(v->domain, no_missed_tick_accounting) )
     2.7 +        {
     2.8              pt_process_missed_ticks(pt);
     2.9 +        }
    2.10 +        else if ( (NOW() - pt->scheduled) >= 0 )
    2.11 +        {
    2.12 +            pt->pending_intr_nr++;
    2.13 +            pt->scheduled = NOW() + pt->period;
    2.14 +        }
    2.15          set_timer(&pt->timer, pt->scheduled);
    2.16      }
    2.17  
    2.18 @@ -139,14 +146,7 @@ static void pt_timer_fn(void *data)
    2.19      {
    2.20          pt->scheduled += pt->period;
    2.21          if ( !mode_is(pt->vcpu->domain, no_missed_tick_accounting) )
    2.22 -        {
    2.23              pt_process_missed_ticks(pt);
    2.24 -        }
    2.25 -        else if ( (NOW() - pt->scheduled) >= 0 )
    2.26 -        {
    2.27 -            pt->pending_intr_nr++;
    2.28 -            pt->scheduled = NOW() + pt->period;
    2.29 -        }
    2.30          set_timer(&pt->timer, pt->scheduled);
    2.31      }
    2.32