direct-io.hg

changeset 5558:1a568bb6c3bb

bitkeeper revision 1.1740 (42ba88cewc_4MMbiCLInZ8gEcgqwhQ)

[PATCH] vmx-pit-reset2.patch

A VMX guest can reprogram the same PIT channel twice. We should not create
two ac_timers to handle this case.

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author arun.sharma@intel.com[kaf24]
date Thu Jun 23 10:02:54 2005 +0000 (2005-06-23)
parents 678c1c052a5c
children 16e3155f3496
files xen/arch/x86/vmx_intercept.c
line diff
     1.1 --- a/xen/arch/x86/vmx_intercept.c	Thu Jun 23 10:01:17 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_intercept.c	Thu Jun 23 10:02:54 2005 +0000
     1.3 @@ -214,6 +214,14 @@ void vmx_hooks_assist(struct vcpu *d)
     1.4  
     1.5      /* load init count*/
     1.6      if (p->state == STATE_IORESP_HOOK) { 
     1.7 +        /* set up actimer, handle re-init */
     1.8 +        if ( active_ac_timer(&(vpit->pit_timer)) ) {
     1.9 +            VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
    1.10 +            rem_ac_timer(&(vpit->pit_timer));
    1.11 +        }
    1.12 +        else
    1.13 +            init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
    1.14 +
    1.15          /* init count for this channel */
    1.16          vpit->init_val = (p->u.data & 0xFFFF) ; 
    1.17          /* frequency(ms) of pit */
    1.18 @@ -248,9 +256,7 @@ void vmx_hooks_assist(struct vcpu *d)
    1.19  
    1.20          vpit->intr_bitmap = intr;
    1.21  
    1.22 -        /* set up the actimer */
    1.23 -        init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
    1.24 -        pit_timer_fn(vpit); /* timer seed */
    1.25 +	set_ac_timer(&vpit->pit_timer, NOW() + MILLISECS(vpit->period));
    1.26  
    1.27          /*restore the state*/
    1.28          p->state = STATE_IORESP_READY;